Skip to content

Commit 12daa8f

Browse files
committed
issue2550850 anypy/email_.py uses BSPACE which is not defined in python 2.7
Supplied a definition for BSPACE since it seems to not be defined anywhere (even searching a python 3.4 install didn't turn up a definition for it). BSPACE definition taken from: http://svn.python.org/projects/python/branches/py3k-urllib/Lib/email/header.py which is almost identical code. Put definition of BSPACE just before the reference to minimize scope and chance of unintended issues. This isn't the best place because it will be redefined every time through, but this is not a heavily used code path or it would have been found/fixed long ago.
1 parent ed26c8f commit 12daa8f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ Fixed:
123123
pagesize is not propigated to the prev link. This patch fixes that.
124124
Patch provided by John Kristensen. (Applied, light testing by John
125125
Rouillard.)
126+
- issue2550850 anypy/email_.py uses BSPACE which is not defined in python 2.7
127+
Supplied a definition for BSPACE since it seems to not be defined
128+
anywhere. Reported by Dennis Boone. (John Rouillard)
126129

127130
2016-01-11: 1.5.1
128131

roundup/anypy/email_.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def decode_header(header):
122122
last_word = word
123123
last_charset = charset
124124
elif last_charset is None:
125+
BSPACE = b' '
125126
last_word += BSPACE + word
126127
else:
127128
last_word += word

0 commit comments

Comments
 (0)