[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-07-31 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 818989a48e96 by Serhiy Storchaka in branch '2.7': Issue #21580: Now Tkinter correctly handles binary "data" and "maskdata" http://hg.python.org/cpython/rev/818989a48e96 -- ___ Python tracker

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-07-30 Thread Martin v . Löwis
Martin v. Löwis added the comment: The 2.7_2 patch looks good to me. I won't rule on the backwards compatibility implications, although I agree that this is unlikely to cause a regression (it would only if somebody updated the standard library only, *and* would use data= for PhotoImage). I'm u

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-07-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Martin for your reviews. Here is updated 2.7 patch which implements your suggestion. The disadvantage of this patch in comparison with first version is that it will not work with statically compiled embedded Python, when only stdlib is updated. I

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9474f2971855 by Serhiy Storchaka in branch '3.4': Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk. http://hg.python.org/cpython/rev/9474f2971855 New changeset b9d249316f29 by Serhiy Storchaka in branch 'default': Issue #2158

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-07-30 Thread Martin v . Löwis
Martin v. Löwis added the comment: The 3.4 patch looks fine, please apply. I'm -1 on the 2.7 patch. I think it would be better to add a _tkinter helper function to create Tcl byte array objects. Alternatively, the "binary format" command might help. OTOH, I don't care about 2.7, so feel free t

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-07-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +loewis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-07-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: I will try test the problem and fix on Windows within a day. -- ___ Python tracker ___ ___ Python-bu

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-07-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-06-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Unfortunately we can't use this straightforward and universal solution in Python 2. Here is a patch which adds special workarounds to fix this issue in 2.7. -- Added file: http://bugs.python.org/file35432/tkinter_bytes-2.7.patch

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-06-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file35431/tkinter_bytes.patch ___ Python tracker ___ ___ Python-bugs-list mai

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-06-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file35402/tkinter_bytes.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-05-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which fixes passing Python bytes to Tcl in Python 3. However it will be not easy to fix this issue in Python 2. See also issue21605 which adds tests for Tkinter images (some of them fails without this patch). -- assignee: docs@python

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-05-28 Thread Martin Panter
Martin Panter added the comment: Thanks for looking at this. Originally the issue was found by reading the GIF and PNG images on various web pages, such as . However I was also able to produce the problem with the other formats of th

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: All works to me. >>> import tkinter >>> b = tkinter.Button() >>> with open('Lib/test/imghdrdata/python.gif', 'rb') as f: data = f.read() ... >>> img = tkinter.PhotoImage(data=data) >>> b['image'] = img >>> b.pack() Could you please provide an example which d

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-05-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +gpolo, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-05-25 Thread Martin Panter
New submission from Martin Panter: At the bottom of the “tkinter” doc page it mentions the “data” option is available. However I was unable to get it to work well when passing a plain bytes() string in. It seems the bytes() string gets interpreted as UTF-8 somewhere along the line, although th