summaryrefslogtreecommitdiff
path: root/django/core/management/commands
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2015-10-25 09:27:10 -0700
committerJon Dufresne <jon.dufresne@gmail.com>2015-10-25 09:28:11 -0700
commit5d35b53c36b0f2e62964faa02faefc721787178e (patch)
treee81a287cb0ba717bfea9e76a16ce0720e32bfeb2 /django/core/management/commands
parent35440ceab72ea3c24f3faaea9765271c7dac78f7 (diff)
Removed hardcoded utf-8 BOM, used value from codecs instead.
Diffstat (limited to 'django/core/management/commands')
-rw-r--r--django/core/management/commands/compilemessages.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/django/core/management/commands/compilemessages.py b/django/core/management/commands/compilemessages.py
index 1901819d15..664c96de05 100644
--- a/django/core/management/commands/compilemessages.py
+++ b/django/core/management/commands/compilemessages.py
@@ -12,8 +12,7 @@ from django.utils._os import npath, upath
def has_bom(fn):
with open(fn, 'rb') as f:
sample = f.read(4)
- return (sample[:3] == b'\xef\xbb\xbf' or
- sample.startswith((codecs.BOM_UTF16_LE, codecs.BOM_UTF16_BE)))
+ return sample.startswith((codecs.BOM_UTF8, codecs.BOM_UTF16_LE, codecs.BOM_UTF16_BE))
def is_writable(path):