How to work with file names that end in Python? According to MSDN, such file names are valid on Windows, but whenever I try to create them in Python, it removes the last period. I even tried to create a raw file descriptor with os.open, but it still removes the period.
For example, this will create a file simply called ' test '
os.open('test.', os.O_CREAT | os.O_WRONLY, 0777)
Edit: Here is the exact quote
About spaces and periods in file names and directories. The limits in the Windows shell are not in Windows or NT. Using 'bash', you can create files with spaces (or periods), both at the beginning and at the end of the file name. Then you can view and open these files in Explorer, and you can "list" them in the shell (cmd.exe), but you do not have to be able to open them from the shell (especially for end spaces and points).
Antimony
source share