Issue 14639: Different behavior for urllib2 in Python 2.7 (original) (raw)

Created on 2012-04-20 23:13 by Diego.Manenti.Martins, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg158897 - (view) Author: Diego Manenti Martins (Diego.Manenti.Martins) Date: 2012-04-20 23:13
this code sends data in a different way if using python 2.6 or python 2.7 >>> import urllib2 >>> url = 'http://server.com/post_image?tid=zoV6LJ' >>> f = open('test.jpg') >>> data = f.read() >>> res = urllib2.urlopen(url, data) I checked it with wireshark and the data is sent in a different way when using python 2.7 The code works for python2.5 and python2.6
msg158899 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2012-04-20 23:43
In what way is it different? Does it cause a problem, or is it compatible but different?
msg158902 - (view) Author: Diego Manenti Martins (Diego.Manenti.Martins) Date: 2012-04-21 00:56
It stoped to work. It was working when using with python 2.6 and crashed on switching to python 2.7 I expect the same behavior of curl -X POST http://server.com/post_image?tid=zoV6LJ -T test.jpg
msg158938 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2012-04-22 00:06
Could you give the proper POST FORM url which you were trying? I could try it in 2.6 and 2.7 and see if there is any difference. Nothing has changed that such low levels like the POST operations by sending of data.
msg184120 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2013-03-13 23:36
I am okay with closing this. If Diego gets back with more info or specifics of error, we can deal with it.
History
Date User Action Args
2022-04-11 14:57:29 admin set github: 58844
2013-03-13 23:36:30 orsenthil set status: pending -> closedmessages: + assignee: orsenthilresolution: wont fixstage: resolved
2013-03-13 23:30:22 ezio.melotti set status: open -> pending
2012-04-22 00:06:06 orsenthil set nosy: + orsenthilmessages: +
2012-04-21 00:56:58 Diego.Manenti.Martins set messages: +
2012-04-20 23:43:29 eric.smith set nosy: + eric.smithmessages: +
2012-04-20 23:13:46 Diego.Manenti.Martins create