[issue30641] No way to specify "File name too long" error in except statement.

2017-06-12 Thread Max Staff
Max Staff added the comment: ...at least those are the only two ways that I can think of. -- ___ Python tracker <http://bugs.python.org/issue30641> ___ ___ Pytho

[issue30641] No way to specify "File name too long" error in except statement.

2017-06-12 Thread Max Staff
Max Staff added the comment: Yes I know about the errno. There would be two ways to resolve this: One way would be by introducing a new exception class which would be nice because it's almost impossible to reliably check the allowed filename length (except for trial and error) and I

[issue30641] No way to specify "File name too long" error in except statement.

2017-06-12 Thread Max Staff
New submission from Max Staff: There are different ways to catch exceptions of the type "OSError": By using "except OSError as e:" and then checking the errno or by using "except FileNotFoundError e:" or "except FileExistsError e:" or whatever error one