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 plakhotich
Recipients martin.panter, paul.moore, plakhotich, r.david.murray, steve.dower, tim.golden, zach.ware
Date 2015-11-09.10:43:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1447065823.49.0.931702942151.issue25583@psf.upfronthosting.co.za>
In-reply-to
Content
Maybe the solution is to leave OSError catching after the conditional
(probably with some additional comments):

   if not (exist_ok and path.isdir(name)):
      try:
          mkdir(name, mode)
      except OSError as e:
          if not exist_ok or e.errno != errno.EEXIST or not path.isdir(name):
              raise

This should solve the problem. It also gives more or less guarantee
that errno will be EEXIST, while the current code will also raise an exception
on EROFS (read-only FS), ENOSPC (no space left) in addition to EACCES on Windows
(and possibly some other values on various systems - who knows?).
History
Date User Action Args
2015-11-09 10:43:43plakhotichsetrecipients: + plakhotich, paul.moore, tim.golden, r.david.murray, martin.panter, zach.ware, steve.dower
2015-11-09 10:43:43plakhotichsetmessageid: <1447065823.49.0.931702942151.issue25583@psf.upfronthosting.co.za>
2015-11-09 10:43:43plakhotichlinkissue25583 messages
2015-11-09 10:43:43plakhotichcreate