Last modified: 2014-11-09 20:54:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T70315, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68315 - config default editor on Windows detection fails
config default editor on Windows detection fails
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
All All
: Unprioritized normal
: ---
Assigned To: John Mark Vandenberg
Depends on:
Blocks: pwb20
  Show dependency treegraph
Reported: 2014-07-21 08:51 UTC by John Mark Vandenberg
Modified: 2014-11-09 20:54 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description John Mark Vandenberg 2014-07-21 08:51:05 UTC
Steps to reproduce (core):
1. Set up an editor for .txt
2. Run python pywikibot/

Expected results:
The 'editor' config variable should be set to the editor set up for .txt. i.e.

Actual results:

pywikibot configuration tries to automatically detect a text editor to use, using the Windows registry key Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\OpenWithProgids

That exists for WinXP and later versions, and documentation can be found here:

As can be seen in that documentation, the key name is relevant, and the key value is always REG_NONE (zero-length binary value)

However to find the appropriate progid within that key, pywikbot uses _winreg.EnumValue(key, 1)

As can be seen at , the '1' in the second parameter returns "An object that holds the value data, and whose type depends on the underlying registry type".

Changing it to _winreg.EnumValue(key, 0) causes _winreg to return "A string that identifies the value name" and suddenly the detection works correctly.

This has existed since the first version in compat/ in 2007

However, it doesnt really work as one would expect, since it hooks onto .txt, rather than .py
Comment 1 Gerrit Notification Bot 2014-09-17 10:11:17 UTC
Change 160942 had a related patch set uploaded by John Vandenberg:
Fix Win32 config.editor detection

Note You need to log in before you can comment on or make changes to this bug.