dummy-decoy / ben10-chirp

2 stars 0 forks source link

Error when typing long command #3

Open WolfyBuilder opened 3 years ago

WolfyBuilder commented 3 years ago

If I try to type a command that is very long, I get this error:

C:\Users\myname\Downloads\Omnitrix Sounds\ben10-chirp-master>> python3 generator.py 1023312032310321322310201302312012020310202310202313021323023013012323301221032013102201203203220132301230213102021322030201302030203021302010303103230201031001230120230210301320301030303021021303030303300330210211020120201020120302001203231310302301300301023 Traceback (most recent call last): File "C:\Users\myname\Downloads\Omnitrix Sounds\ben10-chirp-master\generator.py", line 40, in main() File "C:\Users\myname\Downloads\Omnitrix Sounds\ben10-chirp-master\generator.py", line 34, in main output = wave.open(code+'.wav', 'wb') File "C:\Users\myname\AppData\Local\Programs\Python\Python39\lib\wave.py", line 511, in open return Wave_write(f) File "C:\Users\myname\AppData\Local\Programs\Python\Python39\lib\wave.py", line 304, in init f = builtins.open(f, 'wb') OSError: [Errno 22] Invalid argument: '1023312032310321322310201302312012020310202310202313021323023013012323301221032013102201203203220132301230213102021322030201302030203021302010303103230201031001230120230210301320301030303021021303030303300330210211020120201020120302001203231310302301300301023.wav' Exception ignored in: <function Wave_write.del at 0x000002153F2998B0> Traceback (most recent call last): File "C:\Users\myname\AppData\Local\Programs\Python\Python39\lib\wave.py", line 326, in del self.close() File "C:\Users\myname\AppData\Local\Programs\Python\Python39\lib\wave.py", line 443, in close if self._file: AttributeError: 'Wave_write' object has no attribute '_file'

dummy-decoy commented 3 years ago

indeed, there is a limit on the length of a filename on windows. the script creates a wave file and name that file according to the code given in parameter, and i don't check the resulting filename length. (there is also a whole lot of possible errors that i don't check for at the moment...)