Login
or
register
Overview
Introduction
Features
Credits
License
This Wiki
Status
News
Releases
Change Log
Recent Wiki Edits
User Guide
Installation
Command Line
Using as a Module
Integration
Reporting Bugs
Advanced
Mailing List
Source Code
Test Suite
Extensions
Extensions
Writing Extensions
Available Extensions
Related Projects
Tickets
▹ 000066
No reason for htmlentitydefs in inlinepatterns.py
Anonymous users must enter
captcha
below.
Don't put anything here
Don't put anything here
Ticket Information
Ticket Title
in inlinepatterns.py we find: if sys.version >= "3.0": from html import entities as htmlentitydefs else: import html.entities Why? html.entities works fine with Python 3.1.x and is used once in inlinepatterns.py, within AutomailPattern: class AutomailPattern (Pattern): """ Return a mailto link Element given an automail link (`<foo@example.com>`). """ def handleMatch(self, m): el = markdown.etree.Element('a') email = m.group(2) if email.startswith("mailto:"): email = email[len("mailto:"):] def codepoint2name(code): """Return entity definition by code, or the code if not defined.""" entity = html.entities.codepoint2name.get(code) htmlentitydefs is never used and should not exist. ###Comments __By Waylan on 7/11/2010__ Yes, that is not needed for 3.1.x. However, it is required for 3.0. Of course, as Python itself dropped support for 3.0 on release of 3.1, we probably should too. Thanks for the reminder to do this. Of course, patches are welcome. __By Waylan on 7/12/2010__ Ok, I looked a little closer at this and first of all we support python versions 2.4 through 3.1. I just checked and versions 2.4, 2.5 & 2.6 do not have an html module, so we still need to ``import htmlentitydefs``. By the way, the original report by some mystery person misrepresents the code. It actually looks like this: if sys.version >= "3.0": from html import entities as htmlentitydefs else: import htmlentitydefs I wonder if the the mystery reporter looked at the source after running 2to3. I haven't actually confirmed this yet, but I believe the 2to3 tool that ships with 3.1 will convert the import line for us. It was a bug in 3.0 that that didn't happen - which required the version check. If this is true, then we can lose the version check and drop support for the now dead 3.0. __By Waylan on 07/14/2010__ I've confirmed that the 2to3 tool for Python 3.1 has in fact been fixed so that when run it makes the following change: - import htmlentitydefs + from html import entities And it changes any calls to htmlentitydefs to call entities instead. Additionally, given Python's [drop of support][1] for 3.0 upon the release of 3.1, we will drop support for Python 3.0 and only support 3.1+ in the Python 3 series. So no more special casing for 3.0 in our code. [1]: http://mail.python.org/pipermail/python-list/2009-July/1210690.html
Reported by
Assigned to
Status
open
someday
resolved
closed
Resolution
n.a.
fixed
wontfix
Advanced Fields
Priority
unassigned
high
medium
low
Resolution Explanation
Component
Don't put anything here
About This Edit
Minor Edit
Edit Summary
Don't put anything here
Don't put anything here
Don't put anything here
save
preview
cancel
Powered by
Sputnik
|
XHTML 1.1