summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2014-02-20 19:13:25 +0100
committerBaptiste Mispelon <bmispelon@gmail.com>2014-02-20 19:13:25 +0100
commit3841feee86cae65165f120db7a5d80ffc76dd520 (patch)
tree9fc5091ee89041a8fa855bc054e9397df9eb275d /django/core
parentcb844497d01ddb45603e47891cdf36ae0b006d03 (diff)
Fixed #22107 -- Fixed django.core.files.File object iteration.
Due to a mixup between text and bytes, iteration over a File instance was broken under Python 3. Thanks to trac user pdewacht for the report and patch.
Diffstat (limited to 'django/core')
-rw-r--r--django/core/files/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/files/base.py b/django/core/files/base.py
index b1325291c6..641ff924c6 100644
--- a/django/core/files/base.py
+++ b/django/core/files/base.py
@@ -104,7 +104,7 @@ class File(FileProxyMixin):
# If this is the end of a line, yield
# otherwise, wait for the next round
- if line[-1] in ('\n', '\r'):
+ if line[-1:] in (b'\n', b'\r'):
yield line
else:
buffer_ = line