Skip to content

Commit

Permalink
config update
Browse files Browse the repository at this point in the history
  • Loading branch information
IonascuDenisa committed Jan 24, 2024
1 parent f74910b commit 194698d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scrapyd/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import glob
import io
from pkgutil import get_data
from six.moves.configparser import SafeConfigParser, NoSectionError, NoOptionError
from six.moves.configparser import RawConfigParser, NoSectionError, NoOptionError
from os.path import expanduser

from scrapy.utils.conf import closest_scrapy_cfg
Expand All @@ -16,17 +16,17 @@ def __init__(self, values=None, extra_sources=()):
if values is None:
sources = self._getsources()
default_config = get_data(__package__, 'default_scrapyd.conf').decode('utf8')
self.cp = SafeConfigParser()
self.cp.readfp(io.StringIO(default_config))
self.cp = RawConfigParser()
self.cp.read_file(io.StringIO(default_config))
sources.extend(extra_sources)
for fname in sources:
try:
with io.open(fname) as fp:
self.cp.readfp(fp)
self.cp.read_file(fp)
except (IOError, OSError):
pass
else:
self.cp = SafeConfigParser(values)
self.cp = RawConfigParser(values)
self.cp.add_section(self.SECTION)

def _getsources(self):
Expand Down

0 comments on commit 194698d

Please sign in to comment.