[mozlog] Library fails after python 3 update; TypeError: vars() argument must have _dict_ attribute
Categories
(Testing :: Mozbase, defect, P3)
Tracking
(firefox69 fixed)
| Tracking | Status | |
|---|---|---|
| firefox69 | --- | fixed |
People
(Reporter: ahutusoru, Assigned: ahutusoru, Mentored)
Details
(Keywords: good-first-bug)
Attachments
(2 files)
After installing the new version of mozlog library when running the following part of code:
import mozlog
mozlog.commandline.setup_logging('mozversion', None, {})
We receive the following error:
File "C:\Users\silviu.checherita\.virtualenvs\iris2-62hnA7_a\lib\site-packages\mozlog\commandline.py", line 263, in setup_logging
args = vars(args)
TypeError: vars() argument must have _dict_ attribute
The error is resulted from: https://searchfox.org/mozilla-central/source/testing/mozbase/mozlog/mozlog/commandline.py#263
Instead of args = vars(args) we can use args = args.__dict__
Comment 1•7 years ago
|
||
Are you using mozlog with python 3 here?
I think the bug here is that dict's don't have iteritems in Python 3, that's a really bad way to test for a dict. We should change the condition to if not isinstance(args, dict).
(In reply to Andrew Halberstadt [:ahal] from comment #1)
Are you using mozlog with python 3 here?
I think the bug here is that dict's don't have
iteritemsin Python 3, that's a really bad way to test for a dict. We should change the condition toif not isinstance(args, dict).
Yes, we are running mozlog with Python 3, and it hits some code that was not hit by the unit tests when library was updated.
I currently don't know what is the fix here, but I am going to try with what you suggested, should work.
Updated•7 years ago
|
I have updated as you suggested, and now the bug did not reproduce anymore.
I have created a patch ready for review.
Thanks !
Comment 5•7 years ago
|
||
Hi @jgraham,
Can you please tell if there is anything to be done to correct this bug?
Thanks and Regards,
Shruthi
(In reply to shruthi0898 from comment #5)
Hi @jgraham,
Can you please tell if there is anything to be done to correct this bug?
Thanks and Regards,
Shruthi
A patch was already created and accepted.
It just needs to be merged into central.
Comment 7•7 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:ahutusoru, could you have a look please?
Comment 8•7 years ago
|
||
This is more a question for Andrew.
Comment 9•7 years ago
|
||
For future reference, if there's no needinfo or request on phabricator, best to assume I'm not going to see it. Bugmail/phabricator comments are very easy to miss.
Comment 10•7 years ago
|
||
Sorry Andrei, looks like your patch bit-rotted. Could you rebase and push it to phabricator again?
Updated•7 years ago
|
Updated•7 years ago
|
| Assignee | ||
Comment 11•7 years ago
|
||
Sorry for the late response.
Unfortunately I cannot update this on a daily basis.
If someone can take this and update it. Thank you !
Comment 12•7 years ago
|
||
Hey Andrei & ahal. I'd be happy to update this one! As the version number will be updated to 4.1 with https://bugzilla.mozilla.org/show_bug.cgi?id=1550565, should I just stick with the changes, or update the versions to 4.1.1? I guess it depends on the order in which the patches both land?
Comment 13•7 years ago
|
||
Updated from Differential D20458.
Comment 14•7 years ago
|
||
Comment 15•7 years ago
|
||
| bugherder | ||
Description
•