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?

wjandrea
  • 28,235
  • 9
  • 60
  • 81
nooby
  • 85
  • 6

1 Answers1

1

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

nooby
  • 85
  • 6