Opened 5 years ago

Closed 5 years ago

#31076 closed Bug (fixed)

dbshell crashes on Windows and Python < 3.8.

Reported by: Mariusz Felisiak Owned by: zeynel
Component: Database layer (models, ORM) Version: dev
Severity: Release blocker Keywords:
Cc: Jon Dufresne, Carlton Gibson Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

subprocess.run()'s args parameter accepts a path-like object on Windows since Python 3.8 (see documentation), so 26554cf5d1e96db10d0d5f4b69683a22fb82fdf8 broke using manage.py dbshell (maybe sth more) on Windows and Python < 3.8.

  File "C:\Python37\lib\subprocess.py", line 472, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Python37\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Python37\lib\subprocess.py", line 1119, in _execute_child
    args = list2cmdline(args)
  File "C:\Python37\lib\subprocess.py", line 530, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable

Regression in 26554cf5d1e96db10d0d5f4b69683a22fb82fdf8.

Change History (6)

comment:1 by Carlton Gibson, 5 years ago

Grrr. OK, this is an annoying one. Path is such a nice touch, by preference, I´d rather guard against this at the call point (casting with str()) than revert the change here.

comment:2 by zeynel, 5 years ago

Owner: changed from nobody to zeynel
Status: newassigned

comment:3 by zeynel, 5 years ago

Has patch: set

comment:4 by Mariusz Felisiak, 5 years ago

Needs tests: set

comment:5 by Mariusz Felisiak, 5 years ago

Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 9d40b6bb:

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.

Note: See TracTickets for help on using tickets.
Back to Top