cx_oracle fails because of "b" in version string

Issue #3975 resolved
zak k created an issue

6.0b1 causes a ValueError near line 706 in sqlalchemy\dialects\oracle\cx_oracle.py

    if hasattr(self.dbapi, 'version'):
        verlist = list()
        for version_part in self.dbapi.version.split('.'):
            version_part = version_part.split('b')[0]
            verlist.append(int(version_part))
        self.cx_oracle_ver = tuple(verlist)
    else:
        self.cx_oracle_ver = (0, 0, 0)

was my fix for this but you may have a better way

Comments (6)

  1. Mike Bayer repo owner

    Use regexp to parse cx_oracle version string

    Fixed bug in cx_Oracle dialect where version string parsing would fail for cx_Oracle version 6.0b1 due to the "b" character. Version string parsing is now via a regexp rather than a simple split.

    Change-Id: I2af7172b0d7184e3ea3bd051e9fa8d6ca2a571cd Fixes: #3975

    → <<cset 13c2a8a51053>>

  2. Mike Bayer repo owner

    Use regexp to parse cx_oracle version string

    Fixed bug in cx_Oracle dialect where version string parsing would fail for cx_Oracle version 6.0b1 due to the "b" character. Version string parsing is now via a regexp rather than a simple split.

    Change-Id: I2af7172b0d7184e3ea3bd051e9fa8d6ca2a571cd Fixes: #3975 (cherry picked from commit 50484eda7787c3e83c9c88c1841fc63b348ca23c)

    → <<cset ab1eb8109221>>

  3. Rafael Reuber

    This problem still happens on 1.1.9 version. When this fix will be available on a stable release?

  4. Mike Bayer repo owner

    use regexp to parse cx_oracle version string

    Fixed bug in cx_Oracle dialect where version string parsing would fail for cx_Oracle version 6.0b1 due to the "b" character. Version string parsing is now via a regexp rather than a simple split.

    Change-Id: I2af7172b0d7184e3ea3bd051e9fa8d6ca2a571cd Fixes: #3975 (cherry picked from commit 50484eda7787c3e83c9c88c1841fc63b348ca23c) (cherry picked from commit ab1eb8109221588c19d72c75af01ea4e8cd68e3f)

    → <<cset 8f6d90e11eec>>

  5. Log in to comment