Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in 1.3.14 #5196

Closed
sbrunner opened this issue Mar 11, 2020 · 4 comments
Closed

Regression in 1.3.14 #5196

sbrunner opened this issue Mar 11, 2020 · 4 comments
Labels
blocker issue that must be resolved asap as it is preventing things from working bug Something isn't working orm regression something worked and was broken by a change
Milestone

Comments

@sbrunner
Copy link

While upgrading sqlalchemy from 1.3.13 to 1.3.14 I get this error:

...
/opt/c2cgeoportal/geoportal/c2cgeoportal_geoportal/lib/__init__.py:275: in get_role_id
    return DBSession.query(main.Role.id).filter(main.Role.name == name).all()[0]
/usr/local/lib/python3.7/dist-packages/sqlalchemy/orm/query.py:3236: in all
    return list(self)
/usr/local/lib/python3.7/dist-packages/sqlalchemy/orm/query.py:3394: in __iter__
    self.session._autoflush()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <sqlalchemy.orm.session.Session object at 0x7fec23e0e590>

    def _autoflush(self):
        if self.autoflush and not self._flushing:
            try:
                self.flush()
            except sa_exc.StatementError as e:
                # note we are reraising StatementError as opposed to
                # raising FlushError with "chaining" to remain compatible
                # with code that catches StatementError, IntegrityError,
                # etc.
                e.add_detail(
                    "raised as a result of Query-invoked autoflush; "
                    "consider using a session.no_autoflush block if this "
                    "flush is occurring prematurely"
                )
>               util.raise_(e, with_traceback=sys.exc_info[2])
E               TypeError: 'builtin_function_or_method' object is not subscriptable

/usr/local/lib/python3.7/dist-packages/sqlalchemy/orm/session.py:1602: TypeError

For me, it looks to be a regression, what do you think?

Full log: https://github.com/camptocamp/c2cgeoportal/pull/5964/checks?check_run_id=498945019

@zzzeek
Copy link
Member

zzzeek commented Mar 11, 2020

wow taht means there's no test coverage for that, crap. OK, release today that's critical

@zzzeek zzzeek added blocker issue that must be resolved asap as it is preventing things from working bug Something isn't working orm regression something worked and was broken by a change labels Mar 11, 2020
@zzzeek zzzeek added this to the 1.3.x milestone Mar 11, 2020
@sqla-tester
Copy link
Collaborator

Mike Bayer has proposed a fix for this issue in the master branch:

Repair broken call to sys.exc_info() https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/1784

@sqla-tester
Copy link
Collaborator

Mike Bayer has proposed a fix for this issue in the rel_1_3 branch:

Repair broken call to sys.exc_info() https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/1785

@sbrunner
Copy link
Author

Thanks :-)

sqlalchemy-bot pushed a commit that referenced this issue Mar 11, 2020
Fixed regression in 1.3.14 due to 🎫`4849` where a sys.exc_info()
call failed to be invoked correctly when a flush error would occur. Test
coverage has been added for this exception case.

Fixes: #5196
Change-Id: Ib59a58a3a9d4c9c6f4b751201b794816a9f70225
(cherry picked from commit ceba13d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker issue that must be resolved asap as it is preventing things from working bug Something isn't working orm regression something worked and was broken by a change
Projects
None yet
Development

No branches or pull requests

3 participants