AttributeError: 'module' object has no attribute 'disable_warnings'

Bug #1737283 reported by Brian J. Murrell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mythbuntu
New
Undecided
Unassigned

Bug Description

Using 0.29 on Trusty:

$ /usr/share/mythtv/metadata/Television/ttvdb.py -v
Traceback (most recent call last):
  File "/usr/share/mythtv/metadata/Television/ttvdb.py", line 1108, in <module>
    urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
AttributeError: 'module' object has no attribute 'disable_warnings'

Looks like urllib3 didn't get disable_warnings() until 1.22: https://github.com/shazow/urllib3/commit/8295b70dae76427b2c066eba4d08d0d0bf70860f

Trusty only has 1.7.1 in it: https://packages.ubuntu.com/trusty/all/python-urllib3

A patch to ttvdb.py along the lines of:

 # disable the insecure request warning that we know we are going to get
 import urllib3
-urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
+try:
+ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
+except AttributeError:
+ pass

 # Check that the lxml library is current enough
 # From the lxml documents it states: (http://codespeak.net/lxml/installation.html)

Seems to take care of it.

Tags: trusty
Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :

It seems in fact that the above description is just the tip of the iceberg and what really needs doing is to install newer versions of dependent python packages as described here:

https://www.mythtv.org/wiki/TheTVDB_API_v2

under the "Ubuntu and Mythbuntu Trusty (14.04)" heading.

In fact all I really needed to update were python-{urllib3,requests} to the Xenial versions of those packges, 1.13.1-2 and 2.9.1-3 respectively.

As easy as that is to do manually, once you discover that things are indeed (pretty silently -- until you notice you are not getting metadata any more) broken, it would be much nicer if upgrading these packages happened when installing 0.29 on Trusty. To that end, a simple backport of those two packages from Xenial to Trusty in the Mythbuntu Trusty PPA would be awesome.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.