I've a Django application in production that is throwing the following error:
'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 Gen@rica.
P Gen@rica is part of the name of an uploaded file.
The code where the error appears is this:
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))]
In my Development machine everything is OK, I can add accented filenames to the names of files.
Any clues on what the causes of this error in the production environment? Could be some Apache configuration?
Best Regards,
os.path.joinon the left-hand side of your list comprehension as well?