Skip to content
Snippets Groups Projects
Unverified Commit 684feeaf authored by Petr Vaněk's avatar Petr Vaněk Committed by GitHub
Browse files

Properly close providers.json file stream. (#12794)

parent 66a5f6c4
No related branches found
No related tags found
No related merge requests found
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): ...@@ -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",)
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment