fix gpodder false network detection failure

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
TecnoGuy458
Posts: 123
Joined: Mon 26 Jan 2015, 20:38
Location: Ohio

fix gpodder false network detection failure

#1 Post by TecnoGuy458 »

I have to say i was rather annoyed when gpodder tried to tell me the network was down when i tried to update podcasts, when i was clearly browsing, streaming podcasts, and gpodder itself was adding podcasts just fine...

so failing a duck search, i did a little digging...

turns out the busybox ifconfig and ip are breaking gpodder's own network interface detection...


the fix itself is quite simple.

the problem lies in gpodder's util.py

(for me this was in /usr/share/pyshared/gpodder)

find the function "connection_available()" (it should start with "def connection_available()"


now: find the section of this function that looks like this:

Code: Select all

...
# If we assume we're offline, try the "ip" command as fallback
            if offline and find_command('ip') is not None:
                if len(list(linux_get_active_interfaces())) == 0:
                    offline = True
                else:
                    offline = False
            return not offline
...

now the fix i came up with is to just put "offline = False" just before "return not offline" like so:

Code: Select all

...
# If we assume we're offline, try the "ip" command as fallback
            if offline and find_command('ip') is not None:
                if len(list(linux_get_active_interfaces())) == 0:
                    offline = True
                else:
                    offline = False
            offline = False
            return not offline
...
This does effectivly disable the network detection in gpodder, but for me this works fine, and no network detection in gpodder is better than gpodder refusing to update my podcasts...

Hope this helps.

Post Reply