I am on python 2.6 for Windows.
I use os.walk to read a file tree. Files may have non-7-bit characters (German \"ae\" for example) in their filenames. These are enco
I was looking for a solution for Python 3.0+. Will put it up here incase someone else needs it.
rootdir = r'D:\COUNTRY\ROADS\'
fs_enc = sys.getfilesystemencoding()
for (root, dirname, filename) in os.walk(rootdir.encode(fs_enc)):
# do your stuff here, but remember that now
# root, dirname, filename are represented as bytearrays