Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.7.x] Fixed #22399 -- Forced fixture reading in binary mode

This might help on systems where default encoding is not UTF-8 (and
on Python 3).
Thanks bacilla for the report.
Backport of ed532a6 from master.
  • Loading branch information...
commit 8d7023dc714acc957fac7ef422ccee4d83429b09 1 parent 3a4a5a5
@claudep claudep authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/core/management/commands/loaddata.py
View
3  django/core/management/commands/loaddata.py
@@ -125,7 +125,8 @@ def load_label(self, fixture_label):
for fixture_file, fixture_dir, fixture_name in self.find_fixtures(fixture_label):
_, ser_fmt, cmp_fmt = self.parse_name(os.path.basename(fixture_file))
open_method = self.compression_formats[cmp_fmt]
- fixture = open_method(fixture_file, 'r')
+ # Forcing binary mode may be revisited after dropping Python 2 support (see #22399)
+ fixture = open_method(fixture_file, 'rb')
try:
self.fixture_count += 1
objects_in_fixture = 0
Please sign in to comment.
Something went wrong with that request. Please try again.