AttributeError: 'functools.partial' object has no attribute '__name__'
Categories
(Firefox Build System :: Mach Core, defect, P3)
Tracking
(firefox77 fixed)
| Tracking | Status | |
|---|---|---|
| firefox77 | --- | fixed |
People
(Reporter: whimboo, Assigned: rstewart)
Details
Attachments
(1 external file)
I tried to run a Marionette headless job via a source tree job but it failed with:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=299313404&repo=try
[task 2020-04-24T19:28:57.526Z] + ./mach marionette-test --headless -vv --gecko-log - --binary /builds/worker/fetches/firefox/firefox testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py
[task 2020-04-24T19:28:58.629Z] Error running mach:
[task 2020-04-24T19:28:58.629Z]
[task 2020-04-24T19:28:58.629Z] ['marionette-test', '--headless', '-vv', '--gecko-log', '-', '--binary', '/builds/worker/fetches/firefox/firefox', 'testing/marionette/harness/marionette_harness/tests/unit/test_quit_restart.py']
[task 2020-04-24T19:28:58.629Z]
[task 2020-04-24T19:28:58.630Z] The error occurred in the implementation of the invoked mach command.
[task 2020-04-24T19:28:58.630Z]
[task 2020-04-24T19:28:58.630Z] This should never occur and is likely a bug in the implementation of that
[task 2020-04-24T19:28:58.630Z] command.
[task 2020-04-24T19:28:58.630Z] You can invoke |./mach busted| to check if this issue is already on file. If it
[task 2020-04-24T19:28:58.630Z] isn't, please use |./mach busted file| to report it. If |./mach busted| is
[task 2020-04-24T19:28:58.630Z] misbehaving, you can also inspect the dependencies of bug 1543241.
[task 2020-04-24T19:28:58.630Z]
[task 2020-04-24T19:28:58.630Z] If filing a bug, please include the full output of mach, including this error
[task 2020-04-24T19:28:58.630Z] message.
[task 2020-04-24T19:28:58.630Z]
[task 2020-04-24T19:28:58.630Z] The details of the failure are as follows:
[task 2020-04-24T19:28:58.630Z]
[task 2020-04-24T19:28:58.630Z] AttributeError: 'functools.partial' object has no attribute '__name__'
[task 2020-04-24T19:28:58.630Z]
[task 2020-04-24T19:28:58.630Z] File "/builds/worker/checkouts/gecko/python/mach/mach/registrar.py", line 57, in _condition_failed_message
[task 2020-04-24T19:28:58.630Z] part = [' %s' % c.__name__]
Looks like it is related to an INVALID_COMMAND_CONTEXT.
| Reporter | ||
Comment 1•6 years ago
|
||
Note that Marionette is not yet Python3 compatible. Bug 1595814 is still missing. But that should show a failure like:
ImportError: cannot import name '_ExpectedFailure'
File "/Users/henrik/code/gecko/python/mach/mach/main.py", line 360, in run
return self._run(argv)
File "/Users/henrik/code/gecko/python/mach/mach/main.py", line 416, in _run
args = parser.parse_args(argv)
...
That's at least what I see locally.
| Assignee | ||
Comment 2•6 years ago
|
||
| Assignee | ||
Comment 3•6 years ago
|
||
Yeah, so you're encountering an error inside of an error-handling branch. If the conditions aren't satisfied it'll try to produce the error message for that, and since that functools.partial() call doesn't produce an object that has a __name__ you'll encounter the error you saw. I'll put together a tiny patch to handle that case.
(Either way, you might want to consider replacing the functools.partial() call with a proper, named function if only because it'll have a better error message.)
Updated•6 years ago
|
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
Comment 5•6 years ago
|
||
| bugherder | ||
Description
•