Message329856
The EINVAL error in Windows also needs improvement, but I don't what can be done after the fact. If there's a trailing slash when opening or creating a regular file, the NtCreateFile system call returns STATUS_OBJECT_INVALID_NAME. The Windows API maps this to ERROR_INVALID_NAME (123), which the CRT in turn maps to EINVAL (22). This error is too generic to handle. Even if the name ends in a slash, the error could be due to some other invalid character in the path (e.g. a common mistake is a '\t' or '\n' in a string literal).
The problem could be addressed beforehand in shutil.copy by manually raising an exception if isdir() is false and the name has a trailing slash. |
|
Date |
User |
Action |
Args |
2018-11-13 17:43:07 | eryksun | set | recipients:
+ eryksun, vstinner, serhiy.storchaka, matrixise, mdk, xtreak, cedricvanrompay |
2018-11-13 17:43:07 | eryksun | set | messageid: <1542130987.0.0.788709270274.issue35216@psf.upfronthosting.co.za> |
2018-11-13 17:43:06 | eryksun | link | issue35216 messages |
2018-11-13 17:43:06 | eryksun | create | |
|