Terry J. Reedy <tjre...@udel.edu> added the comment:

There are definitely platform differences. As I noted, the original example 
works fine on Windows. However

>>> root.clipboard_get(type='STRING')
'abc€'
>>> root.clipboard_get(type='UTF8_STRING')
Traceback (most recent call last):
  File "<pyshell#21>", line 1, in <module>
    root.clipboard_get(type='UTF8_STRING')
  File "C:\Programs\Python33\lib\tkinter\__init__.py", line 549, in 
clipboard_get
    return self.tk.call(('clipboard', 'get') + self._options(kw))
_tkinter.TclError: CLIPBOARD selection doesn't exist or form "UTF8_STRING" not 
defined

Of course, on Windows I suspect that the unicode string is not copied to 
clipboard as utf8 bytes, so if clipboard contents are tagged, there would not 
be such a thing. Perhaps clipboards work differently on diffferent OSes.

>>> help(root.clipboard_get)
...
    The type keyword specifies the form in which the data is
    to be returned and should be an atom name such as STRING
    or FILE_NAME.  Type defaults to STRING.

(Actually, FILE_NAME give the same exception as UTF8_STRING.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14777>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to