{{{
(users) D:\django_test\dddd>pip install --upgrade django
Collecting django
Using cached Django-1.11.4-py2.py3-none-any.whl
Requirement already up-to-date: pytz in d:\env_python\users\lib\site-
packages (from django)
Installing collected packages: django
Found existing installation: Django 1.11.3
Uninstalling Django-1.11.3:
Successfully uninstalled Django-1.11.3
Successfully installed django-1.11.4
(users) D:\django_test\dddd>python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "D:\env_python\users\lib\site-
packages\django\core\management\__init__.py", line 363, in
execute_from_command_line
utility.execute()
File "D:\env_python\users\lib\site-
packages\django\core\management\__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\env_python\users\lib\site-
packages\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "D:\env_python\users\lib\site-
packages\django\core\management\commands\runserver.py", line 62, in
execute
super(Command, self).execute(*args, **options)
File "D:\env_python\users\lib\site-
packages\django\core\management\base.py", line 330, in execute
output = self.handle(*args, **options)
File "D:\env_python\users\lib\site-
packages\django\core\management\commands\runserver.py", line 101, in
handle
self.run(**options)
File "D:\env_python\users\lib\site-
packages\django\core\management\commands\runserver.py", line 110, in run
autoreload.main(self.inner_run, None, options)
File "D:\env_python\users\lib\site-packages\django\utils\autoreload.py",
line 341, in main
reloader(wrapped_main_func, args, kwargs)
File "D:\env_python\users\lib\site-packages\django\utils\autoreload.py",
line 312, in python_reloader
exit_code = restart_with_reloader()
File "D:\env_python\users\lib\site-packages\django\utils\autoreload.py",
line 294, in restart_with_reloader
str_value = force_bytes(new_environ[key], encoding=encoding)
File "D:\env_python\users\lib\site-packages\django\utils\encoding.py",
line 124, in force_bytes
return s.decode('utf-8', errors).encode(encoding, errors)
File "D:\env_python\users\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb8 in position 202:
invalid start byte
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28487>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: Mark Rogaski (added)
Comment:
What's the key/value of the environment variable that's causing the crash?
--
Ticket URL: <https://code.djangoproject.com/ticket/28487#comment:1>
Comment (by newerBkl):
Replying to [comment:1 Tim Graham]:
> What's the key/value of the environment variable that's causing the
crash?
I have no idea, it's just a new project without my own code and the
traceback doesn't give me any ideas about the cause.
--
Ticket URL: <https://code.djangoproject.com/ticket/28487#comment:2>
Comment (by Tim Graham):
You can add `print(key, new_environ[key])` before the line with
`force_bytes(new_environ[key], encoding=encoding)` to see the problematic
value.
--
Ticket URL: <https://code.djangoproject.com/ticket/28487#comment:3>
Comment (by newerBkl):
Replying to [comment:3 Tim Graham]:
> You can add `print(key, new_environ[key])` before the line with
`force_bytes(new_environ[key], encoding=encoding)` to see the problematic
value.
**Thanks , here is the output**
{{{
('TMP', 'C:\\Users\\100000\\AppData\\Local\\Temp')
('PSMODULEPATH',
'C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\')
('PROCESSOR_LEVEL', '6')
('_OLD_VIRTUAL_PATH', 'C:\\Program Files (x86)\\Common
Files\\NetSarang;C:\\Python27\\;C:\\Python27\\Scripts;C:\\Windows\\system32;C:\\Windows
;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program
Files (x86)\\\xb8\xbb\xbb\xf9\xd0\xfd\xb7\xe7\xbf\xc
6\xbc\xbc\\appSys01;C:\\Program Files
(x86)\\\xb8\xbb\xbb\xf9\xd0\xfd\xb7\xe7\xbf\xc6\xbc\xbc\\appSys02;C:\\Program
Files (x86)\\\xb8\xbb\xbb\
xf9\xd0\xfd\xb7\xe7\xbf\xc6\xbc\xbc\\appSys01;C:\\Program Files
(x86)\\\xb8\xbb\xbb\xf9\xd0\xfd\xb7\xe7\xbf\xc6\xbc\xbc\\appSys02;C:\\Program
Files
(x86)\\\xb8\xbb\xbb\xf9\xd0\xfd\xb7\xe7\xbf\xc6\xbc\xbc\\appSys03;C:\\Program
Files\\TortoiseSVN\\bin;;C:\\Program Files\\Microsoft VS C
ode\\bin')
Traceback (most recent call last):
}}}
**
there was a path with Chinese in my system_path.After removing ,it works
well**
--
Ticket URL: <https://code.djangoproject.com/ticket/28487#comment:4>
* Attachment "encoding.diff" added.
* owner: nobody => Mark Rogaski
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/28487#comment:5>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/28487#comment:6>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/8969 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28487#comment:7>
Comment (by Tim Graham):
[https://github.com/django/django/pull/8985 New PR] that only touches the
autoreloader instead of changing `force_bytes()`.
--
Ticket URL: <https://code.djangoproject.com/ticket/28487#comment:8>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/28487#comment:9>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"80a0016c49331bf0a14ef76e714acbff6c6640bd" 80a0016]:
{{{
#!CommitTicketReference repository=""
revision="80a0016c49331bf0a14ef76e714acbff6c6640bd"
[1.11.x] Fixed #28487 -- Fixed runserver crash with non-Unicode system
encodings on Python 2 + Windows.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28487#comment:10>
Comment (by Tim Graham <timograham@…>):
In [changeset:"11cd46930e893a9cb28f7e05c7e221ed5d40f8e0" 11cd4693]:
{{{
#!CommitTicketReference repository=""
revision="11cd46930e893a9cb28f7e05c7e221ed5d40f8e0"
Refs #28487 -- Forwardported 1.11.5 release note.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28487#comment:11>