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.

classification
Title: Drop-Handler for Python files
Type: enhancement Stage:
Components: Installation, Windows Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: loewis Nosy List: jimjjewett, leonidasxiv, loewis
Priority: normal Keywords:

Created on 2007-02-10 11:36 by leonidasxiv, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg55012 - (view) Author: Marek Kubica (leonidasxiv) * Date: 2007-02-10 11:36
Hi!

We had a dscussion about what happens when one drops a file on a python sourcecode-file in the python-forum [1]. It turned out, that nothing happens at all. So someone brought up a solution. It is not really a problem with Python but it would be nice to add this to the Windows Installer.

The proposed solution was to add the following to the registry (this is the format of the registry editor):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Python.File\shellex\DropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"

[HKEY_CLASSES_ROOT\Python.NoConFile\shellex\DropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"

[HKEY_CLASSES_ROOT\Python.CompiledFile\shellex\DropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"

That should be simple thing to do using the MSI-Installer.

[1] only in german, sorry: http://www.python-forum.de/topic-7493.html
msg55013 - (view) Author: Jim Jewett (jimjjewett) Date: 2007-03-06 23:50
What would happen then?  For example, should it cause python to start up, running with that file, and the dropped file as stdin?
msg55014 - (view) Author: Jim Jewett (jimjjewett) Date: 2007-04-16 14:58
Suggesting close, for insufficient documentation.
msg55015 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-04-16 21:09
I plan to implement this for 2.6; I think I can make sense out of it.

With this setting, dropping file foo.txt on file bar.py will run "python.exe bar.py foo.txt", through different levels of indirection. So the file (path) being dropped appears as sys.argv[1].
msg75610 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-11-07 18:57
I have now added a drop handler in r67149, r67150, and r67151. However,
I chose the wsh handler ({60254CA5-953B-11CF-8C96-00AA00B8708C}) instead
of the batch file one, as the wsh handler provides long file names,
whereas the batch file handler passes 8.3 names.
History
Date User Action Args
2022-04-11 14:56:22adminsetgithub: 44569
2008-11-07 18:57:29loewissetstatus: open -> closed
resolution: fixed
messages: + msg75610
2008-01-06 11:57:52christian.heimessetcomponents: + Windows
versions: + Python 2.6
2007-02-10 11:36:45leonidasxivcreate