Issue 7665: test_urllib2 and test_ntpath fail if path contains "" (original) (raw)

Created on 2010-01-10 16:50 by flox, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
urllib2-conditionalise-path-hacking.patch Benno.Rice,2012-08-20 01:27 review
issue7665.patch serhiy.storchaka,2014-10-12 15:22 review
Messages (13)
msg97522 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-01-10 16:50
/tmp/py2u… → un\icode $ ./python Lib/test/regrtest.py test_urllib2 test_urllib2 test test_urllib2 failed -- Traceback (most recent call last): File "/tmp/py2u… → un\icode/Lib/test/test_urllib2.py", line 36, in test_trivial f = urllib2.urlopen(file_url) File "/tmp/py2u… → un\icode/Lib/urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) File "/tmp/py2u… → un\icode/Lib/urllib2.py", line 391, in open response = self._open(req, data) File "/tmp/py2u… → un\icode/Lib/urllib2.py", line 409, in _open '_open', req) File "/tmp/py2u… → un\icode/Lib/urllib2.py", line 369, in _call_chain result = func(*args) File "/tmp/py2u… → un\icode/Lib/urllib2.py", line 1260, in file_open return self.open_local_file(req) File "/tmp/py2u… → un\icode/Lib/urllib2.py", line 1297, in open_local_file raise URLError(msg) URLError: <urlopen error [Errno 2] No such file or directory: '/tmp/py2u\xe2\x80\xa6 \xe2\x86\x92 un/icode/Lib/urllib2.pyc'> 1 test failed: test_urllib2
msg97527 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-01-10 17:41
Similar issue with test_ntpath. /tmp/py2u… → un\icode $ ./python Lib/test/regrtest.py test_ntpath test_ntpath test test_ntpath failed -- Traceback (most recent call last): File "/tmp/py2u… → un\icode/Lib/test/test_ntpath.py", line 171, in test_relpath tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a') File "/tmp/py2u… → un\icode/Lib/test/test_ntpath.py", line 13, in tester %(str(fn), str(wantResult), str(gotResult)) TestFailed: ntpath.relpath("a", "../b") should return: ..\py2u… → un\icode\a but returned: ..\icode\a 1 test failed: test_ntpath
msg168612 - (view) Author: Benno Rice (Benno.Rice) Date: 2012-08-20 01:27
This patch fixes the urllib2 test. I wasn't able to replicate the ntpath test failure. This patch needs testing on Windows to make sure I haven't broken anything.
msg221854 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-29 15:59
Can someone try to reproduce these on 2.7 as I no longer have it set up. If both problems can be reproduced I think the test_urllib2 problem should be dealt with here and a new issue opened for test_ntpath.
msg227712 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-09-27 18:43
The ntpath test failure is replicated when the test is ran directly: ~/py/cpython\1$ ./python Lib/test/test_ntpath.py ........................s........E..... ====================================================================== ERROR: test_relpath (__main__.TestNtpath) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_ntpath.py", line 314, in test_relpath tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a') File "Lib/test/test_ntpath.py", line 16, in tester %(str(fn), str(wantResult), str(gotResult))) test.support.TestFailed: ntpath.relpath("a", "../b") should return: ..\cpython\1\a but returned: ..\1\a ---------------------------------------------------------------------- Here is a patch with a fix of test_ntpath and with simpler fix of test_urllib2.
msg229159 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-10-12 15:07
Oh-oh, I didn't attached my patch and cleared my working space.
msg229161 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-10-12 15:08
> Oh-oh, I didn't attached my patch and cleared my working space. Too bad. I did the same mistake yesterday :-/
msg229166 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-10-12 15:22
Here is an attempt to reproduce my patch.
msg231937 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-12-01 13:38
Ping.
msg234271 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-01-18 20:14
Could you please look at the patch Senthil?
msg234314 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2015-01-19 15:34
I reviewed the patch Serhiy. It looks good to me, You can go ahead and commit. Thanks!
msg234721 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-01-26 08:29
New changeset 1e12c9e5bc89 by Serhiy Storchaka in branch '2.7': Issue #7665: Fixed tests test_ntpath and test_urllib2 when ran in the https://hg.python.org/cpython/rev/1e12c9e5bc89 New changeset 04fa56628830 by Serhiy Storchaka in branch '3.4': Issue #7665: Fixed tests test_ntpath and test_urllib2 when ran in the https://hg.python.org/cpython/rev/04fa56628830 New changeset 1db1cd711104 by Serhiy Storchaka in branch 'default': Issue #7665: Fixed tests test_ntpath and test_urllib2 when ran in the https://hg.python.org/cpython/rev/1db1cd711104
msg234722 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-01-26 08:31
Thank for your review Senthil.
History
Date User Action Args
2022-04-11 14:56:56 admin set github: 51914
2015-01-26 08:31:46 serhiy.storchaka set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2015-01-26 08:29:35 python-dev set nosy: + python-devmessages: +
2015-01-19 15:34:18 orsenthil set assignee: orsenthil -> serhiy.storchakamessages: +
2015-01-18 20:14:27 serhiy.storchaka set messages: +
2014-12-01 13:38:10 serhiy.storchaka set messages: +
2014-10-12 15:22:19 serhiy.storchaka set files: + issue7665.patchmessages: +
2014-10-12 15:08:43 vstinner set messages: +
2014-10-12 15:07:25 serhiy.storchaka set messages: +
2014-09-27 18:43:33 serhiy.storchaka set nosy: + serhiy.storchakamessages: + versions: + Python 3.4, Python 3.5
2014-06-29 15:59:58 BreamoreBoy set nosy: + BreamoreBoymessages: +
2012-09-19 02:09:27 ezio.melotti set nosy: + vstinnerstage: needs patch -> patch review
2012-08-20 01:27:37 Benno.Rice set files: + urllib2-conditionalise-path-hacking.patchnosy: + Benno.Ricemessages: + keywords: + patch
2010-01-10 18:05:29 orsenthil set assignee: orsenthil
2010-01-10 17:41:31 flox set messages: + title: test_urllib2 fails if path contains "\" -> test_urllib2 and test_ntpath fail if path contains "\"
2010-01-10 17:07:26 ezio.melotti set priority: normalnosy: + orsenthil, ezio.melottistage: needs patch
2010-01-10 16:50:24 flox create