4

I have somehow encountered a null byte into my code and i am getting this error:

  File "py.py", line 7, in <module>
    import mysql.connector
ValueError: source code string cannot contain null bytes

This is the code which is producing error:

from time import sleep
import sys
import requests, json
from datetime import datetime as dt
from datetime import timedelta
import threading
import mysql.connector

print('ok')

However, removing the line 'import mysql.connector' the program works just fine? any suggestions? I tried removing the error by using this answer but it did not work? any suggestions?

1 Answer 1

1

I tried to reinstall the mysql-connector-python library. It worked just fine :/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.