1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #31076 -- Fixed dbshell crash on Windows with Python < 3.8.

subprocess.run()'s args parameter accepts path-like objects on Windows
since Python 3.8.
This commit is contained in:
Zeynel Özdemir
2019-12-15 00:13:33 +01:00
committed by Mariusz Felisiak
parent 4161e35048
commit 9d40b6bbf4
2 changed files with 34 additions and 1 deletions

View File

@@ -7,6 +7,8 @@ class DatabaseClient(BaseDatabaseClient):
executable_name = 'sqlite3'
def runshell(self):
# TODO: Remove str() when dropping support for PY37.
# args parameter accepts path-like objects on Windows since Python 3.8.
args = [self.executable_name,
self.connection.settings_dict['NAME']]
str(self.connection.settings_dict['NAME'])]
subprocess.run(args, check=True)