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

Enforce unicode in transaction note #52

Merged
merged 1 commit into from
Nov 21, 2016

Conversation

leplatrem
Copy link
Contributor

It looks like something was left over for #49. Without this fix I was having this error:

  File "[...]/.venv/local/lib/python2.7/site-packages/pyramid/tweens.py", line 22, in excview_tween
    response = handler(request)
  File "[...]/.venv/local/lib/python2.7/site-packages/pyramid_tm/__init__.py", line 119, in tm_tween
    reraise(*exc_info)
  File "[...]/.venv/local/lib/python2.7/site-packages/pyramid_tm/__init__.py", line 97, in tm_tween
    t.note("Unable to decode path as unicode")
  File "[...]/.venv/local/lib/python2.7/site-packages/transaction/_transaction.py", line 537, in note
    raise TypeError("Note must be text (unicode)")
TypeError: Note must be text (unicode)

@@ -94,7 +94,7 @@ def tm_tween(request):
try:
t.note(text_(request.path_info))
except UnicodeDecodeError:
t.note("Unable to decode path as unicode")
t.note(text_("Unable to decode path as unicode"))
Copy link

@Natim Natim Nov 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably just use u"Unable to decode path as unicode" or from __future__ import unicode_literals at the begining of the file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The u'' is fine. Can someone submit a PR (with a test) and I will cut a release. Otherwise you need to wait for me to find some time.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a PR right? We will update it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry I just woke up.... This is fine, no need to update it. I thought this commit was from my previous attempt at fixing the issues.

@@ -94,7 +94,7 @@ def tm_tween(request):
try:
t.note(text_(request.path_info))
except UnicodeDecodeError:
t.note("Unable to decode path as unicode")
t.note(text_("Unable to decode path as unicode"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry I just woke up.... This is fine, no need to update it. I thought this commit was from my previous attempt at fixing the issues.

@mmerickel mmerickel merged commit d6a2965 into Pylons:master Nov 21, 2016
mmerickel added a commit that referenced this pull request Nov 21, 2016
@Natim Natim mentioned this pull request Nov 21, 2016
19 tasks
@mmerickel
Copy link
Member

Okay just released 1.1.1. Thanks for the quick PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants