[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Steve Dower
Steve Dower added the comment: I just created issue27603 for any work that goes into adapting the IDLE context menu. Pretty good chance I'll get to look at it for 3.6. -- ___ Python tracker ___

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Having "Edit in IDLE' work uniformly for all installed versions would be great. > set the working directory properly This needs some discussion and coordination. I am thinking of patching IDLE to switch to $HOME when cwd is the python install dir, but this wo

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Steve Dower
Steve Dower added the comment: The "Edit in IDLE" submenu we implemented could be moved from a collection of registry keys into the shell extension, which would also let us detect all Python installations, as right now we only have 3.5 and later (we could even filter out those that are missing

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: > Certainly some of the requests for IDLE could be accommodated). Steve, what did you have in mind here? -- nosy: +terry.reedy ___ Python tracker _

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Steve Dower
Steve Dower added the comment: Fixed. This should get out into the wild first with 3.6.0a4, and then 3.5.3[rc1] -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3005fc6cff8a by Steve Dower in branch '3.5': Issue #27469: Adds a shell extension to the launcher so that drag and drop works correctly. https://hg.python.org/cpython/rev/3005fc6cff8a New changeset f56adb9800fa by Steve Dower in branch 'default': I

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-18 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-17 Thread Decorater
Decorater added the comment: I actually like py2exe's memory loader. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-17 Thread Steve Dower
Steve Dower added the comment: Sure, added a new patch with all of your suggestions. I also added pyshellext.vcxproj to pcbuild.sln. (And my final word on the magic used to load DLLs from memory is that I'm not willing to maintain that code within CPython itself, so it won't be going into the

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-17 Thread Eryk Sun
Eryk Sun added the comment: Steve, will you be uploading a new patch? The current patch doesn't include "pyshellext.vcxproj" in the build, since that was accidentally committed and then removed. When you call ShellExecute, I suggest passing NULL for lpOperation, to use the default verb. If n

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-17 Thread Steve Dower
Steve Dower added the comment: A custom icon for .pyd files doesn't require a shell extension - it only really requires the icon. I don't want to use the same as .pyc, since that has the implication that it can be deleted safely, or .py, since that can be double-clicked. So we'd need somethin

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-17 Thread Decorater
Decorater added the comment: Oh and when the shell extension is done could you make a custom icon for pyd's and have the desciption of "Python C Compiled DLL" to easy selcting them when you have no icons for any *.lib, *.exp and *.pdb's Would ease up comping pyd files as well. On further note

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-17 Thread Steve Dower
Steve Dower added the comment: Thanks, I've merged that change into my patch. I doubt anyone else is going to build and test this, but just in case I'll let it set for a couple of days before merging. Perhaps someone will at least look at the code. --

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-17 Thread Eryk Sun
Eryk Sun added the comment: Thanks, Steve. I manually added this shell extension as the drop handler for Python.File. It's working with non-ANSI filenames, e.g. "αβψδ εφγη ιξκλ μνοπ ρστθ ωχυζ.txt" in a Western locale. Also, I was able to drop 939 files from the System32 directory, with a total

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-16 Thread Steve Dower
Steve Dower added the comment: Attached my first pass at the shell extension. As this has the potential to crash Windows Explorer, I want to be _really_ thorough, so all reviews and feedback welcomed. -- keywords: +patch Added file: http://bugs.python.org/file43760/27469_1.patch _

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-11 Thread Steve Dower
Steve Dower added the comment: I don't want Python to get into the business of changing the command line. I've started looking into building the shell extension so we can pass through arguments correctly. Once we have this, there are likely other features we can add to it (maybe extract __auth

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-10 Thread Eryk Sun
Eryk Sun added the comment: The WSH drop handler was added to resolve issue 1656675. It was chosen because it supports long filenames. OTOH, the EXE drop handler probably uses short filenames because the command line is limited to 32,768 characters. (Actually, it only uses the short name for a

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Steve Dower
Steve Dower added the comment: Got some digging done today and it looks like we're probably best to write our own drop handler. It can probably be embedded into the py.exe launcher, which will keep all the registration in the one file. At worst, we should switch to {86C86720-42A0-1069-A2E8-080

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Steve Dower
Steve Dower added the comment: Okay thanks. I'll see if I can track down the right one on Monday. -- assignee: -> steve.dower ___ Python tracker ___

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Adam Bartoš
Adam Bartoš added the comment: Without a handler the drop feature is disabled. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Steve Dower
Steve Dower added the comment: Try removing the handler completely and see what the default behavior is. Otherwise, I'll do some research and figure out the right one. -- ___ Python tracker ___

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Eryk Sun
Eryk Sun added the comment: Yes, a different drop handler solves the problem. It doesn't have to be the exefile handler that's built into shell32.dll. Another handler could be used that preserves Unicode filenames and long paths. I tested in Windows 10.0.10586. -- ___

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Adam Bartoš
Adam Bartoš added the comment: Also, what versions of Windows does this affect? I have 64bit Vista, so maybe this is fixed in say Windows 10. -- ___ Python tracker ___ _

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Adam Bartoš
Adam Bartoš added the comment: Thank you very much for the analysis. So Python Windows installers may be changed to set the other drop handler. If the short paths are problem, they may be converted to long ones when initializing `sys.argv`. -- ___ P

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-08 Thread Eryk Sun
Eryk Sun added the comment: On second thought, it occurred to me that the problem isn't in Explorer or shell32, but in the drop handler. It turns out the problem is that the drop handler calls the ANSI API DragQueryFileA instead of DragQueryFileW. To see this I attached a debugger to Explorer

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-08 Thread Eryk Sun
Eryk Sun added the comment: Nothing can be done about this from Python. It's a bug in how Explorer handles the dropped filename. Note that it's not simply replacing Unicode characters with question marks. It's using a best-fit ANSI encoding. For example, codepage 1252 maps "Ā" to "A". If the

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-08 Thread Emanuel Barry
Changes by Emanuel Barry : -- nosy: +ebarry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-08 Thread Adam Bartoš
New submission from Adam Bartoš: When a Python script is run by drag-and-dropping another file on it in Windows explorer, the other file's path becomes sys.argv[1]. However, when the path contains a Unicode characters (e.g. α), it gets crippled – it is replaced by ordinary question mark. Mayb