Skip to content

Autogenerate do no fail nicely in some case #63

Closed
@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by miniwark NA (@miniwark)

Autogenerate fail if there not already migration scripts with this traceback :

#!python
(pyramid) > alembic revision --autogenerate
Traceback (most recent call last):
  File "/home/toto/Developpement/virtualenvs/pyramid/bin/alembic", line 8, in <module>
    load_entry_point('alembic==0.3.5', 'console_scripts', 'alembic')()
  File "/home/toto/Developpement/virtualenvs/pyramid/lib/python2.7/site-packages/alembic/config.py", line 229, in main
    **dict((k, getattr(options, k)) for k in kwarg)
  File "/home/toto/Developpement/virtualenvs/pyramid/lib/python2.7/site-packages/alembic/command.py", line 66, in revision
    script = ScriptDirectory.from_config(config)
  File "/home/toto/Developpement/virtualenvs/pyramid/lib/python2.7/site-packages/alembic/script.py", line 57, in from_config
    config.get_main_option('script_location')
  File "/home/toto/Developpement/virtualenvs/pyramid/lib/python2.7/site-packages/alembic/util.py", line 141, in coerce_resource_to_filename
    if not os.path.isabs(fname) and ":" in fname:
  File "/home/toto/Developpement/virtualenvs/pyramid/lib64/python2.7/posixpath.py", line 53, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'

I am not sure of why it fail like this :

  • maybe it is because there is nothing yet in my /version directory
  • or because i use an unsupported script location :

alembic.script_location = pyramidproject:scripts/alembic

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions