[Mailman-Developers] Issue recording VCR tapes in Postorius.

Mark Sapiro mark at msapiro.net
Mon Oct 24 18:17:30 EDT 2016


I have started a branch to expose the pending domain.alias_domains
attribute in Postorius.

I haven't yet done anything with tests, but I did the basic
modifications and created
<https://gitlab.com/mailman/postorius/merge_requests/186>. Of course,
this merge failed CI because "create_domain() got an unexpected keyword
argument 'alias_domain'".

So I need to record a new tape and modify the test. So my problem is I
can't record any tapes. My "tox -e record" attempts fail with tracebacks
like the attached.

It appears the virtualenv in .tox/record is a Python 3.5 virtualenv and
Python 3.5 doesn't have a urllib2 module.

Why is tox creating this as a Python 3 virtualenv? All the others it
creates for Postorius are Python 2.7. I've even tried "tox -e record
--force-dep 'python <=2.7'" but that doesn't help.

Does anyone know what I need?

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan
-------------- next part --------------
Traceback (most recent call last):
  File "example_project/manage.py", line 27, in <module>
    execute_from_command_line(sys.argv)
  File "/var/MM/3.0/postorius/.tox/record/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/var/MM/3.0/postorius/.tox/record/lib/python3.5/site-packages/django/core/management/__init__.py", line 341, in execute
    django.setup()
  File "/var/MM/3.0/postorius/.tox/record/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/var/MM/3.0/postorius/.tox/record/lib/python3.5/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/var/MM/3.0/postorius/.tox/record/lib/python3.5/site-packages/django/apps/config.py", line 199, in import_models
    self.models_module = import_module(models_module_name)
  File "/var/MM/3.0/postorius/.tox/record/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/var/MM/3.0/postorius/src/postorius/models.py", line 30, in <module>
    from django_mailman3.lib.mailman import get_mailman_client
  File "/var/MM/3.0/postorius/.tox/record/lib/python3.5/site-packages/django_mailman3/lib/mailman.py", line 25, in <module>
    from urllib2 import HTTPError
ImportError: No module named 'urllib2'



More information about the Mailman-Developers mailing list