Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Q: What do you say to a New Yorker with a job? A: Big Mac, fries and a Coke, please!


comp / comp.lang.python / win32clipboard writing to clipboard on Windows 11

SubjectAuthor
o win32clipboard writing to clipboard on Windows 11Rob Cliffe

1
Subject: win32clipboard writing to clipboard on Windows 11
From: Rob Cliffe
Newsgroups: comp.lang.python
Date: Mon, 17 Jun 2024 19:27 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: rob.cliffe@btinternet.com (Rob Cliffe)
Newsgroups: comp.lang.python
Subject: win32clipboard writing to clipboard on Windows 11
Date: Mon, 17 Jun 2024 20:27:51 +0100
Lines: 32
Message-ID: <mailman.145.1718652657.2909.python-list@python.org>
References: <f6e408ad-89c1-42b0-a771-d3677692f610@btinternet.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de lwcNJ52hwcVv3sVlQ7CrSwYdfCbhqqL6G98LRKZaW5jw==
Cancel-Lock: sha1:/IgvKbE2i5VF78LbNSP2WMUY7WQ= sha256:AeXy3I1HHgoG0vSJoQONUfTHNx/9fsBecKGY/WDhBTg=
Return-Path: <rob.cliffe@btinternet.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=btinternet.com header.i=@btinternet.com header.b=FkARu6ZN;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.012
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'traceback': 0.04; '(most':
0.05; 'last):': 0.05; 'subject:Windows': 0.07; 'acquired': 0.09;
'output:': 0.09; 'subject:writing': 0.09; 'import': 0.15;
'program:': 0.16; 'problem': 0.16; 'uses': 0.19; 'to:addr:python-
list': 0.20; 'machine': 0.22; 'laptop': 0.23; 'anyone': 0.25;
'old': 0.27; 'recently': 0.29; 'this?': 0.29; 'error': 0.29;
'header:User-Agent:1': 0.30; 'program': 0.31; 'encountered': 0.32;
'to:name:python': 0.32; 'received:192.168.1': 0.32; 'windows':
0.34; 'same': 0.34; 'running': 0.34; "skip:' 10": 0.37; 'using':
0.37; 'received:192.168': 0.37; 'file': 0.38; 'text': 0.39; 'use':
0.39; 'wishes': 0.40; 'best': 0.61; 'sample': 0.61; 'skip:o 10':
0.61; 'shed': 0.69; 'subject:skip:w 10': 0.76; '11;': 0.84; 'rob':
0.84; 'consists': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btinternet.com;
s=btmx2012311; t=1718652656;
bh=tAgBG2y8MQvheGOOH4mQ32J4ajvCOode2fIRUrXsQus=;
h=Message-ID:Date:MIME-Version:From:Subject:To;
b=FkARu6ZNGnCxAliMMXaQuUmRd/rE53d/ATvpoZanv/LE7cgvGgn10FQnk5wlZ6RasLiyErWHISarcmnZQTrfRaNOxilWVEt5S/4o41OBEM+NiQ+zqSz1n1EYRVYyUN8Uc0ajvFTh7hk4GE4fmaIRY2kzmISVtyWWuZKhWNukIY7MFFF0PnBI2ZP/UccemQCxLD0S/yRWKlF8Fy5/kJsTmEDahtMJR4cE/+3cL3iGLE4pDEyCx/Eb432G6ms30P/TE3acyhek/fTwzipnmalTu+7NDHhL7xFWuo2g+/qFAsfBWTvC1Vyfsa6nNH2/O9eJU8Ce3lbj3iXB6WddfKp53g==
X-SNCR-Rigid: 666A0FCF00419F49
X-Originating-IP: [86.188.58.40]
X-OWM-Source-IP: 86.188.58.40
X-OWM-Env-Sender: rob.cliffe@btinternet.com
X-VadeSecure-score: verdict=clean score=0/300, class=clean
X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvledrfedvhedgudefjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucenucfjughrpefkffggfgfhuffvtgfgsehtkeertddtvdejnecuhfhrohhmpeftohgsucevlhhifhhfvgcuoehrohgsrdgtlhhifhhfvgessghtihhnthgvrhhnvghtrdgtohhmqeenucggtffrrghtthgvrhhnpeegueelvdeileefjeffhedtudejieevheehffeujeeugfffleduvdejfeejiedtheenucfkphepkeeirddukeekrdehkedrgedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgduledvrdduieekrddurddvtdekngdpihhnvghtpeekiedrudekkedrheekrdegtddpmhgrihhlfhhrohhmpehrohgsrdgtlhhifhhfvgessghtihhnthgvrhhnvghtrdgtohhmpdhnsggprhgtphhtthhopedupdhrtghpthhtohepphihthhhohhnqdhlihhsthesphihthhhohhnrdhorhhgpdhrvghvkffrpehhohhsthekiedqudekkedqheekqdegtddrrhgrnhhgvgekiedqudekkedrsghttggvnhhtrhgrlhhplhhushdrtghomhdprghuthhhpghushgvrheprhhosgdrtghlihhffhgvsegsthhinhhtvghrnhgvthdrtghomhdpghgvohfkrfepifeupdfovfetjfhoshhtpegsthhprhgurhhgohdtuddu
X-RazorGate-Vade-Verdict: clean 0
X-RazorGate-Vade-Classification: clean
X-SNCR-hdrdom: btinternet.com
X-SNCR-hdrdom: btinternet.com
X-SNCR-hdrdom: btinternet.com
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <f6e408ad-89c1-42b0-a771-d3677692f610@btinternet.com>
View all headers

Recently I acquired a new laptop running WIndows 11; my previous one
uses WIndows 10.  I encountered a strange problem:
I am using the win32clipboard backage (part of pywin32), and when I use
SetClipboardData() to write text which consists ***entirely of digits***
to the clipboard, I either get an error (not always the same error
message) or a program crash.  The problem does not appear if I use
SetClipboardText() instead.  The problem does not occur on my old
machine (where I used the feature extensively).

Sample program:

from win32clipboard import *
OpenClipboard()
SetClipboardData(CF_UNICODETEXT, "A")
SetClipboardData(CF_UNICODETEXT, "A0")
SetClipboardData(CF_UNICODETEXT, "0A")
SetClipboardText("0", CF_UNICODETEXT)
print("OK so far")
SetClipboardData(CF_UNICODETEXT, "0")
CloseClipboard()

Sample output:

OK so far
Traceback (most recent call last):
  File "C:\TEST*.PY", line 8, in <module>
    SetClipboardData(CF_UNICODETEXT, "0")
pywintypes.error: (0, 'SetClipboardData', 'No error message is available')

Can anyone shed light on this?
Best wishes
Rob Cliffe

1

rocksolid light 0.9.8
clearnet tor