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

Urgent: Please release 2.1.1 that fixes error with SQLAlchemy 1.2 #373

Closed
ThiefMaster opened this Issue Feb 12, 2018 · 14 comments

Comments

4 participants
@ThiefMaster
Copy link

ThiefMaster commented Feb 12, 2018

https://github.com/wtforms/wtforms/blob/2.1/wtforms/ext/sqlalchemy/fields.py#L188-L190

In 1.2 identity_key returns a third item which is not really relevant here but breaks the list unpacking. I would suggest this change to support both 1.1 and 1.2:

-cls, key = identity_key(instance=obj)
+key = identity_key(instance=obj)[1]

For reference, here's the relevant part of the traceback with WTForms 2.1 and SQLAlchemy 1.2:

  File ".../wtforms/ext/sqlalchemy/fields.py", line 100, in _get_object_list
    self._object_list = list((text_type(get_pk(obj)), obj) for obj in query)
  File ".../wtforms/ext/sqlalchemy/fields.py", line 100, in <genexpr>
    self._object_list = list((text_type(get_pk(obj)), obj) for obj in query)
  File ".../wtforms/ext/sqlalchemy/fields.py", line 189, in get_pk_from_identity
    cls, key = identity_key(instance=obj)
ValueError: too many values to unpack
@ThiefMaster

This comment has been minimized.

Copy link

ThiefMaster commented Feb 12, 2018

ah, actually it looks like it should be fixed in https://github.com/wtforms/wtforms-sqlalchemy as well - but since it's clear breakage with newer sqlalchemy versions I think a wtforms release makes sense nonetheless

ThiefMaster added a commit to indico/indico that referenced this issue Feb 12, 2018

@davidism

This comment has been minimized.

Copy link
Member

davidism commented Feb 12, 2018

I can merge a patch for this if you submit one, but I can't make new releases.

@jeancochrane

This comment has been minimized.

Copy link

jeancochrane commented Feb 14, 2018

Any plans for a patch @ThiefMaster @davidism? I'm running into this issue as well so I'd be happy to submit one if it would help.

@ThiefMaster

This comment has been minimized.

Copy link

ThiefMaster commented Feb 14, 2018

The problem is not the patch but getting a PyPI release. A possible fix is in my initial comment.

@jeancochrane

This comment has been minimized.

Copy link

jeancochrane commented Feb 14, 2018

I see now, thanks for the clarification! The monkeypatch snippet is very much appreciated.

@jeancochrane

This comment has been minimized.

Copy link

jeancochrane commented Feb 15, 2018

What's the procedure for releases @davidism? Is there a possibility of releasing a fix for this to the stable version before 3.0? The monkeypatch works fine, but it's not ideal.

@davidism

This comment has been minimized.

Copy link
Member

davidism commented Feb 16, 2018

There is no process, I have no access.

@jeancochrane

This comment has been minimized.

Copy link

jeancochrane commented Feb 16, 2018

Does that mean the PyPi package is unsupported?

@ThiefMaster

This comment has been minimized.

Copy link

ThiefMaster commented Feb 16, 2018

It simply means that there is no way of updating it until @crast publishes a release there or - even better - gives someone access to do releases...

@davidism

This comment has been minimized.

Copy link
Member

davidism commented Feb 16, 2018

Huh, I thought I posted a better explanation, it was on #374 instead:

@lepture and I are talking about something, but I have other projects to focus on in the immediate future. When we figure it out we'll announce it in an issue. We'll definitely be looking for other contributors.

It doesn't only matter that I get control of RTD and PyPI, I have no permissions for the org on GitHub, so have no control over all the infrastructure tied to that.

@jace

This comment has been minimized.

Copy link

jace commented Feb 24, 2018

Arrived here courtesy SQLAlchemy 1.2 breakage. Looks like only recourse at the moment is to downgrade to SQLAlchemy 1.1.17.

@ThiefMaster

This comment has been minimized.

Copy link

ThiefMaster commented Feb 24, 2018

@jace: You can easily monkeypatch WTForms like this: indico/indico@c79c562

So if you are already using SQLAlchemy 1.2 I would rather go for that instead of downgrading SQLAlchemy. If you are still on 1.1 though and don't need any of the features/fixes in 1.2 then you could wait a bit, hoping there's a fixed WTForms release in the meantime.

@davidism

This comment has been minimized.

Copy link
Member

davidism commented Feb 24, 2018

I have access, I just need to get some free time now. There will be another release.

@davidism

This comment has been minimized.

Copy link
Member

davidism commented Jun 2, 2018

WTForms 2.2 has been released.

@davidism davidism closed this Jun 2, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.