1
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 "myvenv\Lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
 utility.execute()
 File "myvenv\Lib\site-packages\django\core\management\__init__.py", line 436, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
 File "myvenv\Lib\site-packages\django\core\management\base.py", line 412, in run_from_argv
 self.execute(*args, **cmd_options)
 File "myvenv\Lib\site-packages\django\core\management\base.py", line 458, in execute
 output = self.handle(*args, **options)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "myvenv\Lib\site-packages\django\core\management\commands\makemessages.py", line 430, in handle
 potfiles = self.build_potfiles()
 ^^^^^^^^^^^^^^^^^^^^^
 File "myvenv\Lib\site-packages\django\core\management\commands\makemessages.py", line 508, in build_potfiles
 self.process_files(file_list)
 File "myvenv\Lib\site-packages\django\core\management\commands\makemessages.py", line 599, in process_files
 self.process_locale_dir(locale_dir, files)
 File "myvenv\Lib\site-packages\django\core\management\commands\makemessages.py", line 675, in process_locale_dir
 msgs, errors, status = popen_wrapper(args)
 ^^^^^^^^^^^^^^^^^^^
 File "myvenv\Lib\site-packages\django\core\management\utils.py", line 26, in popen_wrapper
 p.stdout.decode(stdout_encoding),
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 978: invalid start byte

When I run the "django makemessages" command, I keep getting this error. I've gone through all the files in a loop to check for UTF-8 issues, but I couldn't find any. I've verified that all my files are encoded in UTF-8, but I still keep encountering this error.

asked Aug 16, 2023 at 16:03
3
  • Are you dealing with any file upload process ? Commented Aug 16, 2023 at 19:05
  • No, I want to create a language file with the makemessages command. After running the "manage.py makemessages -l en" command it gives this error Commented Aug 17, 2023 at 4:21
  • It sometimes happens when you copy the contents of original file into new and load that new file. Commented Aug 17, 2023 at 4:24

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.