forked from MirrorHub/synapse
Properly close providers.json file stream. (#12794)
This commit is contained in:
parent
66a5f6c400
commit
684feeaf2f
1
changelog.d/12794.bugfix
Normal file
1
changelog.d/12794.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Fix a bug introduced in 1.43.0 where a file (`providers.json`) was never closed. Contributed by @arkamar.
|
|
@ -57,9 +57,9 @@ class OembedConfig(Config):
|
|||
"""
|
||||
# Whether to use the packaged providers.json file.
|
||||
if not oembed_config.get("disable_default_providers") or False:
|
||||
providers = json.load(
|
||||
pkg_resources.resource_stream("synapse", "res/providers.json")
|
||||
)
|
||||
with pkg_resources.resource_stream("synapse", "res/providers.json") as s:
|
||||
providers = json.load(s)
|
||||
|
||||
yield from self._parse_and_validate_provider(
|
||||
providers, config_path=("oembed",)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue