diff options
author | Georg Brandl <georg@python.org> | 2007-08-31 10:37:15 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-08-31 10:37:15 (GMT) |
commit | 7f13e6b3e2546a7d6402f969113d928cc1d58dfc (patch) | |
tree | 1b6b41e5a53beb659964a72d8f064c9ecdb0d5ed /Lib/urllib.py | |
parent | 226878cba507cff4b6ce094063682d0b0b53cbb9 (diff) | |
download | cpython-7f13e6b3e2546a7d6402f969113d928cc1d58dfc.zip cpython-7f13e6b3e2546a7d6402f969113d928cc1d58dfc.tar.gz cpython-7f13e6b3e2546a7d6402f969113d928cc1d58dfc.tar.bz2 |
string.maketrans() now produces translation tables for bytes.translate() -- wrong module?
Fix all remaining instances that did bad things with the new str.translate().
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r-- | Lib/urllib.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index a1e26f0..04fd50a 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -1420,7 +1420,6 @@ def reporthook(blocknum, blocksize, totalsize): # Test program def test(args=[]): - import string if not args: args = [ '/etc/passwd', @@ -1443,9 +1442,7 @@ def test(args=[]): fp = open(fn, 'rb') data = fp.read() del fp - if '\r' in data: - table = string.maketrans("", "") - data = data.translate(table, "\r") + data = data.replace("\r", "") print(data) fn, h = None, None print('-'*40) |