I\'ve just added Python3 interpreter to Sublime, and the following code stopped working:
for directory in directoryList:
fileList = os.listdir(directory)
"as far as I know Python3 is supposed to support utf-8 everywhere ..." Not true. I have python 3.6 and my default encoding is NOT utf-8. To change it to utf-8 in my code I use:
import locale
def getpreferredencoding(do_setlocale = True):
return "utf-8"
locale.getpreferredencoding = getpreferredencoding
as explained in Changing the “locale preferred encoding” in Python 3 in Windows