mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.6.x] 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.
Backport of 3841feee86 from master.
			
			
This commit is contained in:
		| @@ -103,7 +103,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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user