Stefan Ram ha scritto:
jak <nos...@please.ty> writes:
Maybe I only say this because it has happened to me too many times but
before ignoring the error in the 'except' branch, I would make sure that
if the name exists it is a folder and not a file.

   If the name exists and it is a file's name, this will be detected
   by "mkdir( exist_ok=True )", and an object will be raised. Such
   an object, indeed, usually should /not/ be ignored by the caller.
   But there is no reason to deviate from the EAFP path.




Maybe I expressed myself badly but I didn't mean to propose alternatives
to the EAFP way but just to evaluate the possibility that it is not a
folder.
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to