>>> import bugzilla, pickle
>>> bz = bugzilla.Bugzilla('https://partner-bugzilla.redhat.com')
>>> b = bz.getbug(123)
>>> repr(b)
'<Bug #123 on https://partner-bugzilla.redhat.com/xmlrpc.cgi at 0x7f00b12b5390>'
>>> str(b)
'#123 CLOSED - Jeff Johnson - netstat -M problem'
>>> b = pickle.loads(pickle.dumps(b))
>>> repr(b)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ehabkost/rh/proj/virt/virtreporting/virtualenv/lib64/python3.7/site-packages/bugzilla/bug.py", line 71, in __repr__
return '<Bug #%i on %s at %#x>' % (self.bug_id, self.bugzilla.url,
File "/home/ehabkost/rh/proj/virt/virtreporting/virtualenv/lib64/python3.7/site-packages/bugzilla/bug.py", line 83, in __getattr__
aliases = self.bugzilla._get_bug_aliases()
AttributeError: 'NoneType' object has no attribute '_get_bug_aliases'
>>> str(b)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ehabkost/rh/proj/virt/virtreporting/virtualenv/lib64/python3.7/site-packages/bugzilla/bug.py", line 58, in __str__
return self.__unicode__()
File "/home/ehabkost/rh/proj/virt/virtreporting/virtualenv/lib64/python3.7/site-packages/bugzilla/bug.py", line 67, in __unicode__
return "#%-6s %-10s - %s - %s" % (self.bug_id, self.bug_status,
File "/home/ehabkost/rh/proj/virt/virtreporting/virtualenv/lib64/python3.7/site-packages/bugzilla/bug.py", line 83, in __getattr__
aliases = self.bugzilla._get_bug_aliases()
AttributeError: 'NoneType' object has no attribute '_get_bug_aliases'
>>>
Version: python-bugzilla-2.3.0
After pickling and unpickling a
Bugobject,repr(b)andstr(b)start crashing: