網站首頁 編程語言 正文
問題描述
我正在用Python 3.4.1來構建一個Django項目。
?manage.py runserver?引發UnicodeDecodeException。
如何解決?
查看以下(修剪)追溯:
追溯(最近的最后一次呼叫):
文件C:\ Python34\lib\socketserver.py,第429行__init__ ?self.server_bind()
文件C:\Python34\lib\site-packages\django\core \servers\basehttp.py,第121行,在server_bind 超級(WSGIServer,self).server_bind()
文件C:\Python34\lib\wsgiref \simple_server.py,第50行,server_bind ?HTTPServer.server_bind(self)
文件C:\Python34\lib\http\server.py,第135行, server_bind ?self.server_name = socket.getfqdn(host)
文件C:\Python34\lib\socket.py,第460行,getfqdn 主機名,別名,ipaddrs = gethostbyaddr(name)
UnicodeDecodeError:'utf-8'編解碼器無法解碼位置12中的0xcf字節無效連續字節?
每個請求,我的主機名:
C:\Users\AnatoliyVik>主機名 AnatoliyVik-ПК
解決方案
將主機名更改為不再包含西里爾字符解決問題。
感謝@拉法達的指導。
I'm trying to build a Django project with Python 3.4.1.?manage.py runserver?raises a UnicodeDecodeException.
How can this be resolved? See the below (trimmed) traceback:
Traceback (most recent call last):
File "C:\Python34\lib\socketserver.py", line 429, in __init__
self.server_bind()
File "C:\Python34\lib\site-packages\django\core\servers\basehttp.py", line 121
, in server_bind
super(WSGIServer, self).server_bind()
File "C:\Python34\lib\wsgiref\simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
File "C:\Python34\lib\http\server.py", line 135, in server_bind
self.server_name = socket.getfqdn(host)
File "C:\Python34\lib\socket.py", line 460, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 12: invalid
continuation byte
Per request, my hostname:
C:\Users\AnatoliyVik>hostname
AnatoliyVik-ПК
Changing the hostname to no longer include Cyrillic symbols resolves the problem.
Thanks to @Lafada for the guidance.
原文鏈接:https://www.it1352.com/637479.html
相關推薦
- 2021-12-03 關于Redis數據庫入門詳細介紹_Redis
- 2023-03-02 docker-compose安裝RabbitMQ及插件操作步驟_docker
- 2022-05-02 Entity?Framework中執行sql語句_實用技巧
- 2022-08-11 python中的多線程鎖lock=threading.Lock()使用方式_python
- 2023-03-30 C語言楊氏矩陣簡單實現方法_C 語言
- 2022-10-15 詳解C++中常用的四種類型轉換方式_C 語言
- 2022-07-09 springboot 視圖集成
- 2022-12-23 python類中的self和變量用法及說明_python
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支