Re: [Django] #32202: django-admin runserver and get_child_arguments() crashes on Windows and Python < 3.8.

2020-11-19 Thread Django
#32202: django-admin runserver and get_child_arguments() crashes on Windows and
Python < 3.8.
-+-
 Reporter:  andrey-zotov |Owner:  Carlton
 |  Gibson
 Type:  Bug  |   Status:  closed
Component:  Core (Management |  Version:  3.1
  commands)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Carlton Gibson ):

 In [changeset:"012822c7f9eb2be2f44cb3235eb66ca207d37133" 012822c7]:
 {{{
 #!CommitTicketReference repository=""
 revision="012822c7f9eb2be2f44cb3235eb66ca207d37133"
 [3.1.x] Fixed #32202 -- Fixed autoreloader argument generation for Windows
 with Python 3.7-.

 Backport of ead37dfb580136cc27dbd487a1f1ad90c9235d15 from master
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32202#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.991bc42b5771c19034d1ffc2c2002158%40djangoproject.com.


Re: [Django] #32202: django-admin runserver and get_child_arguments() crashes on Windows and Python < 3.8.

2020-11-19 Thread Django
#32202: django-admin runserver and get_child_arguments() crashes on Windows and
Python < 3.8.
-+-
 Reporter:  andrey-zotov |Owner:  Carlton
 |  Gibson
 Type:  Bug  |   Status:  closed
Component:  Core (Management |  Version:  3.1
  commands)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by GitHub ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"ead37dfb580136cc27dbd487a1f1ad90c9235d15" ead37dfb]:
 {{{
 #!CommitTicketReference repository=""
 revision="ead37dfb580136cc27dbd487a1f1ad90c9235d15"
 Fixed #32202 -- Fixed autoreloader argument generation for Windows with
 Python 3.7-.
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32202#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.6813a99d73014cadcfe42b42009552f3%40djangoproject.com.


Re: [Django] #32202: django-admin runserver and get_child_arguments() crashes on Windows and Python < 3.8.

2020-11-18 Thread Django
#32202: django-admin runserver and get_child_arguments() crashes on Windows and
Python < 3.8.
-+-
 Reporter:  andrey-zotov |Owner:  Carlton
 |  Gibson
 Type:  Bug  |   Status:  assigned
Component:  Core (Management |  Version:  3.1
  commands)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: <https://code.djangoproject.com/ticket/32202#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.9d281580113380e1312e74ac8ab27953%40djangoproject.com.


Re: [Django] #32202: django-admin runserver and get_child_arguments() crashes on Windows and Python < 3.8.

2020-11-18 Thread Django
#32202: django-admin runserver and get_child_arguments() crashes on Windows and
Python < 3.8.
-+-
 Reporter:  andrey-zotov |Owner:  Carlton
 |  Gibson
 Type:  Bug  |   Status:  assigned
Component:  Core (Management |  Version:  3.1
  commands)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/13693 PR]

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32202#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.b9d5b80ab81ae8ca083a56bdfa96637e%40djangoproject.com.


Re: [Django] #32202: django-admin runserver and get_child_arguments() crashes on Windows and Python < 3.8.

2020-11-17 Thread Django
#32202: django-admin runserver and get_child_arguments() crashes on Windows and
Python < 3.8.
-+-
 Reporter:  andrey-zotov |Owner:  Carlton
 |  Gibson
 Type:  Bug  |   Status:  assigned
Component:  Core (Management |  Version:  3.1
  commands)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * owner:  nobody => Carlton Gibson
 * status:  new => assigned


-- 
Ticket URL: <https://code.djangoproject.com/ticket/32202#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.ee39914e60cc1d2825400dc9e1ca08b8%40djangoproject.com.


Re: [Django] #32202: django-admin runserver and get_child_arguments() crashes on Windows and Python < 3.8. (was: django-admin runserver and get_child_arguments)

2020-11-17 Thread Django
#32202: django-admin runserver and get_child_arguments() crashes on Windows and
Python < 3.8.
-+-
 Reporter:  andrey-zotov |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Core (Management |  Version:  3.1
  commands)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * cc: Carlton Gibson, Tom Forbes (added)
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 Tentatively accepted, I cannot check this on Windows, but it looks like a
 regression in 8a902b7ee622ada258d15fb122092c1f02b82698.
 `subprocess.run()`'s `args` parameter accepts path-like objects on Windows
 since Python 3.8 (see similar issue for `dbshell`, #31076).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32202#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.3b0ae9cb45cad1c4df6221315c675f55%40djangoproject.com.


[Django] #32202: django-admin runserver and get_child_arguments

2020-11-17 Thread Django
#32202: django-admin runserver and get_child_arguments
-+-
   Reporter:  andrey-|  Owner:  nobody
  zotov  |
   Type:  Bug| Status:  new
  Component:  Core   |Version:  3.1
  (Management commands)  |
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 "django-admin runserver" fails with the following error:

 {{{
 Traceback (most recent call last):
   File
 "c:\users\someone\appdata\local\programs\python\python37\lib\runpy.py",
 line 193, in _run_module_as_main
 "__main__", mod_spec)
   File
 "c:\users\someone\appdata\local\programs\python\python37\lib\runpy.py",
 line 85, in _run_code
 exec(code, run_globals)
   File "C:\Users\someone\AppData\Local\Programs\Python\Python37\Scripts
 \django-admin.exe\__main__.py", line 7, in 
   File "c:\users\someone\appdata\local\programs\python\python37\lib\site-
 packages\django\core\management\__init__.py", line 401, in
 execute_from_command_line
 utility.execute()
   File "c:\users\someone\appdata\local\programs\python\python37\lib\site-
 packages\django\core\management\__init__.py", line 395, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File "c:\users\someone\appdata\local\programs\python\python37\lib\site-
 packages\django\core\management\base.py", line 330, in run_from_argv
 self.execute(*args, **cmd_options)
   File "c:\users\someone\appdata\local\programs\python\python37\lib\site-
 packages\django\core\management\commands\runserver.py", line 61, in
 execute
 super().execute(*args, **options)
   File "c:\users\someone\appdata\local\programs\python\python37\lib\site-
 packages\django\core\management\base.py", line 371, in execute
 output = self.handle(*args, **options)
   File "c:\users\someone\appdata\local\programs\python\python37\lib\site-
 packages\django\core\management\commands\runserver.py", line 96, in handle
 self.run(**options)
   File "c:\users\someone\appdata\local\programs\python\python37\lib\site-
 packages\django\core\management\commands\runserver.py", line 103, in run
 autoreload.run_with_reloader(self.inner_run, **options)
   File "c:\users\someone\appdata\local\programs\python\python37\lib\site-
 packages\django\utils\autoreload.py", line 616, in run_with_reloader
 exit_code = restart_with_reloader()
   File "c:\users\someone\appdata\local\programs\python\python37\lib\site-
 packages\django\utils\autoreload.py", line 244, in restart_with_reloader
 p = subprocess.run(args, env=new_environ, close_fds=False)
   File
 "c:\users\someone\appdata\local\programs\python\python37\lib\subprocess.py",
 line 488, in run
 with Popen(*popenargs, **kwargs) as process:
   File
 "c:\users\someone\appdata\local\programs\python\python37\lib\subprocess.py",
 line 800, in __init__
 restore_signals, start_new_session)
   File
 "c:\users\someone\appdata\local\programs\python\python37\lib\subprocess.py",
 line 1148, in _execute_child
 args = list2cmdline(args)
   File
 "c:\users\someone\appdata\local\programs\python\python37\lib\subprocess.py",
 line 555, in list2cmdline
 needquote = (" " in arg) or ("\t" in arg) or not arg
 TypeError: argument of type 'WindowsPath' is not iterable
 }}}

 Environment:
 Windows 10
 Python: 3.7.6
 Django: 3.1.3

 Steps to reproduce:
 {{{
 django-admin startproject mysite
 set PYTHONPATH=
 django-admin runserver --settings=mysite.settings
 }}}

 Apparently django.utils.autoreload.get_child_arguments returns
 WindowsPath("C:\Users\someone\AppData\Local\Programs\Python\Python37\Scripts
 \django-admin.exe") as the first argument,
 and subprocess.Popen expects a string and is not able to use Path.

 The following monkey-patch fixes the error:
 {{{
 def get_child_arguments_override():
 args = autoreload._get_child_arguments()
 for i, arg in enumerate(args):
 if isinstance(arg, Path):
 args[i] = str(arg)
 return args

 autoreload._get_child_arguments = autoreload.get_child_arguments
 autoreload.get_child_arguments = get_child_arguments_override
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32202>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django