0
我已經在生產中的Django的應用程序,拋出以下錯誤:Django的 - UnicodeEncodeError在生產環境中使用Apache
'ascii' codec can't encode character u'\xe9' in position 97: ordinal not in range(128)
Unicode error hint
The string that could not be encoded/decoded was: P [email protected]
P @代哥斯達黎加是一個上傳文件的名稱的一部分。
其中出現的錯誤代碼是這樣的:
files_list = [uuid_temp_files + '/' + f for f in os.listdir(uuid_temp_files) if os.path.isfile(os.path.join(uuid_temp_files, f))]
在我的機器一切正常,我可以帶重音符號的文件名添加到文件的名稱。
生產環境中出現此錯誤的原因的任何線索?可能是一些Apache配置?
此致
我假設你的開發機器是使用python 3? – Sayse
它使用Python2.7 –
爲什麼不在列表理解的左邊使用'os.path.join'? –