Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when typing long command #3

Open
WolfyBuilder opened this issue Jun 19, 2021 · 1 comment
Open

Error when typing long command #3

WolfyBuilder opened this issue Jun 19, 2021 · 1 comment

Comments

@WolfyBuilder
Copy link

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
Copy link
Owner

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...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants