Skip to content

Commit

Permalink
fix: Fix dbs_dir with drive letter on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Jul 16, 2024
1 parent deb922d commit 8d1af40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Fixed

- The :ref:`schedule.json` webservice sets the ``node_name`` field in error responses.
- The :ref:`cancel.json` webservice now works on Windows.
- The :ref:`dbs_dir` setting no longer causes an error if it contains a drive letter on Windows.
- The :ref:`jobs_to_keep` setting no longer causes an error if a file to delete can't be deleted (for example, if the file is open on Windows).
- When managing multiple projects, the next pending job for all but one project was unreported by the :ref:`daemonstatus.json` and :ref:`listjobs.json` webservices, and was not cancellable by the :ref:`cancel.json` webservice.

Expand Down
2 changes: 1 addition & 1 deletion scrapyd/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_spider_queues(config):

def sqlite_connection_string(config, database):
dbs_dir = config.get('dbs_dir', 'dbs')
if dbs_dir == ':memory:' or urlsplit(dbs_dir).scheme:
if dbs_dir == ':memory:' or (urlsplit(dbs_dir).scheme and not os.path.splitdrive(dbs_dir)[0]):
return dbs_dir
if not os.path.exists(dbs_dir):
os.makedirs(dbs_dir)
Expand Down

0 comments on commit 8d1af40

Please sign in to comment.