Skip to content

gPodder silently fails to start if a python27.dll without a full Python installation is found in PATH #286

Closed

Description

@taltamir

If the program cannot find python/pygtk it silently fails on windows.

Such an exception should be caught and result in a popup notifying the user that they need to install / reinstall / repair python. instead of silent failure.

Activity

  1. changed the title [-]If python / pygtk is not installed the program should notify the user[/-] [+]If python / pygtk is not found the program should notify the user[/+] on Apr 21, 2017
  2. adamvoss commented on Apr 22, 2017

    @adamvoss
    Contributor

    How did you acquire, and how do you run, gPodder?

    I have definitely seen the following on Windows:

    image

    The version of gPodder you installed may also be relevant information.

  3. taltamir commented on Apr 24, 2017

    @taltamir
    Author

    That is odd, this popup you posted didn't show up on my system.

    I downloaded gpodder-3.9.3-setup.exe from http://gpodder.org/downloads

    I have windows 10x64 with the latest major update (creators edition). For full system details here is an attached dxdiag
    DxDiag.txt

    I will try testing it on some more systems

  4. taltamir commented on Apr 24, 2017

    @taltamir
    Author

    Alright. so the site I posted actually forwards you to sourceforge when you click on the file.
    Also, I copied the installation file to my laptop and tested it there, and it showed that popup just fine (or rather, first it showed a popup saying i don't have python, then when i installed python saying i do not have pyGTK).
    So the problem is not with the file i used to install it.
    that being said, let me run a few more tests

    ... ok this is pretty weird. I suspect it might be python 3 related?

    some tests on my desktop:

    test 1:
    When on my desktop I have:
    Python 2.7.13
    Python 3.6.1 x32
    Python 3.6.1 x64
    PyGTK 2.24.2
    python launcher

    Program runs

    --

    test 2:
    have installed
    Python 2.7.13
    Python 3.6.1 x32
    Python 3.6.1 x64
    python launcher

    receive error message

    --

    test 3:
    have installed
    Python 3.6.1 x32
    Python 3.6.1 x64
    python launcher

    silent failure with no error message received.

    --

    test 4:
    have installed
    Python 3.6.1 x32
    python launcher

    silent failure with no error message received.

    --

    test 5:
    have installed:
    python launcher

    silent failure with no error message received.

    --

    test 6:
    uninstalled everything python related

    silent failure with no error message received.

    --

    test 7:
    reinstalled python 2.7.13 and it alone

    received an error saying that it needs PyGTK

    --

    test 8:
    installed pyGTK 2.24.2 for python 2.7
    then uninstalled pyhon, leaving only pygtk without python

    silent failure.

    --

    Of particular note is test 6. On my laptop if everything is uninstalled i will recieve a notification saying I need python (not PyGTK, but base python). But on my desktop I do not receive that message if everything is uninstalled.

  5. taltamir commented on Apr 24, 2017

    @taltamir
    Author

    Ok, further testing on different systems shows it is not related to python 3 after all. various combination of installation and uninstallation of latest version of python 2 and python 3 have not caused any anomalies on my laptop (which is a recently clean installed version of windows).

    Maybe it is related to having had an older version of python 2 at some point which didn't uninstall correctly on my desktop.

    Regardless, I had simply assumed this feature is missing when in fact it is an anomalous behavior that occurs solely on my one specific desktop machine. As such, unless more people can come forward with the same issue then this can be chalked up to something being off with my desktop and this ticket closed.

  6. adamvoss commented on Apr 26, 2017

    @adamvoss
    Contributor

    Thank you for your detailed testing!! Here is the code governing the Python check: https://github.com/gpodder/gpodder/blob/master/tools/win32-launcher/gpodder.c#L210-L227

    That reads pretty clearly to me that it will show a message box and not continue unless if is able to load a Python dll.

    Based on that I see a few options:

    • It silently failed, prior to showing the message.
    • It found a dll it thought was Python and loaded it, only to silently fail later.
    • Some issue occurred in the act of showing the message itself.

    It has been a long time since I have done anything with C, so I honestly don't remember if there is anything you can do to give us more information on what is the actual failure reason. Or if it will more fall to us to try to recreate the failure environment to debug (or give you a different implementation that will give us the needed trace information).

  7. taltamir commented on Apr 26, 2017

    @taltamir
    Author

    Thank you for the info, this gave me an idea and I managed to figure out specifically what the issue is in a reproducible manner.

    By searching for python*.dll I found many many instances of it that came bundled with a wide variety of programs.

    I have tracked down the problem to a program called Nmap,
    https://nmap.org/
    specifically nmap 7.40. Specifically this file:
    C:\Program Files (x86)\Nmap\python27.dll

    If this file exists and phython is not installed then gpodder silently fails. If this file is in the recycling bin when python is not installed then gpodder gives me a popup telling me I need to install python 2.7
    I have tested deleting/restoring this file 3 times. it is definitely the culprit.

    I have only the vaguest of idea of what it is that nmap does wrong that causes this issue though. What should I tell them that they need to fix in the bug report to them (they are also open source).
    in the meantime I emailed their dev and asked them to take a look at this bug report.

  8. dmiller-nmap commented on Apr 28, 2017

    @dmiller-nmap

    Nmap developer here: I'm not sure exactly what to do about this, but I do have one idea: one of our install options is to add the Nmap install directory to the system PATH, so that you can use the nmap command from the command shell. But the PATH is also used for locating DLLs. So if you remove the Nmap directory from the Windows PATH environment variable, does it fix the problem?
    If this turns out to be the cause, we may be able to restructure our installation to keep the Python DLLs and zenmap executable in a separate directory that is not added to the PATH.

  9. Varunram commented on Apr 28, 2017

    @Varunram

    Another Nmap developer here: As Dan rightly suggested, removing the PATH variable seems to work. Look like the zenmap executable needs to be moved to a subdirectory @dmiller-nmap

  10. elelay commented on Apr 28, 2017

    @elelay
    Member

    That would be great, thanks!

  11. changed the title [-]If python / pygtk is not found the program should notify the user[/-] [+]gPodder silently fails to start if a python27.dll without a full Python installation is found in PATH[/+] on Jun 3, 2017
  12. thp commented on Jun 3, 2017

    @thp
    Member

    In addition to moving the file from nmap out of the %PATH% (much appreciated), I guess what silently happens in that some imports for Python fail, and this is why gPodder is seen failing "silently".

    Possibly it fails in one of those three files (due to it not finding the Python standard library most likely):

        Py_Initialize();
        argv[0] = MAIN_MODULE;
        PySys_SetArgvEx(argc, argv, 0);
    

    Not sure where in that it fails, but googling for how to catch any fatal Python errors, I found this:

    https://stackoverflow.com/questions/7688374/how-to-i-catch-and-handle-a-fatal-error-when-py-initialize-fails

    When reproducing the "silently fails" bug, can you try running gPodder in a cmd window and see if that prints any error messages there?

  13. thp commented on Jun 3, 2017

    @thp
    Member

    I've also created http://bugs.python.org/issue30560 (cross-linking this here), maybe for future use cases, Python could allow us to gracefully handle such situations (at least show a MessageBox() and then abort).

  14. elelay commented on Jun 14, 2018

    @elelay
    Member

    We use Python3 since gPodder 3.10.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions