This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients cedricvanrompay, eryksun, matrixise, mdk, serhiy.storchaka, vstinner, xtreak
Date 2018-11-13.17:43:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1542130987.0.0.788709270274.issue35216@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-11-13 17:43:07eryksunsetrecipients: + eryksun, vstinner, serhiy.storchaka, matrixise, mdk, xtreak, cedricvanrompay
2018-11-13 17:43:07eryksunsetmessageid: <1542130987.0.0.788709270274.issue35216@psf.upfronthosting.co.za>
2018-11-13 17:43:06eryksunlinkissue35216 messages
2018-11-13 17:43:06eryksuncreate