无法创建 Django 超级用户,因为“TypeError:ctype 'wchar_t' 的初始化程序必须是长度为 1 的 unicode 字符串,而不是 int”

问题描述 投票:0回答:1

我正在尝试使用 Django 2.0.7 设置一些东西。我正在遵循这个 [教程][1] 并尝试在 Django 中创建一个超级用户。事情是这样的:

(venv) PS C:\Users\testuser\Development\Projekte\diwa_portal2\src> python manage.py createsuperuser
Username (leave blank to use 'testuser'):
Email address:
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\testuser\Development\Projekte\diwa_portal2\venv\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "C:\Users\testuser\Development\Projekte\diwa_portal2\venv\lib\site-packages\django\core\management\__init__.py", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\testuser\Development\Projekte\diwa_portal2\venv\lib\site-packages\django\core\management\base.py", line 414, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Users\testuser\Development\Projekte\diwa_portal2\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 87, in execute
    return super().execute(*args, **options)
  File "C:\Users\testuser\Development\Projekte\diwa_portal2\venv\lib\site-packages\django\core\management\base.py", line 460, in execute
    output = self.handle(*args, **options)
  File "C:\Users\testuser\Development\Projekte\diwa_portal2\venv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 171, in handle
    password = getpass.getpass()
  File "C:\Users\testuser\Tools\WPy64-38120\pypy3.8-v7.3.7-win64\Lib\getpass.py", line 103, in win_getpass
    msvcrt.putwch(c)
  File "C:\Users\testuser\Tools\WPy64-38120\pypy3.8-v7.3.7-win64\Lib\msvcrt.py", line 112, in putwch
    _lib._putwch(ord(ch))
TypeError: initializer for ctype 'wchar_t' must be a unicode string of length 1, not int```

Thanks in advance!


  [1]: https://youtu.be/F5mRW0jo-U4
django
1个回答
0
投票

看起来这可能是 pypy 中的一个错误,现已修复:https://github.com/pypy/pypy/issues/4881

© www.soinside.com 2019 - 2024. All rights reserved.