[issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path

2014-06-24 Thread Rock Lee
Rock Lee added the comment: I tweaked the Lib/cProfile.py a little bit to get the feature done, please review the patch attached. -- keywords: +patch nosy: +rock Added file: http://bugs.python.org/file35775/cProfile-add-new-option-module.patch

[issue17933] format str bug in urllib request.py

2013-07-22 Thread Rock Lee
Rock Lee added the comment: Any progress for this issue? I changed the title of the issue. -- title: test_ftp failure / ftplib error formatting issue -> format str bug in urllib request.py ___ Python tracker <http://bugs.python.org/issu

[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 <http://bug

[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 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

[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