Skip to content

Commit 56aaba8

Browse files
committed
Null byte replacement fix
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40516
1 parent 1b1df63 commit 56aaba8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/inputstream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(self, source, encoding=None):
5151

5252
# Normalize new ipythonlines and null characters
5353
uString = re.sub('\r\n?', '\n', uString)
54-
uString = re.sub('\x00', '\xFFFD', uString)
54+
uString = re.sub('\x00', u'\uFFFD', uString)
5555

5656
# Convert the unicode string into a list to be used as the data stream
5757
self.dataStream = uString

utils/spider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def updateURLs(self, tree):
8181
except KeyError:
8282
pass
8383

84-
#Remove all non-http URLs and add a sutiable base URL where that is
84+
#Remove all non-http URLs and a dd a sutiable base URL where that is
8585
#missing
8686
newUrls = set()
8787
for url in urls:
@@ -99,7 +99,7 @@ def updateURLs(self, tree):
9999
try:
100100
resp, content = self.http.request(url, "HEAD")
101101
responseHeaders[url] = resp
102-
except AttributeError:
102+
except AttributeError, KeyError:
103103
#Don't know why this happens
104104
pass
105105

0 commit comments

Comments
 (0)