Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue15084] Add option to os.mkdir to not raise an exception for existing directories

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jun 16, 2012, 1:29 AM

Post #1 of 4 (61 views)
Permalink
[issue15084] Add option to os.mkdir to not raise an exception for existing directories

Changes by Hynek Schlawack <hs [at] ox>:


----------
title: Add option to os.makefile to not raise an exception for existing directories -> Add option to os.mkdir to not raise an exception for existing directories

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15084>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 16, 2012, 3:03 AM

Post #2 of 4 (59 views)
Permalink
[issue15084] Add option to os.mkdir to not raise an exception for existing directories [In reply to]

Hynek Schlawack <hs [at] ox> added the comment:

I looked into the code. Assuming it should be added, we're facing the fact that os.mkdir() is C code ATM and the handling of the error would require to implement it for NT and Unix separately.

Therefore it would make sense to add a Python os.mkdir() that handles this (basically try: _mkdir(dirname) except FileExistsError: pass) and make the C implementation private.

OTOH you could argue that if you just want to ensure that that a directory exists, you could just as well use os.makedirs() with exists_ok so I'm kind of -0 on the whole thing.

----------
assignee: hynek ->
nosy: +loewis

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15084>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 16, 2012, 3:33 AM

Post #3 of 4 (57 views)
Permalink
[issue15084] Add option to os.mkdir to not raise an exception for existing directories [In reply to]

Martin v. Löwis <martin [at] v> added the comment:

I agree that this is already covered by the exist_ok parameter (which is new to 3.2). Existing code just hasn't been ported to this API.

----------
resolution: -> wont fix
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15084>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 16, 2012, 6:54 AM

Post #4 of 4 (56 views)
Permalink
[issue15084] Add option to os.mkdir to not raise an exception for existing directories [In reply to]

R. David Murray <rdmurray [at] bitdance> added the comment:

Note that the implementation of makedirs exist_ok has a significant bug (issue 13498) which renders it mostly useless in practice. Parties interested in this issue might be interested in figuring out how to fix that bug :)

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15084>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.