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

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'win32': 0.03; 'api.': 0.05; 'string': 0.09; 'defines': 0.09; 'differently.': 0.09; 'equivalent;': 0.09; 'library?': 0.09; 'null,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:characters': 0.09; 'windows,': 0.09; 'api': 0.11; 'python': 0.11; 'bug': 0.12; 'windows': 0.15; 'name)': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:windows': 0.16; 'wrote:': 0.18; 'library': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'string,': 0.24; '(or': 0.24; 'performing': 0.26; 'defined': 0.27; 'header:X-Complaints-To:1': 0.27; "doesn't": 0.30; 'gives': 0.31; 'that.': 0.31; '>>>>': 0.31; 'correctly.': 0.31; 'anyone': 0.31; 'interface': 0.32; 'text': 0.33; 'subject:from': 0.34; 'could': 0.34; 'problem': 0.35; 'subject:with': 0.35; "can't": 0.35; 'point.': 0.35; 'but': 0.35; 'really': 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'level': 0.37; 'easily': 0.37; 'somebody': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'dave': 0.60; 'results.': 0.60; 'mentioned': 0.61; "you're": 0.61; 'first': 0.61; 'skip:n 10': 0.64; 'more': 0.64; 'different': 0.65; 'direct': 0.67; 'miss': 0.74; 'ending': 0.78; 'excel,': 0.84; 'job;': 0.84; 'pasting': 0.84; 'angel': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dave Angel <davea@davea.name>
Subject Re: Stripping characters from windows clipboard with win32clipboard from excel
Date Thu, 19 Sep 2013 19:58:24 +0000 (UTC)
References <13c19665-6dc9-49fe-88c8-52c643892eba@googlegroups.com> <a468f029-0345-425b-a9d1-5fc2f03d8be7@googlegroups.com> <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>
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 174.32.174.35
User-Agent XPN/1.2.6 (Street Spirit ; Linux)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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 <http://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>
Newsgroups comp.lang.python
Message-ID <mailman.160.1379620726.18130.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1379620726 news.xs4all.nl 15890 [2001:888:2000:d::a6]:58244
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:54444

Show key headers only | 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