do you have any integer values inside your version files for the value of "down_revision", "revision", "branch_labels", or "depends_on"? that would be the problem. Those must be strings.


On 04/04/2016 01:59 PM, Marco Falcioni wrote:
Hello,
we are moving to python3 and we ran into the error - is there anything
we should do differently?
Thanks
Marco

(alembic==0.8.5)

INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
Traceback (most recent call last):
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/script/revision.py",
line 349, in _revision_for_ident
     revision = self._revision_map[resolved_id]
KeyError: 52

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
   File "/Users/joe/venv/test_py3/bin/alembic", line 11, in <module>
     sys.exit(main())
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/config.py", line
479, in main
     CommandLine(prog=prog).main(argv=argv)
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/config.py", line
473, in main
     self.run_cmd(cfg, options)
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/config.py", line
456, in run_cmd
     **dict((k, getattr(options, k)) for k in kwarg)
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/command.py",
line 174, in upgrade
     script.run_env()
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/script/base.py",
line 397, in run_env
     util.load_python_file(self.dir, 'env.py')
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/util/pyfiles.py",
line 81, in load_python_file
     module = load_module_py(module_id, path)
   File "_py3/lib/python3.5/site-packages/alembic/util/compat.py", line
68, in load_module_py
     module_id, path).load_module(module_id)
   File "<frozen importlib._bootstrap_external>", line 385, in
_check_name_wrapper
   File "<frozen importlib._bootstrap_external>", line 806, in load_module
   File "<frozen importlib._bootstrap_external>", line 665, in load_module
   File "<frozen importlib._bootstrap>", line 268, in _load_module_shim
   File "<frozen importlib._bootstrap>", line 693, in _load
   File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
   File "<frozen importlib._bootstrap_external>", line 662, in exec_module
   File "<frozen importlib._bootstrap>", line 222, in
_call_with_frames_removed
   File "legacy_schema/env.py", line 70, in <module>
     run_migrations_online()
   File "legacy_schema/env.py", line 63, in run_migrations_online
     context.run_migrations()
   File "<string>", line 8, in run_migrations
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/runtime/environment.py",
line 797, in run_migrations
     self.get_context().run_migrations(**kw)
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/runtime/migration.py",
line 303, in run_migrations
     for step in self._migrations_fn(heads, self):
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/command.py",
line 163, in upgrade
     return script._upgrade_revs(revision, rev)
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/script/base.py",
line 310, in _upgrade_revs
     revs = list(revs)
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/script/revision.py",
line 610, in _iterate_revisions
     requested_lowers = self.get_revisions(lower)
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/script/revision.py",
line 299, in get_revisions
     return sum([self.get_revisions(id_elem) for id_elem in id_], ())
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/script/revision.py",
line 299, in <listcomp>
     return sum([self.get_revisions(id_elem) for id_elem in id_], ())
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/script/revision.py",
line 304, in get_revisions
     for rev_id in resolved_id)
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/script/revision.py",
line 304, in <genexpr>
     for rev_id in resolved_id)
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/script/revision.py",
line 352, in _revision_for_ident
     revs = [x for x in self._revision_map
   File
"/Users/joe/venv/test_py3/lib/python3.5/site-packages/alembic/script/revision.py",
line 353, in <listcomp>
     if x and x.startswith(resolved_id)]
TypeError: startswith first arg must be str or a tuple of str, not int

--
You received this message because you are subscribed to the Google
Groups "sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sqlalchemy-alembic+unsubscr...@googlegroups.com
<mailto:sqlalchemy-alembic+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy-alembic+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to