Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #54444

Re: Stripping characters from windows clipboard with win32clipboard from excel

From Dave Angel <davea@davea.name>
Subject Re: Stripping characters from windows clipboard with win32clipboard from excel
Date 2013-09-19 19:58 +0000
References (2 earlier) <523A01C5.4080705@mrabarnett.plus.com> <mailman.136.1379535222.18130.python-list@python.org> <ssmdnZcwzNaQg6fPnZ2dnUVZ_rqdnZ2d@westnet.com.au> <mailman.141.1379548344.18130.python-list@python.org> <ba0kv8FihtvU1@mid.individual.net>
Newsgroups comp.lang.python
Message-ID <mailman.160.1379620726.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 19/9/2013 11:53, Neil Cerutti wrote:

> On 2013-09-18, Dave Angel <davea@davea.name> wrote:
>> On 18/9/2013 17:40, Neil Hodgson wrote:
>>
>>> Dave Angel:
>>>
>>>> So is the bug in Excel, in Windows, or in the Python library?  Somebody
>>>> is falling down on the job;  if Windows defines the string as ending at
>>>> the first null, then the Python interface should use that when defining
>>>> the text defined with CF_UNICODETEXT.
>>>
>>>     Everything is performing correctly. win32clipboard is low-level 
>>> direct access to the Win32 clipboard API. A higher level API which is 
>>> more easily used from Python could be defined on top of this if anyone 
>>> was motivated.
>>>
>>>     Neil
>>
>> Clearly you miss the point.  If the clipboard API is defined to
>> return a null-terminated string, then the problem is in the
>> Python library which doesn't do a strlen() (or the
>> wide-character equivalent;  I forget its name) on the results.
>
> Python can't really know if you're pasting text or a screenshot
> or what.
>

 CF_UNICODETEXT  gives it a pretty good clue.

But random832 has already mentioned that it's an ill-specified Windows
interface;  different programs deal with it differently.  No way that a
the Python library should deal with that.

-- 
DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Stripping characters from windows clipboard with win32clipboard from excel stephen.boulet@gmail.com - 2013-09-12 16:01 -0700
  Re: Stripping characters from windows clipboard with win32clipboard from excel Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-13 00:19 +0000
  Re: Stripping characters from windows clipboard with win32clipboard from excel stephen.boulet@gmail.com - 2013-09-12 17:58 -0700
    Re: Stripping characters from windows clipboard with win32clipboard from excel MRAB <python@mrabarnett.plus.com> - 2013-09-13 02:56 +0100
    Re: Stripping characters from windows clipboard with win32clipboard from excel Neil Hodgson <nhodgson@iinet.net.au> - 2013-09-13 13:43 +1000
      Re: Stripping characters from windows clipboard with win32clipboard from excel stephen.boulet@gmail.com - 2013-09-13 07:31 -0700
        Re: Stripping characters from windows clipboard with win32clipboard from excel Neil Cerutti <neilc@norwich.edu> - 2013-09-13 14:37 +0000
        Re: Stripping characters from windows clipboard with win32clipboard from excel stephen.boulet@gmail.com - 2013-09-13 07:38 -0700
          Re: Stripping characters from windows clipboard with win32clipboard from excel random832@fastmail.us - 2013-09-13 12:09 -0400
          Re: Stripping characters from windows clipboard with win32clipboard from excel random832@fastmail.us - 2013-09-18 15:19 -0400
  Re: Stripping characters from windows clipboard with win32clipboard from excel stephen.boulet@gmail.com - 2013-09-17 09:00 -0700
  Re: Stripping characters from windows clipboard with win32clipboard from excel stephen.boulet@gmail.com - 2013-09-18 12:28 -0700
    Re: Stripping characters from windows clipboard with win32clipboard from excel MRAB <python@mrabarnett.plus.com> - 2013-09-18 20:40 +0100
    Re: Stripping characters from windows clipboard with win32clipboard from excel Dave Angel <davea@davea.name> - 2013-09-18 20:13 +0000
      Re: Stripping characters from windows clipboard with win32clipboard from excel Neil Hodgson <nhodgson@iinet.net.au> - 2013-09-19 07:40 +1000
        Re: Stripping characters from windows clipboard with win32clipboard from excel Dave Angel <davea@davea.name> - 2013-09-18 23:51 +0000
          Re: Stripping characters from windows clipboard with win32clipboard from excel Neil Cerutti <neilc@norwich.edu> - 2013-09-19 15:53 +0000
            Re: Stripping characters from windows clipboard with win32clipboard from excel Dave Angel <davea@davea.name> - 2013-09-19 19:58 +0000
    Re: Stripping characters from windows clipboard with win32clipboard from excel random832@fastmail.us - 2013-09-19 10:39 -0400

csiph-web