Closed
Description
Describe the bug
If you put an absolute path in prepend_sys_path
in your alembic.ini on windows (which will happen if you use %(here)s
), the path will get split on the ':'
character that separates the drive letter.
Expected behavior
Absolute paths to not get broken.
To Reproduce
Use an absolute path in prepend_sys_path
like C:/something
or %(here)s/something
Then print out sys.path
, e.g. for path in sys.path: print(path)
you get:
C
\something
C
\path\to\here\something
# Insert code here
Error
ModuleNotFoundError: No module named ...
because env.py can't import my modules.
Versions.
- OS: Windows 10
- Python: 3.11.5
- Alembic: 1.12.0
- SQLAlchemy: 1.4.49
- Database: Postgres
- DBAPI: psycopg2
Additional context
alembic/alembic/script/base.py
Lines 212 to 218 in 3e48ed0