Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/django/django
/ has_bom
Function
has_bom
django/core/management/commands/compilemessages.py:12–17 ·
view source on GitHub ↗
(fn)
Source
from the content-addressed store, hash-verified
10
11
12
def
has_bom(fn):
13
with
fn.open(
"rb"
)
as
f:
14
sample = f.read(4)
15
return
sample.startswith(
16
(codecs.BOM_UTF8, codecs.BOM_UTF16_LE, codecs.BOM_UTF16_BE)
17
)
18
19
20
def
is_dir_writable(path):
Callers
1
compile_messages
Method · 0.85
Calls
2
open
Method · 0.45
read
Method · 0.45
Tested by
no test coverage detected