mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-09-06 19:21:54 +00:00
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.
|
# Whether to use the packaged providers.json file.
|
||||||
if not oembed_config.get("disable_default_providers") or False:
|
if not oembed_config.get("disable_default_providers") or False:
|
||||||
providers = json.load(
|
with pkg_resources.resource_stream("synapse", "res/providers.json") as s:
|
||||||
pkg_resources.resource_stream("synapse", "res/providers.json")
|
providers = json.load(s)
|
||||||
)
|
|
||||||
yield from self._parse_and_validate_provider(
|
yield from self._parse_and_validate_provider(
|
||||||
providers, config_path=("oembed",)
|
providers, config_path=("oembed",)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user