Senthil Kumaran <sent...@uthcode.com> added the comment:

Hello Bernhard, 

I tried to a POST of JPEG file, through urllib2 (which internally uses httplib) 
and goes through the code that you pointed out and I don't face any problem. I 
am able to POST binaries using httplib.

I am also surprised at UnicodeDecodeError which is being raised. The POST data 
is string (8-bit strings) in Python2.7 and the portion of code will have no 
problem in creating the content.

You will get UnicodeDecodeError, only if you explicitly pass a Unicode Object 
as Data and never when you pass string or binary string.

Perhaps mechanize is doing something wrong here and sending a Unicode object.

So, this really does not look like a bug to me.

(Also a note on patch. The patch tries to silence the error, which is wrong 
thing to do).

If you can provide a simple snippet to reproduce this error, feel free reopen 
this again. I am closing this as 'works for me'.

Thanks.

----------
assignee:  -> orsenthil
resolution:  -> works for me
stage: test needed -> committed/rejected
status: open -> closed

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

Reply via email to