In python, trying to open a file path that was obtained using glob.glob i suspect that the path contains characters with a different encoding to what open() can handle not sure tho. i can skip the file but i need a way to detect the characters causing the issue. or rather a method to open the file anyway would be perfect.
trying to open many files one of which with the name
.\\input\\537700 Raven-Symone, Anneliese van der Pol, Orlando Brown - That's So Raven! (Theme Song)\\Raven-Symone, Anneliese van der Pol, Orlando Brown - That's So Raven! (Theme Song) (fieryrage) [mk's hard].osu
will not open. got an error instead ):
files = glob.glob(folder+'*.osu', recursive = True)
for file in files:
inputFile = open(file, 'r', encoding='utf-8')
Exception has occurred: FileNotFoundError
[Errno 2] No such file or directory: ".\\input\\537700 Raven-Symone, Anneliese van der Pol, Orlando Brown - That's So Raven! (Theme Song)\\Raven-Symone, Anneliese van der Pol, Orlando Brown - That's So Raven! (Theme Song) (fieryrage) [mk's hard].osu"
File "C:\Users\Jonathan McClen\Documents\SliderToCircleOsuMapConversion\new.py", line 19, in <module>
inputFile = open(file, 'r', encoding='utf-8')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: ".\\input\\537700 Raven-Symone, Anneliese van der Pol, Orlando Brown - That's So Raven! (Theme Song)\\Raven-Symone, Anneliese van der Pol, Orlando Brown - That's So Raven! (Theme Song) (fieryrage) [mk's hard].osu"
problem was caused from windows cap on file path max path limiation