1
0
Fork 0
mirror of synced 2024-06-20 19:20:20 +12:00

Merge pull request #512 from Serene-Arc/bug_fix_510

This commit is contained in:
Serene 2021-09-03 19:30:30 +10:00 committed by GitHub
commit 3040a35306
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -184,8 +184,9 @@ class RedditConnector(metaclass=ABCMeta):
logger.debug(f'Loading configuration from {path}')
break
if not self.config_location:
self.config_location = list(importlib.resources.path('bdfr', 'default_config.cfg').gen)[0]
shutil.copy(self.config_location, Path(self.config_directory, 'default_config.cfg'))
with importlib.resources.path('bdfr', 'default_config.cfg') as path:
self.config_location = path
shutil.copy(self.config_location, Path(self.config_directory, 'default_config.cfg'))
if not self.config_location:
raise errors.BulkDownloaderException('Could not find a configuration file to load')
self.cfg_parser.read(self.config_location)