bpo-35018: Sax parser provides no user access to lexical handlers.#10328
Conversation
|
In the comment you have mentioned that this fixes issue9731 but I don't see anything in the PR related to https://bugs.python.org/issue9731 which is about adding ABCMeta.has_methods and tests for it. Please add in if I am missing something here. Thanks! |
|
It was my dyslexia - sorry. The correct number is [bpo-9371](https://bugs.python.org/issue9371).
…On Sun, Nov 4, 2018 at 11:21 PM Xtreak ***@***.***> wrote:
In the comment you have mentioned that this fixes issue9731 but I don't
see anything in the PR related to https://bugs.python.org/issue9731 which
is about adding ABCMeta.has_methods and tests for it. Please add in if I am
missing something here.
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10328 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAWTNeAG7OkT11i3vnG1VXvIXqsJwkGYks5ur8rwgaJpZM4YNrPQ>
.
|
|
It's okay. It seems somehow the bot links the PR with ticket numbers in the PR comment. I don't know if it's intentional though. Thanks for the clarification. |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Please edit the title and the description of this PR.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
I have made the requested changes; please review again . |
|
Thanks for making the requested changes! @serhiy-storchaka: please review the changes made to this pull request. |
| SAXException, SAXReaderNotAvailable, SAXParseException | ||
| import unittest | ||
| from unittest import mock | ||
| from Lib.pickle import FALSE |
There was a problem hiding this comment.
What relation does SAX have to pickle?
| version = '2.0beta' | ||
|
|
||
| #============================================================================ | ||
| # ============================================================================ |
| Parser, the parser will call the method in your object to | ||
| resolve all external entities. Note that DefaultHandler implements | ||
| this interface with the default behaviour.""" | ||
| this interface with the default behavior.""" |
There was a problem hiding this comment.
Unrelated change. Aren't both spellings correct?
| @@ -0,0 +1,4 @@ | |||
| Add the LexicalHandler class that is present in other SAX XML | |||
| implementations. The plumbing is already supported by Ptyhon so this simply | |||
| adds the poecelain that makes it easy for users of the Python Sax parser to | |||
There was a problem hiding this comment.
Also I think it's Python not Ptyhon
|
I agree completely on almost all of the comments on this PR but I do have
two questions.
1. Is there an accepted policy on English spelling usage for Python? My
personal reaction is that spelling should be consistent across the entire
corpus and since I felt that the combination of American English users and
ESL users who tend to follow American English usage meant that American
English was the best choice. I like to use spell checkers in my work
because I am very prone to adjacent character typing errors and hence I
automatically try to eliminate reported errors when I encounter them. But I
fully accept that community policy should override individual preferences.
2 What is community policy regarding PEP8? I use autopep8 for all my Python
work and in the case of a line such as "#####################" it reports
"E265 block comment should start with '# '". I found that autopep8 accepts
"# #####" but not "#####". I did sufficient work in xml.sax.handler.py that
it seemed to me that it would be reasonable to eliminate all the PEP8
errors in it but again I will follow community policy.
…On Thu, Nov 8, 2018 at 2:34 AM Xtreak ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Misc/NEWS.d/next/Library/2018-11-03-21-21-32.[bpo-35018](https://bugs.python.org/issue35018).z1vnri.rst
<#10328 (comment)>:
> @@ -0,0 +1,4 @@
+Add the LexicalHandler class that is present in other SAX XML
+implementations. The plumbing is already supported by Ptyhon so this simply
+adds the poecelain that makes it easy for users of the Python Sax parser to
Also I think it's Python not Ptyhon
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10328 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAWTNVlhMgiFrgu8_V71aqsdRR6FkyeEks5us-yRgaJpZM4YNrPQ>
.
|
|
|
I have made the requested changes; please review again . |
|
Thanks for making the requested changes! @serhiy-storchaka: please review the changes made to this pull request. |
|
@serhiy-storchaka Is it possible to mark issues bpo-6686 and bpo-9371 as depending on this issue bpo-35018. Both need the LexicalHandler to implement the fix and I don't have the authority to do this myself. |
|
scoder
left a comment
There was a problem hiding this comment.
I agree with the request to exclude unrelated changes from this feature PR.
| """This is implemented as a separate class since CDATA sections in XML | ||
| cannot appear within elements defined within a DTD. Hence this test does | ||
| not use a DTD.""" | ||
| def __init__(self, *args, **kwargs): |
There was a problem hiding this comment.
Doing something in TestCase.__init__(), especially setting up test data, is a very unusual thing to do. Please use the normal set-up methods instead.
| method with the property identifier | ||
| 'http://xml.org/sax/handlers/LexicalHandler'.""" | ||
|
|
||
| def xmlDecl(self, version, encoding, standalone): |
There was a problem hiding this comment.
This method is not part of the LexicalHandler interface.
http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
@jgossage, please address the code review requests. Thanks! |
|
I'm going to close this for now as the original PR author has not been active for awhile. This can be re-opened once work is ready to continue. Thanks! |
This PR contains the functionality that is needed to fix bpo-6686 and bpo-9371, namely the LexicalHandler class which makes it easy to access XML comments and the document encoding. Those PR's depend on this issue.
https://bugs.python.org/issue35018