How do you open a unicode named file (with spaces) from within a Python script under Windows?
filename for example: Hello עולם.xls
For a non-unicode non-spaced xls file, os.system(filename)
works well.
For a non-unicode spaced xls file, os.system('"'+filename+'"')
works well.
But for a unicode spaces xls file...
both os.system(filename)
and subprocess.call(new_filename)
give:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 12-13: ordinal not in range(128)
os.system(new_filename.encode('UTF-8'))
gives:
'Hello' is not recognized as an internal or external command, operable program or batch file.
and subprocess.call(new_filename.encode('UTF-8'))
gives:
WindowsError: [Error 2] The system cannot find the file specified