]> git.ipfire.org Git - thirdparty/babel.git/commit
Fix UnicodeEncodeError on file encoding detection 274/head
authorRoman Imankulov <roman.imankulov@gmail.com>
Tue, 13 Oct 2015 11:18:48 +0000 (11:18 +0000)
committerRoman Imankulov <roman.imankulov@gmail.com>
Mon, 4 Jan 2016 09:37:23 +0000 (09:37 +0000)
commitf9b04a5fb2ee166ca75358ff574f00d1cd62a916
treec35a82d5d363dfde6f95fda5b811b081e5a2ef6b
parent4f1e0c54aa069566450967e88614c9753ffe8796
Fix UnicodeEncodeError on file encoding detection

If the first line of a python file is not a valid latin-1 string,
parse_encoding dies with "UnicodeDecodeError". These strings nonetheless can be
valid in some scenarios (for example, Mako extractor uses
babel.messages.extract.extract_python), and it makes more sense to ignore this
exception and return None.
babel/util.py
tests/test_util.py