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 hollyroberts
Recipients hollyroberts
Date 2019-07-05.14:01:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1562335308.56.0.146479172275.issue37506@roundup.psfhosted.org>
In-reply-to
Content
If we use os.mkdir to create a folder as follows:
    os.mkdir("C:/test /")
Then we successfully create a folder with name "test ". This folder can be accessed normally, but it cannot be renamed or deleted. Instead we get the following error message:
    Could not find this item
    This is no longer located in C:\. Verify the item's location and try again.
I used Python 3.7.3 (64 bit) and Windows 1809

Obviously this is down to how windows doesn't handle paths particularly nicely, so it's not really python's fault. However even if it's decided that python shouldn't handle this then it would be better for an exception to be thrown rather than creating a corrupt folder.

Note: We can delete the folder by using the Long UNC path, eg. rd "\\?\C:\test "
History
Date User Action Args
2019-07-05 14:01:48hollyrobertssetrecipients: + hollyroberts
2019-07-05 14:01:48hollyrobertssetmessageid: <1562335308.56.0.146479172275.issue37506@roundup.psfhosted.org>
2019-07-05 14:01:48hollyrobertslinkissue37506 messages
2019-07-05 14:01:48hollyrobertscreate