Author chris.jerdonek
Recipients chris.jerdonek
Date 2019-02-09.17:10:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549732242.93.0.821054504106.issue35951@roundup.psfhosted.org>
In-reply-to
Content
os.renames() creates and leaves behind the intermediate directories if the original (source) path doesn't exist.

>>> import os
>>> os.mkdir('temp')
>>> os.mkdir('temp/test')
>>> os.renames('temp/not-exists', 'temp/test2/test3/test4')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../3.6.5/lib/python3.6/os.py", line 267, in renames
    rename(old, new)
FileNotFoundError: [Errno 2] No such file or directory: 'temp/not-exists' -> 'temp/test2/test3/test4'
>>> os.listdir('temp/test2')
['test3']
>>> os.listdir('temp/test2/test3')
[]
History
Date User Action Args
2019-02-09 17:10:46chris.jerdoneksetrecipients: + chris.jerdonek
2019-02-09 17:10:42chris.jerdoneksetmessageid: <1549732242.93.0.821054504106.issue35951@roundup.psfhosted.org>
2019-02-09 17:10:42chris.jerdoneklinkissue35951 messages
2019-02-09 17:10:42chris.jerdonekcreate