[issue3177] Add shutil.open

Éric Araujo report at bugs.python.org
Mon Apr 23 18:30:10 CEST 2012


Éric Araujo <merwok at netwok.org> added the comment:

> The semantics of "associated application" change considerably from
> operating system to operating system.  As an example,
> ``os.startfile("a.py")`` will usually run `a.py` in the Python
> interpreter, while ``xdg-open a.py`` it will usually open the source
> code in an editor on Linux.

Outch.  I think the behavior should be more similar than that, i.e. that the function should use startfile with the edit action on Windows.

About the name: I thought about “edit”; it really means open_file_in_editor.  BTW shutil feels the wrong place for this but I don’t think we have anything better.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3177>
_______________________________________


More information about the Python-bugs-list mailing list