[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•5 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
iteritems
in 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•5 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•5 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•5 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•5 years ago
|
||
This is more a question for Andrew.
Comment 9•5 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•5 years ago
|
||
Sorry Andrei, looks like your patch bit-rotted. Could you rebase and push it to phabricator again?
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 11•5 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•5 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•5 years ago
|
||
Updated from Differential D20458.
Comment 14•5 years ago
|
||
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2180deaa2c68 [mozlog] Library fails after python 3 update; TypeError: vars() argument must have _dict_ attribute r=ahal
Comment 15•5 years ago
|
||
bugherder |
Description
•