简体   繁体   中英

Python 2.7. Encoding into python and cmd

everyone.

I try to study django and python. But I have a problem. In my book there is such string:

django-admin.py startproject megaproject

When I try to execute this code, I get next message:

D:\Job\РАН\База Данных. Сомнология>django-admin.py startproject megaproject
Traceback (most recent call last):  

File "C:\Python27\Scripts\django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
353, in execute_from_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 357,
 in run_from_argv
    self.stderr.write('%s: %s' % (e.__class__.__name__, e))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 8: ordinal
not in range(128)

This code work in english directory. But I have russian directory next type:

D:\Job\РАН\База Данных. Сомнология

This problem appear due differences encoding into python and cmd. And I cannot conform them. I try change coding into command line and into python. But I have no results. When I change encoding into cmd, I get bad string with strange symbols. When I add concretly encoding in title python-file, I have no result too.

Windows django无法使用俄语目录。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM