diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-05-25 20:37:38 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-05-25 20:43:43 +0200 |
| commit | edfa95c22ffe8f58060bb985ad1b6fbca9506f5e (patch) | |
| tree | 9a8af000d186d2e9188c674bcb29fe5e52575f41 /django/core | |
| parent | e73838b6ddcc7b37c03f9eee04fa6e6a283fedb3 (diff) | |
Specified when open should use binary mode.
Thanks Vinaj Sajip for the help of his django3 branch.
Diffstat (limited to 'django/core')
| -rw-r--r-- | django/core/management/commands/compilemessages.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/management/commands/compilemessages.py b/django/core/management/commands/compilemessages.py index 354787eb91..fdc3535cf6 100644 --- a/django/core/management/commands/compilemessages.py +++ b/django/core/management/commands/compilemessages.py @@ -5,7 +5,7 @@ from optparse import make_option from django.core.management.base import BaseCommand, CommandError def has_bom(fn): - with open(fn, 'r') as f: + with open(fn, 'rb') as f: sample = f.read(4) return sample[:3] == '\xef\xbb\xbf' or \ sample.startswith(codecs.BOM_UTF16_LE) or \ |
