[issue33274] minidom removeAttributeNode returns None

2018-06-07 Thread Ari Krupnik
Ari Krupnik added the comment: In retrospect, I wish I had submitted this as a documentation change, simply acknowledging this function's behavior. "In most computer projects there comes a day when it is discovered that the machine and the manual don't agree. When the confrontation follows,

[issue33274] minidom removeAttributeNode returns None

2018-06-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Let me clarify part of what I wrote. If we make this change in 2.7.16, then any code that uses the return value will not run on anything previous. This may not matter for you, but would be bad for public code. This cost is present in all bug fixes, but

[issue33274] minidom removeAttributeNode returns None

2018-06-07 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: > I saw what looked to me like a bug that's been in the code for 18 years, > and I saw that it was a simple fix. And you're right: It is a bug, the fix is simple, and the risk is low. Ten years ago, I'd have probably just landed the fix on all

[issue33274] minidom removeAttributeNode returns None

2018-06-07 Thread Ari Krupnik
Ari Krupnik added the comment: I feel a little bit like I wandered into a card game whose rules I didn't understand. I'm just a lay, mortal user. I've been writing Python for 15 years, first time I saw an opportunity to contribute back. I saw what looked to me like a bug that's been in the

[issue33274] minidom removeAttributeNode returns None

2018-06-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ari, I know that you viewed this as a behavior (bugfix) issue from the start (message 1). I changed to enhancement (feature request) in message 2 because, as you acknowledged in message 3, it is an edge case. The problem is classification can be fuzzy,

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: New changeset 5bfa058e65897567889354d7eb34af2b93a20f18 by Fred Drake (arikrupnik) in branch 'master': bpo-33274: Compliance with DOM L1: return removed attribute (#7465) https://github.com/python/cpython/commit/5bfa058e65897567889354d7eb34af2b93a20f18

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: I should stop relying on wetware memory; it's not working out. Sorry for the mis-information. -- ___ Python tracker ___

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Ned Deily
Ned Deily added the comment: Fred: > Python 2.7 is in security-fix-only mode That's not quite the case yet. We are still accepting bug-fixes for 2.7 although its end-of-life *is* approaching! https://devguide.python.org/#status-of-python-branches -- nosy: +ned.deily

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: Python 2.7 is in security-fix-only mode, and this doesn't fit that. While I wouldn't object to a note in the documentation, see my comments in my patch review (there's just no place for it to go). -- ___

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Ari Krupnik
Ari Krupnik added the comment: My bad. This issue looks like a simple omission to me--albeit one that's been in the code a long time. My patch simply brings the code into compliance with what the documentation (including in 2.7) already says it does. --

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: 2.7 does not get enhancements. When a core dev removes a version, don't re-add without discussion. -- versions: -Python 2.7 ___ Python tracker

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Ari Krupnik
Change by Ari Krupnik : -- pull_requests: +7088 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: I unlinked bad PR 6462 (against 3.6). PR 7465 is properly formed and should be reviewed. -- ___ Python tracker ___

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Terry J. Reedy
Change by Terry J. Reedy : -- pull_requests: -6157 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Ari Krupnik
Change by Ari Krupnik : -- pull_requests: -7086 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Ari Krupnik
Ari Krupnik added the comment: I added a test case and a News entry per serhiy.storchaka's request. https://github.com/python/cpython/pull/7465 I agree with fdrake's concerns about DOM's usefulness. DOM is not very Pythonic. I note that as long as Python has a DOM implementation, it follows

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Ari Krupnik
Change by Ari Krupnik : -- pull_requests: +7087 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33274] minidom removeAttributeNode returns None

2018-06-06 Thread Ari Krupnik
Change by Ari Krupnik : -- keywords: +patch pull_requests: +7086 stage: test needed -> patch review ___ Python tracker ___ ___

[issue33274] minidom removeAttributeNode returns None

2018-06-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please add a test and document the new feature (add a versionchanged directive in the module documentation, add a news entry and an entry in What's New). -- nosy: +serhiy.storchaka stage: -> test needed ___

[issue33274] minidom removeAttributeNode returns None

2018-05-13 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: While I've no strong objection to updating to follow the specification, I also don't see any real value here. The current minidom implementation has been considered sufficient for many years now (if you consider the DOM desirable at

[issue33274] minidom removeAttributeNode returns None

2018-04-26 Thread R. David Murray
R. David Murray added the comment: The rule in Python is that when a function mutates its argument it does *not* return a pointer to the object it just mutated, and likewise a method does *not* return a pointer to the parent object. Usually this means a mutating

[issue33274] minidom removeAttributeNode returns None

2018-04-20 Thread Ari Krupnik
Ari Krupnik added the comment: I guess the main question if whether minidom wants to adhere to the standard or be pythonic, and it's not up to me to decide, although personally I like standards. The common use case for DOM functions returning the relevant nodes is for the

[issue33274] minidom removeAttributeNode returns None

2018-04-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: It is standard in the Python stdlib that mutation methods usually return None and never echo an input argument. If one can pass a node to element.removeAttributeNode(node), there is no need to echo it back. So I suspect that the current

[issue33274] minidom removeAttributeNode returns None

2018-04-13 Thread Ari Krupnik
Change by Ari Krupnik : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list

[issue33274] minidom removeAttributeNode returns None

2018-04-13 Thread Ari Krupnik
New submission from Ari Krupnik : W3C DOM Level 1[1] requires removeAttributeNode() to return the removed node: removeAttributeNode: Removes the specified attribute. Return Value: The Attr node that was removed. Minidom implementation returns None.