[issue18324] set_payload does not handle binary payloads correctly

2013-08-21 Thread R. David Murray
R. David Murray added the comment: Thanks, Vajrasky. The v2 patch was almost correct. What you couldn't know without being as deeply enmeshed in this code as I am is that the test failures from the encoders module were actually invalid. We'd previously "fixed" them, but the fixes were incorr

[issue18324] set_payload does not handle binary payloads correctly

2013-08-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 64e004737837 by R David Murray in branch '3.3': #18324: set_payload now correctly handles binary input. http://hg.python.org/cpython/rev/64e004737837 New changeset a4afcf93ef7b by R David Murray in branch 'default': Merge #18324: set_payload now cor

[issue18324] set_payload does not handle binary payloads correctly

2013-07-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the third version of the patch. I am not sure what to do with the invalid data for base64 and uuencode. I decided to raise exception instead of converting it to None silently. -- Added file: http://bugs.python.org/file31049/set_payload_binary_v3.

[issue18324] set_payload does not handle binary payloads correctly

2013-07-21 Thread R. David Murray
R. David Murray added the comment: Yes, that's what I had in mind. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue18324] set_payload does not handle binary payloads correctly

2013-07-21 Thread Vajrasky Kok
Vajrasky Kok added the comment: "It looks like you are still patching get_payload. This should be a really simple patch against set_payload." Okay, do I get it right at this time? About your second point, I need more time to think about it. -- Added file: http://bugs.python.org/file3

[issue18324] set_payload does not handle binary payloads correctly

2013-07-21 Thread R. David Murray
R. David Murray added the comment: It looks like you are still patching get_payload. This should be a really simple patch against set_payload. It occurs to me that there could be a backward compatibility concern if passing binary to set_payload currently actually works in some cases, so we de

[issue18324] set_payload does not handle binary payloads correctly

2013-07-21 Thread Vajrasky Kok
Vajrasky Kok added the comment: Sorry, got typo for the last patch. -- Added file: http://bugs.python.org/file30998/set_payload_binary.txt ___ Python tracker ___

[issue18324] set_payload does not handle binary payloads correctly

2013-07-21 Thread Vajrasky Kok
Changes by Vajrasky Kok : Removed file: http://bugs.python.org/file30997/set_payload_binary.txt ___ Python tracker ___ ___ Python-bugs-list ma

[issue18324] set_payload does not handle binary payloads correctly

2013-07-21 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch for this ticket. David Murray, am I on the right path? If yes, I'll put more robust tests, such as the ones with Asian encodings and unusual encodings. -- Added file: http://bugs.python.org/file30997/set_payload_binary.txt

[issue18324] set_payload does not handle binary payloads correctly

2013-07-10 Thread R. David Murray
R. David Murray added the comment: If you want to work on it that would be great. Note that one of the things that is needed is a bunch more tests of setting various *kinds* of binary payload, including ones containing non-ascii data, and making sure the right thing happens when the payload i

[issue18324] set_payload does not handle binary payloads correctly

2013-07-10 Thread Vajrasky Kok
Vajrasky Kok added the comment: I see. Thanks for the explanation. I'll do this patch if nobody is interested. -- ___ Python tracker ___ _

[issue18324] set_payload does not handle binary payloads correctly

2013-07-10 Thread R. David Murray
R. David Murray added the comment: Thanks, but the patch is incorrect. The model consistently stores its data as surrogateescaped strings, and this assumption is baked in to other parts of the code. So the correct fix is to do the surrogateescape encoding at the time the payload is set. It

[issue18324] set_payload does not handle binary payloads correctly

2013-07-10 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the preliminary patch for email module to pass the test. -- nosy: +vajrasky Added file: http://bugs.python.org/file30884/set_payload_handles_binary_correctly.txt ___ Python tracker

[issue18324] set_payload does not handle binary payloads correctly

2013-06-28 Thread R. David Murray
New submission from R. David Murray: In order to maintain model consistency without exposing the need for 'surrogateescape' to library users, it should be possible to pass binary data to set_payload and have it do the correct conversion to the expected storage format for the model. Currently,