Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#33027 closed Bug (fixed)

Auto-reloader should pass -X options (for cpython implementation)

Reported by: dotuser Owned by: uddmorningsun
Component: Utilities Version: 3.2
Severity: Normal Keywords:
Cc: 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

Windows OS

$ winpty python -m django startproject my_project
$ cd my_project/
$ winpty python -m django startapp my_app

$ vi my_app/apps.py  # demo for xoptions ...
$ cat -n my_app/apps.py
     1  from django.apps import AppConfig
     2
     3  class MyAppConfig(AppConfig):
     4      default_auto_field = 'django.db.models.BigAutoField'
     5      name = 'my_app'
     6
     7  # myapp global initial_demo ...
     8  with open("manage.py", mode="r") as stream:
     9      print("=== %s" % stream.encoding)

$ vi my_project/settings.py  # INSTALLED_APPS
$  winpty python -X utf8 manage.py runserver 0.0.0.0:8005 -v3
=== UTF-8
=== cp936
Watching for file changes with StatReloader
Performing system checks...
... ...
$ winpty python -X utf8 manage.py runserver 0.0.0.0:8005 -v3 --noreload
=== UTF-8
Performing system checks...
... ...

Refer:

Change History (8)

comment:1 by Carlton Gibson, 3 years ago

Resolution: invalid
Status: newclosed

Hi. This looks like an issue prior to getting to Django:

winpty python -X utf8 ...

Django is not responsible for setting UTF8 mode.

comment:2 by Carlton Gibson, 3 years ago

Resolution: invalid
Status: closednew

I missed that this was about the auto-reloader. I will reopen to have another look.

In the meantime using the PYTHONUTF8 environment variable should work.

Last edited 3 years ago by Carlton Gibson (previous) (diff)

comment:3 by Carlton Gibson, 3 years ago

Summary: runserver command leave out of consideration xoption in cpython implementationAuto-reloader should pass -X options (for cpython implementation)

comment:4 by Carlton Gibson, 3 years ago

Triage Stage: UnreviewedAccepted

OK, let's accept this. We probably should pass the -X options if provided. Thanks.

comment:5 by Mariusz Felisiak, 3 years ago

Owner: changed from nobody to uddmorningsun
Patch needs improvement: set
Status: newassigned

comment:6 by Mariusz Felisiak, 3 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In 36d54b7a:

Fixed #33027 -- Made autoreloader pass -X options.

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In ee79fe0:

[4.0.x] Fixed #33027 -- Made autoreloader pass -X options.

Backport of 36d54b7a142689e0f882338159bca879d8b6d783 from main

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