Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Neil Cerutti Newsgroups: comp.lang.python Subject: Re: Stripping characters from windows clipboard with win32clipboard from excel Date: 19 Sep 2013 15:53:12 GMT Organization: Norwich University Lines: 27 Message-ID: References: <13c19665-6dc9-49fe-88c8-52c643892eba@googlegroups.com> <523A01C5.4080705@mrabarnett.plus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net fFm0iHXMZsjJlKSJfC468ACYrcK9mVw0HjunzVZdQQXC/cMiVc Cancel-Lock: sha1:urdkq79h4G3sLFgG87N5hU6tCEc= User-Agent: slrn/0.9.9p1/mm/ao (Win32) Xref: csiph.com comp.lang.python:54428 On 2013-09-18, Dave Angel 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. -- Neil Cerutti