Python Open File Error
I am trying to open some file and I know there are some errors in the file with UTF-8 encoding, so what I will do in python3 is open(fileName, 'r', errors = 'ignore') but now I
Solution 1:
Python 2 does not support this using the built-in open function. Instead, you have to uses codecs.
importcodecsf= codecs.open(fileName, 'r', errors = 'ignore')
This works in Python 2 and 3 if you decide you need to switch your python version in the future.
Post a Comment for "Python Open File Error"