[Bug 1734918] [NEW] python-json-patch monkeypatching causes AttributeError with python-networkx

volinthius 1734918 at bugs.launchpad.net
Tue Nov 28 16:08:20 UTC 2017


Public bug reported:

On Ubuntu 14.04.5 LTS with:

- python 2.7.5-5ubuntu3
- python-json-patch 1.3-4
- python-networkx 1.8.1-0ubuntu3

Error can be triggered with the following example:

---

$ cat conflict1.py
import jsonpatch
from networkx.readwrite import json_graph

$ python conflict1.py
Traceback (most recent call last):
  File "conflict1.py", line 11, in <module>
    from networkx.readwrite.json_graph.serialize import *
  File "/usr/lib/python2.7/dist-packages/networkx/readwrite/json_graph/__init__.py", line 10, in <module>
    from networkx.readwrite.json_graph.serialize import *
  File "/usr/lib/python2.7/dist-packages/networkx/readwrite/json_graph/serialize.py", line 31, in <module>
    update_wrapper(load,json.load)
  File "/usr/lib/python2.7/functools.py", line 33, in update_wrapper
    setattr(wrapper, attr, getattr(wrapped, attr))
AttributeError: 'functools.partial' object has no attribute '__module__'

---

The error is reported and fixed in upstream [0] but the commit is after
Python 2.x support has been removed in commit
7079bdc7bf4be53f51fa30d790c32db83dd8c210. Please find proposed fix
attached.

[0] https://github.com/stefankoegl/python-json-patch/issues/37

** Affects: python-json-patch (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: trusty

** Description changed:

  On Ubuntu 14.04.5 LTS with:
  
  - python 2.7.5-5ubuntu3
  - python-json-patch 1.3-4
  - python-networkx 1.8.1-0ubuntu3
  
- Error can be triggered in the following example:
+ Error can be triggered with the following example:
  
  ---
  
  $ cat conflict1.py
  import jsonpatch
  from networkx.readwrite import json_graph
  
- $ python conflict1.py 
+ $ python conflict1.py
  Traceback (most recent call last):
-   File "conflict1.py", line 11, in <module>
-     from networkx.readwrite.json_graph.serialize import *
-   File "/usr/lib/python2.7/dist-packages/networkx/readwrite/json_graph/__init__.py", line 10, in <module>
-     from networkx.readwrite.json_graph.serialize import *
-   File "/usr/lib/python2.7/dist-packages/networkx/readwrite/json_graph/serialize.py", line 31, in <module>
-     update_wrapper(load,json.load)
-   File "/usr/lib/python2.7/functools.py", line 33, in update_wrapper
-     setattr(wrapper, attr, getattr(wrapped, attr))
+   File "conflict1.py", line 11, in <module>
+     from networkx.readwrite.json_graph.serialize import *
+   File "/usr/lib/python2.7/dist-packages/networkx/readwrite/json_graph/__init__.py", line 10, in <module>
+     from networkx.readwrite.json_graph.serialize import *
+   File "/usr/lib/python2.7/dist-packages/networkx/readwrite/json_graph/serialize.py", line 31, in <module>
+     update_wrapper(load,json.load)
+   File "/usr/lib/python2.7/functools.py", line 33, in update_wrapper
+     setattr(wrapper, attr, getattr(wrapped, attr))
  AttributeError: 'functools.partial' object has no attribute '__module__'
  
  ---
  
  The error is reported and fixed in upstream [0] but the commit is after
  Python 2.x support has been removed in commit
  7079bdc7bf4be53f51fa30d790c32db83dd8c210. Please find proposed fix
  attached.
  
  [0] https://github.com/stefankoegl/python-json-patch/issues/37

** Tags added: trusty

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to python-json-patch in Ubuntu.
https://bugs.launchpad.net/bugs/1734918

Title:
  python-json-patch monkeypatching causes AttributeError with python-
  networkx

Status in python-json-patch package in Ubuntu:
  New

Bug description:
  On Ubuntu 14.04.5 LTS with:

  - python 2.7.5-5ubuntu3
  - python-json-patch 1.3-4
  - python-networkx 1.8.1-0ubuntu3

  Error can be triggered with the following example:

  ---

  $ cat conflict1.py
  import jsonpatch
  from networkx.readwrite import json_graph

  $ python conflict1.py
  Traceback (most recent call last):
    File "conflict1.py", line 11, in <module>
      from networkx.readwrite.json_graph.serialize import *
    File "/usr/lib/python2.7/dist-packages/networkx/readwrite/json_graph/__init__.py", line 10, in <module>
      from networkx.readwrite.json_graph.serialize import *
    File "/usr/lib/python2.7/dist-packages/networkx/readwrite/json_graph/serialize.py", line 31, in <module>
      update_wrapper(load,json.load)
    File "/usr/lib/python2.7/functools.py", line 33, in update_wrapper
      setattr(wrapper, attr, getattr(wrapped, attr))
  AttributeError: 'functools.partial' object has no attribute '__module__'

  ---

  The error is reported and fixed in upstream [0] but the commit is
  after Python 2.x support has been removed in commit
  7079bdc7bf4be53f51fa30d790c32db83dd8c210. Please find proposed fix
  attached.

  [0] https://github.com/stefankoegl/python-json-patch/issues/37

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-json-patch/+bug/1734918/+subscriptions



More information about the Ubuntu-openstack-bugs mailing list