mirror of
https://github.com/beetbox/beets.git
synced 2026-01-27 02:23:36 +01:00
Merge pull request #2566 from beetbox/yaml-encoding
Load YAML as binary data
This commit is contained in:
commit
0148070445
2 changed files with 6 additions and 3 deletions
|
|
@ -668,7 +668,7 @@ def load_yaml(filename):
|
|||
parsed, a ConfigReadError is raised.
|
||||
"""
|
||||
try:
|
||||
with open(filename, 'r') as f:
|
||||
with open(filename, 'rb') as f:
|
||||
return yaml.load(f, Loader=Loader)
|
||||
except (IOError, yaml.error.YAMLError) as exc:
|
||||
raise ConfigReadError(filename, exc)
|
||||
|
|
@ -908,9 +908,10 @@ class Configuration(RootView):
|
|||
default_source = source
|
||||
break
|
||||
if default_source and default_source.filename:
|
||||
with open(default_source.filename, 'r') as fp:
|
||||
with open(default_source.filename, 'rb') as fp:
|
||||
default_data = fp.read()
|
||||
yaml_out = restore_yaml_comments(yaml_out, default_data)
|
||||
yaml_out = restore_yaml_comments(yaml_out,
|
||||
default_data.decode('utf8'))
|
||||
|
||||
return yaml_out
|
||||
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@ Fixes:
|
|||
* :doc:`/plugins/web`: Avoid a crash when sending binary data, such as
|
||||
Chromaprint fingerprints, in music attributes. :bug:`2542` :bug:`2532`
|
||||
* Fix a hang when parsing templates that end in newlines. :bug:`2562`
|
||||
* Fix a crash when reading non-ASCII characters in configuration files on
|
||||
Windows under Python 3. :bug:`2456` :bug:`2565` :bug:`2566`
|
||||
|
||||
Two plugins had backends removed due to bitrot:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue