Skip to content

Fatal Python error: Segmentation fault for MACOS 15.6.1 for a correct python code fragment #280

@Tusenka

Description

@Tusenka

I've run Python 3.10.18 with SQL Alchemy 1.4.39 to create a connection to MS SQL Server DB on macOS 15.6.1 and I get the error:

Fatal Python error: Segmentation fault
Extension modules: charset_normalizer.md, google._upb._message, snappy._snappy, lz4._version, lz4.frame._frame, lxml._elementpath, lxml.etree, yaml._yaml, grpc._cython.cygrpc, sqlalchemy.cimmutabledict, sqlalchemy.cprocessors, sqlalchemy.cresultproxy, pyodbc (total: 13)

Min reprodusible example:

from sqlalchemy import create_engine, text

db_connection_str = 'mssql+pyodbc://admin:password@localhost:1433/master?driver=ODBC+Driver+17+for+SQL+Server'
engine = create_engine(db_connection_str)

# Connect to the database
with engine.connect() as connection:
    # Example: Execute a simple query
    result = connection.execute(text("SELECT GETDATE()"))
    for row in result:
        print(f"Current SQL Server date: {row[0]}")

I tried this question without success. There were no such a problem three days before. I tried to clear cache and reinstall Python without any success.

How to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions