darktrojan / openwith

Open With add-on for Firefox
https://addons.mozilla.org/addon/open-with/
412 stars 71 forks source link

Making open_with_windows.py Cygwin compatible #165

Closed dzeleznik closed 7 years ago

dzeleznik commented 7 years ago

The winreg module does not exist in the Cygwin ports of Python. Speaking as someone that uses Cygwin and has no interest to install a separate version of python, there is a simple fix to your script that takes advantage of the cygwinreg module found at https://pypi.python.org/pypi/cygwinreg/: The module import code in your script would change to something like

    if sys.platform == 'cygwin':
        import cygwinreg as _winreg
    else:
        try:
            import winreg as _winreg
        except:
            import _winreg
dzeleznik commented 7 years ago

Sorry for the noise, but turns out cygwinreg module is so outdated as to be non-functional against latest GNU python 2.7 and 3.6 running on Windows x64. I spent about 4 hours trying to debug and finally gave up. Resigned myself to installing Python for Windows and your script ran fine.

darktrojan commented 7 years ago

You can just alter your copy to do this. You'll have to keep up with any major changes in the official version, but I'm really hoping not to have many.

dzeleznik commented 7 years ago

Thanks for the reply, due to problems getting the cygwinreg module to work with latest versions of Windows, I went ahead and installed Python from python.org.