Closed Bug 1597690 Opened 6 years ago Closed 11 days ago

ImportError: No module named 'cPickle' with Python 3

Categories

(Firefox Build System :: General, defect, P3)

70 Branch
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rgpt, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

Ran specific test
$ python3 mach test testing/marionette/harness/marionette_harness/tests/unit/test_accessibility.py

Actual results:

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

ImportError: No module named 'cPickle'

File "/home/rgpt/Desktop/mozilla/mozilla-unified/testing/mach_commands.py", line 327, in test
run_suites, run_tests = resolver.resolve_metadata(what)
File "/home/rgpt/Desktop/mozilla/mozilla-unified/testing/mozbase/moztest/moztest/resolve.py", line 757, in resolve_metadata
tests = list(self.resolve_tests(paths=[relpath]))
File "/home/rgpt/Desktop/mozilla/mozilla-unified/testing/mozbase/moztest/moztest/resolve.py", line 705, in resolve_tests
for test in self._resolve(**kwargs):
File "/home/rgpt/Desktop/mozilla/mozilla-unified/testing/mozbase/moztest/moztest/resolve.py", line 539, in _resolve
if (path in self.test_dirs or
File "/home/rgpt/Desktop/mozilla/mozilla-unified/testing/mozbase/moztest/moztest/resolve.py", line 486, in test_dirs
for test in self.tests:
File "/home/rgpt/Desktop/mozilla/mozilla-unified/testing/mozbase/moztest/moztest/resolve.py", line 464, in tests
for test in self.load_tests():
File "/home/rgpt/Desktop/mozilla/mozilla-unified/testing/mozbase/moztest/moztest/resolve.py", line 354, in call
from mozbuild.gen_test_backend import gen_test_backend
File "/home/rgpt/Desktop/mozilla/mozilla-unified/build/mach_bootstrap.py", line 431, in call
module = self._original_import(name, globals, locals, fromlist, level)
File "/home/rgpt/Desktop/mozilla/mozilla-unified/python/mozbuild/mozbuild/gen_test_backend.py", line 10, in <module>
from mozbuild.backend.test_manifest import TestManifestBackend
File "/home/rgpt/Desktop/mozilla/mozilla-unified/build/mach_bootstrap.py", line 431, in call
module = self._original_import(name, globals, locals, fromlist, level)
File "/home/rgpt/Desktop/mozilla/mozilla-unified/python/mozbuild/mozbuild/backend/test_manifest.py", line 7, in <module>
import cPickle as pickle
File "/home/rgpt/Desktop/mozilla/mozilla-unified/build/mach_bootstrap.py", line 431, in call
module = self._original_import(name, globals, locals, fromlist, level)

Expected results:

It should work in py3 too.

Blocks: 1595814
Status: UNCONFIRMED → NEW
Component: Mozbase → General
Ever confirmed: true
Product: Testing → Firefox Build System
Summary: ImportError: No module named 'cPickle' → ImportError: No module named 'cPickle' with Python 3
No longer blocks: 1595814

Afaik mach test hasn't been ported to Python 3 yet and you are force running it there with the python3 ./mach .... So I'm not surprised this isn't working :).

Note, this doesn't necessarily need to block bug 1355537 as users could use ./mach marionette-test instead. It depends how important you feel it is to support ./mach test.

Oh, indeed. I didn't notice that the general test command was used.

No longer blocks: 1355537

Btw. for Python3 the following import should work: import _pickle as cPickle. So creating a conditional would fix it.

Severity: normal → S3

I think this was fixed in bug 1428718.

Status: NEW → RESOLVED
Closed: 11 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.