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 cvrebert
Recipients Arfrever, Hobson.Lane, Roman.Evstifeev, benjamin.peterson, cvrebert, eric.araujo, ganadist, giampaolo.rodola, pitrou, r.david.murray, rosslagerwall, smarnach, vstinner
Date 2012-04-23.18:45:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1335206739.56.0.492901035376.issue3177@psf.upfronthosting.co.za>
In-reply-to
Content
>> 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.

It's a universal problem on all 3 platforms. Given a script file argument, a generic "open" (as opposed to "edit") procedure will either run the script or open it in an editor, depending entirely upon the user's system configuration. Same thing happens when double-clicking a script in the file manager, which is IMO what we're trying to emulate here.

It sounds like some people want a generic "(text) edit" procedure, which IMO is different enough to warrant a separate bug since there are different/more design issues to tackle (e.g. if someone edit()s an image file (or a file of uncertain type) on Unix, what application is opened, and how is that determined?). And no peeking at Mercurial's code; it's under GPLv2, whereas Python is under BSD/MIT-like licensing, making them incompatible.
History
Date User Action Args
2012-04-23 18:45:39cvrebertsetrecipients: + cvrebert, pitrou, vstinner, giampaolo.rodola, benjamin.peterson, eric.araujo, ganadist, Arfrever, r.david.murray, rosslagerwall, smarnach, Roman.Evstifeev, Hobson.Lane
2012-04-23 18:45:39cvrebertsetmessageid: <1335206739.56.0.492901035376.issue3177@psf.upfronthosting.co.za>
2012-04-23 18:45:38cvrebertlinkissue3177 messages
2012-04-23 18:45:38cvrebertcreate