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

Raises unicode error with transaction 2.0 #8

Closed
henri-hulski opened this Issue Dec 9, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@henri-hulski
Member

henri-hulski commented Dec 9, 2016

When more.transaction is used with transaction 2.0 the following type error appears:

env/local/lib/python2.7/site-packages/more/transaction/main.py:64: in transaction_tween
    t.note(request.path)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <transaction._transaction.Transaction object at 0x7f1651c780d0>, text = '/'

    def note(self, text):
        """ See ITransaction.
            """

        if not isinstance(text, text_type):
>           raise TypeError("Note must be text (unicode)")
E           TypeError: Note must be text (unicode)

env/local/lib/python2.7/site-packages/transaction/_transaction.py:537: TypeError

This happens because in Transaction 2.0.3

The user and description fields must now be set with text (unicode) data. Previously, if bytes were provided, they’d be decoded as ASCII.

@hlopezvg

This comment has been minimized.

Show comment
Hide comment
@hlopezvg

hlopezvg Dec 27, 2016

@henri-hulski same here, do you know a workaround?
Thanks

hlopezvg commented Dec 27, 2016

@henri-hulski same here, do you know a workaround?
Thanks

@henri-hulski

This comment has been minimized.

Show comment
Hide comment
@henri-hulski

henri-hulski Dec 27, 2016

Member

@hlopezvg for now just use transaction pre 2.0.

Member

henri-hulski commented Dec 27, 2016

@hlopezvg for now just use transaction pre 2.0.

@hlopezvg

This comment has been minimized.

Show comment
Hide comment
@hlopezvg

hlopezvg Dec 27, 2016

@henri-hulski Thanks, is working now.

hlopezvg commented Dec 27, 2016

@henri-hulski Thanks, is working now.

@href

This comment has been minimized.

Show comment
Hide comment
@href

href Dec 28, 2016

Contributor

Fixed with 97ba669. The new 0.8 release on PyPI includes this fix.

Contributor

href commented Dec 28, 2016

Fixed with 97ba669. The new 0.8 release on PyPI includes this fix.

@href href closed this Dec 28, 2016

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