[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2012-07-08 Thread Stefan Behnel
Stefan Behnel added the comment: Florent, what you describe is exactly the definition of a new feature. Users even have to change their code in order to make use of it. -- ___ Python tracker __

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2012-07-08 Thread Florent Xicluna
Florent Xicluna added the comment: Well, it fixes the behavior of ElementTree in some multi-threaded cases, provided you pass the namespace map as an argument of the serializer call. The fix implements an optional argument for this use case. As a side effect, it makes it easier to work with cu

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2012-07-08 Thread Stefan Behnel
Stefan Behnel added the comment: Looks like a new feature to me. -- versions: +Python 3.4 -Python 3.3 ___ Python tracker ___ ___ Pyth

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2012-07-08 Thread Eli Bendersky
Eli Bendersky added the comment: Can this be honestly classified as a bugfix though? If it's a feature it will have to be postponed to 3.4 -- ___ Python tracker ___ ___

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2012-07-08 Thread Florent Xicluna
Florent Xicluna added the comment: Do we merge the patch for 3.3? I'm +1 on this (patch submitted 8 months ago, backward compatible and reviewed). -- nosy: +eli.bendersky ___ Python tracker ___

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-12-10 Thread Florent Xicluna
Florent Xicluna added the comment: Of course it's better to have someone else to review the patch. However in this case, I'm not sure it is a major feature. BTW, I noticed that effbot is currently marked as *inactive* maintainer http://docs.python.org/devguide/experts.html#stdlib If it is not

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-12-09 Thread Stefan Behnel
Stefan Behnel added the comment: Given that this is a major new feature for the serialiser in ElementTree, I think it's worth asking Fredrik for any comments. -- ___ Python tracker ___

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-12-09 Thread Stefan Behnel
Changes by Stefan Behnel : -- nosy: +effbot ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-12-09 Thread Florent Xicluna
Florent Xicluna added the comment: Updated with documentation. Thank you for the review. I know this does not cover different namespaces in subtree. But this use case seems very specific. The user could find other means to achieve it. -- stage: patch review -> commit review Added file

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-11-15 Thread Florent Xicluna
Florent Xicluna added the comment: Thank you Stefan for the comments. I've added the prefix collision detection, and removed the **kw argument. (+ tests) -- Added file: http://bugs.python.org/file23702/issue13378_non_global_namespaces_v2.diff ___ Py

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-11-11 Thread Stefan Behnel
Stefan Behnel added the comment: Reading the proposed patch, I must agree that it makes more sense in ElementTree to support this as a serialiser feature. ET's tree model doesn't have a notion of prefixes, whereas it's native to lxml.etree. Two major advantages of putting this into the serial

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-11-10 Thread Stefan Behnel
Stefan Behnel added the comment: Florent, thanks for the notification. Nekmo, note that you are misusing this feature. The _namespace_map is meant to provide "well known namespace prefixes" only, so that common namespaces end up using the "expected" prefix. This is also the reason why it maps

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-11-10 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +scoder ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-11-10 Thread Florent Xicluna
Florent Xicluna added the comment: This patch proposes an implementation of the feature. >>> from xml.etree import ElementTree as ET >>> ET.tostring(ET.Element('{http://localhost/house}iq'), encoding="unicode", >>> namespaces={'http://localhost/house': 'home'}) 'http://localhost/house"; />'

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-11-09 Thread Nekmo
Nekmo added the comment: In my case, I have several clients, and they define the namespaces. I am interested in return the same namespace that they gave me, for example, the client "A" gives me this: http://localhost/house"; /> To name the namespace, I set it at nsmap: >>> import xml.etree.

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-11-09 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-11-09 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Tagging this as targeting 3.3. Nekmo, could you possibly poste some code showing the problem? -- nosy: +jcea versions: +Python 3.3 -Python 3.2 ___ Python tracker ___

[issue13378] Change the variable "nsmap" from global to instance (xml.etree.ElementTree)

2011-11-09 Thread Nekmo
New submission from Nekmo : Currently, the mapping of namespaces is global and can cause failures if multiple instances are used or in multithreading. The variable is in xml.etree.ElementTree._namespace_map. I ask it to be switched to xml.etree._Element instance. -- components: XML me