TypeError: "Source code string cannot contain null bytes"

10,723 views
Skip to first unread message

Kamal Singh

unread,
Aug 25, 2014, 1:45:07 AM8/25/14
to django...@googlegroups.com
Hi , I am new to this group and Django . I am trying to learn Django by making a blog app and everything was working fine till last night. Today when I tried to run server I got error with : Unhandled exception in thread started by function check_errors.<locals>.wrapper at 0x.....(some big hexadecimal digit).

I am typing from my mobile so I can't copy paste it. But if you need to see the whole error on my command prompt I can post a picture.

At the end of the traceback it says:

TypeError: "Source code string cannot contain null bytes"

Please help me understand what is going on and how to solve it.

Thanks

Camilo Torres

unread,
Aug 27, 2014, 10:48:32 AM8/27/14
to django...@googlegroups.com
As it says: you have a null character in your source code script. That is an invalid character for a python script; this does not seems to be related with Django.

Open your source code script with a powerfull text editor capable of showing hidden/special characters, then look for a 'null' character somewhere in your code.

If you pasted a text, assure you correctly copy the source.

Reply all
Reply to author
Forward
0 new messages