-
Notifications
You must be signed in to change notification settings - Fork 13
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
Make rendering encoding configurable #44
Conversation
Hm, the tests are only green on Python 2 and there are some Flake 8 errors. @dataflake Are you planning to look into them? |
This is work in progress and you know it's done when I ask for a review. |
I just realized I had already sent a review request, sorry, that was premature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
# This might be a TaintedString object | ||
untaintmethod = getattr(t, '__untaint__', None) | ||
if untaintmethod is not None: | ||
# Quote it | ||
t = untaintmethod() | ||
skip_html_quote = 1 | ||
|
||
if not isinstance(t, basestring): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did this work with all the unicode
and basestring
names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, we were defining them at the beginning of the module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's many places where code wants to decide "is this a string" as opposed to, say, a callable. The work that's been done to make all that Python 3 compatible was really haphazard, inconsistent and incomplete. I've spent hours stepping through the debugger on this, and I am sure there will be more edge cases found in the future.
This replaces branch
encoding-as-optional-argument
and is based on current master, I broke that branch in a botched rebase operation.This will start fixing zopefoundation/Zope#271
From Malthe's original PR #23:
This adds an optional keyword argument encoding to the publicly exposed rendering functions and classes.
See #20 for previous discussion.
Closes #20.
Closes #22.
Closes #23.