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

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

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

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

ThiefMaster opened this issue Feb 12, 2018 · 14 comments

Comments

@ThiefMaster
Copy link

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
Copy link
Author

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
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
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
Copy link
Author

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

@jeancochrane
Copy link

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

@jeancochrane
Copy link

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
Copy link
Member

There is no process, I have no access.

@jeancochrane
Copy link

Does that mean the PyPi package is unsupported?

@ThiefMaster
Copy link
Author

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
Copy link
Member

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
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
Copy link
Author

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
Copy link
Member

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

@davidism
Copy link
Member

davidism commented Jun 2, 2018

WTForms 2.2 has been released.

@davidism davidism closed this as completed Jun 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants