summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2013-05-13 00:01:52 (GMT)
committerBenjamin Peterson <benjamin@python.org>2013-05-13 00:01:52 (GMT)
commit901a278861d070e55b426f8fb67bb83707da96d2 (patch)
tree10e09e7e44e974af3956a5ed53e14cf9d730debb /Lib/urllib
parent0ab18e4f4b93649031911099c6b2387a5098fd0e (diff)
downloadcpython-901a278861d070e55b426f8fb67bb83707da96d2.zip
cpython-901a278861d070e55b426f8fb67bb83707da96d2.tar.gz
cpython-901a278861d070e55b426f8fb67bb83707da96d2.tar.bz2
use correct format code for exceptions
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/request.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index b2a77eb..786055e 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -2294,7 +2294,7 @@ class ftpwrapper:
conn, retrlen = self.ftp.ntransfercmd(cmd)
except ftplib.error_perm as reason:
if str(reason)[:3] != '550':
- raise URLError('ftp error: %d' % reason).with_traceback(
+ raise URLError('ftp error: %r' % reason).with_traceback(
sys.exc_info()[2])
if not conn:
# Set transfer mode to ASCII!
@@ -2306,7 +2306,7 @@ class ftpwrapper:
try:
self.ftp.cwd(file)
except ftplib.error_perm as reason:
- raise URLError('ftp error: %d' % reason) from reason
+ raise URLError('ftp error: %r' % reason) from reason
finally:
self.ftp.cwd(pwd)
cmd = 'LIST ' + file