[issue17933] test_ftp failure / ftplib error formatting issue

2013-07-18 Thread Rock Lee
Rock Lee added the comment: Yes, the simplest fix is just replace '%d' to '%s'. Line 2362 and 2374 all need to modify. -- ___ Python tracker ___

[issue17933] test_ftp failure / ftplib error formatting issue

2013-07-18 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I think "raise URLError('ftp error: %s' % reason) from reason" is just fine. -- ___ Python tracker ___ __

[issue17933] test_ftp failure / ftplib error formatting issue

2013-07-18 Thread Rock Lee
Rock Lee added the comment: yes, the malformed server could do evil things. If we need to cover this situation, we need to some extra fixes in this file. Maybe the exception message look like this is the better one ? ftplib.error_perm: 550 Failed to change directory -- __

[issue17933] test_ftp failure / ftplib error formatting issue

2013-07-18 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: That's not safe as a misbehaving FTP server might not send a response code at all (highly unlikely but still...). Furthermore having the complete server response (response code + accompaining message) is a lot more helpful. -- _

[issue17933] test_ftp failure / ftplib error formatting issue

2013-07-18 Thread Rock Lee
Rock Lee added the comment: Fixed like this: raise URLError('ftp error: %d' % int(str(reason)[:3])) from reason I think this is the original author's intention. Actually, need to fix two places in urllib/request.py -- ___ Python tracker

[issue17933] test_ftp failure / ftplib error formatting issue

2013-07-18 Thread Rock Lee
Rock Lee added the comment: Bug in urllib/request.py. format string formatted error type variable 2373 except ftplib.error_perm as reason: 2374 raise URLError('ftp error: %d' % reason) from reason variable reason here is a instance of class ftplib.error_perm. We need to passed in a

[issue17933] test_ftp failure / ftplib error formatting issue

2013-07-18 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I cannot reproduce the issue on Ubuntu. As for the second exception I think it's safe to just do: - raise URLError('ftp error: %d' % reason) from reason + raise URLError('ftp error: %s' % reason) from reason (will commit that later) --

[issue17933] test_ftp failure / ftplib error formatting issue

2013-07-18 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue17933] test_ftp failure / ftplib error formatting issue

2013-05-07 Thread Antoine Pitrou
New submission from Antoine Pitrou: The following error appeared on some buildbots: http://buildbot.python.org/all/builders/x86%20Gentoo%203.x/builds/4195/steps/test/logs/stdio == ERROR: test_ftp (test.test_urllib2net.OtherNetwo