[issue16731] xxlimited/xxmodule docstrings ambiguous

2015-12-30 Thread Daniel Shahaf
Daniel Shahaf added the comment: I don't mind at all. Go ahead :) -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16731> ___ ___

[issue17050] argparse.REMAINDER doesn't work as first argument

2015-09-29 Thread Daniel Shahaf
Changes by Daniel Shahaf <pyt...@danielsh.fastmail.net>: -- nosy: +danielsh ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17050> ___

[issue16379] SQLite error code not exposed to python

2015-08-24 Thread Daniel Shahaf
Daniel Shahaf added the comment: What's the reasoning behind offering a error code to name mapping? Allowing code that runs into an error to print the error name rather than its numeric value. This saves whoever reads the error message having to look it up himself. his seem problematic

[issue23802] patch: __deepcopy__ memo dict argument usage

2015-03-29 Thread Daniel Shahaf
New submission from Daniel Shahaf: In the 'copy' module documentation, it wasn't fully clear to me how __deepcopy__ implementations should treat the memo dict argument. The attached patch clarifies that __deepcopy__ implementations should treat the memo dict argument as an opaque type

[issue14208] No way to recover original argv with python -m

2013-01-13 Thread Daniel Shahaf
Daniel Shahaf added the comment: Antoine Pitrou wrote on Sun, Jan 13, 2013 at 10:19:20 +: Antoine Pitrou added the comment: I'm not seeing a good justification for doing anything more, though: - needing to access this information is an exceedingly niche use case - I don't see

[issue10544] yield expression inside generator expression does nothing

2013-01-12 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: -- nosy: +danielsh ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10544 ___ ___ Python-bugs

[issue14208] No way to recover original argv with python -m

2013-01-12 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: -- nosy: +danielsh ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14208 ___ ___ Python-bugs

[issue2209] mailbox module doesn't support compressed mbox

2013-01-12 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: -- nosy: +danielsh ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2209 ___ ___ Python-bugs

[issue16076] xml.etree.ElementTree.Element is no longer pickleable

2013-01-11 Thread Daniel Shahaf
Daniel Shahaf added the comment: Ezio Melotti wrote on Fri, Jan 11, 2013 at 08:44:43 +: ### one ref leaked for every child in __setstate__: e2.__setstate__(p2) [76810 refs] e2.__setstate__(p2) [76813 refs] e2.__setstate__(p2) [76816 refs] I'm not working on this anymore now, so

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2013-01-08 Thread Daniel Shahaf
Daniel Shahaf added the comment: Eli Bendersky wrote on Tue, Jan 08, 2013 at 15:00:42 +: Eli Bendersky added the comment: P = import_fresh_module('xml.etree.ElementTree', blocked=['_elementtree']) tb = P.TreeBuilder(element_factory=lambda a, b: [a, b]) print(pickle.dumps(tb

[issue16076] xml.etree.ElementTree.Element is no longer pickleable

2013-01-08 Thread Daniel Shahaf
Daniel Shahaf added the comment: Dissociating TreeBuilder from this issue per recent comments. -- title: xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable - xml.etree.ElementTree.Element is no longer pickleable

[issue16076] xml.etree.ElementTree.Element is no longer pickleable

2013-01-08 Thread Daniel Shahaf
Daniel Shahaf added the comment: v8 removes TreeBuilder handling (code + tests) and removes memcpy per review. (Outstanding issues in the review can be fixed post-v8, if needed.) -- Added file: http://bugs.python.org/file28639/i16076-v8.diff

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2013-01-07 Thread Daniel Shahaf
Daniel Shahaf added the comment: In the meantime, unrelated question: should TreeBuilder be pickleable too, and interchangeably (pickle|unpickle)able between the Python and C implementations? Asking because the Python TreeBuilder has a _factory member which it initializes to 'Element

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2013-01-07 Thread Daniel Shahaf
Daniel Shahaf added the comment: New iteration. Open issues: - Share code with the init method. The issue with sharing code with either element_init() or create_new_element() would be malloc+realloc: unlike either of these methods, we know both the attributes and the number of children

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2013-01-06 Thread Daniel Shahaf
Daniel Shahaf added the comment: Eli Bendersky wrote on Thu, Jan 03, 2013 at 14:44:02 +: If this change is required (even if we choose to name it xml.etree.ElementTree.Element for Py compatibility to fix the pickling regression, we may find ourselves in a need to change it between 3.3

[issue16808] inspect.stack() should return list of named tuples

2013-01-04 Thread Daniel Shahaf
Daniel Shahaf added the comment: Terry J. Reedy wrote on Sat, Jan 05, 2013 at 01:33:50 +: Should a test be added to or changed in test_inspect? Line 163 has a test_stack method that calls inspect.stack. Makes sense; added a test that tests named attribute access. Thanks for the pointer

[issue16808] inspect.stack() should return list of named tuples

2013-01-04 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: Removed file: http://bugs.python.org/file28571/inspect-v4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16808

[issue16808] inspect.stack() should return list of named tuples

2013-01-04 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: Added file: http://bugs.python.org/file28572/inspect-v5.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16808

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2013-01-03 Thread Daniel Shahaf
Daniel Shahaf added the comment: Eli Bendersky wrote on Thu, Jan 03, 2013 at 14:44:02 +: On Tue, Jan 1, 2013 at 2:56 PM, Daniel Shahaf rep...@bugs.python.orgwrote: I added the _elementtree to the tp_name in order to bypass the above error. Module-qualified names were in use elsewhere

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2013-01-01 Thread Daniel Shahaf
Daniel Shahaf added the comment: Eli Bendersky wrote on Tue, Jan 01, 2013 at 15:54:00 +: Why did you change the class name, by the way, I don't think it's a valid change at least for 3.3 in terms of backwards compatibility. With unmodified tip of 3.4: import pickle

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2013-01-01 Thread Daniel Shahaf
Daniel Shahaf added the comment: Eli Bendersky wrote on Tue, Jan 01, 2013 at 00:32:51 +: 1. Why did you choose to implement __reduce__ and not __getstate__? Maybe I was simply imitating what some other extension module was doing ;) By using __reduce__ with the type as first return value

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2013-01-01 Thread Daniel Shahaf
Daniel Shahaf added the comment: Also, the class inheritance in the tests should be amended to follow #16835. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16076

[issue16808] inspect.stack() should return list of named tuples

2012-12-31 Thread Daniel Shahaf
Daniel Shahaf added the comment: Fixed that in v3. -- Added file: http://bugs.python.org/file28515/inspect-v3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16808

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2012-12-31 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: -- nosy: +danielsh ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9334 ___ ___ Python-bugs

[issue16379] SQLite error code not exposed to python

2012-12-30 Thread Daniel Shahaf
Daniel Shahaf added the comment: New patch, with better docs and less error leaks, per Ezio's review. -- Added file: http://bugs.python.org/file28496/i16379-v2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16379

[issue16379] SQLite error code not exposed to python

2012-12-30 Thread Daniel Shahaf
Daniel Shahaf added the comment: A couple of random eyebrow-raisers I noticed while working on v2: - sqlite3.Warning is a subclass of Exception, rather than sqlite3.Error or builtins.Warning. (Also, the docs say will raise a Warning, intending to refer to sqlite3.Warning, but the lack

[issue16379] SQLite error code not exposed to python

2012-12-30 Thread Daniel Shahaf
Daniel Shahaf added the comment: New patch fixing indentation of versionadded markup. -- Added file: http://bugs.python.org/file28497/i16379-v3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16379

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-30 Thread Daniel Shahaf
Daniel Shahaf added the comment: Attached. Differences to previous version: - Avoid the test___all__ issue (#16817) by manipulating sys.modules directly - Support pickling interoperability between the C and Python implementations -- Added file: http://bugs.python.org/file28502

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-30 Thread Daniel Shahaf
Daniel Shahaf added the comment: BTW, maybe I'm just confused, but I'm a little surprised that C pickling - Python unpickling works: the C __reduce__ returns a 3-element tuple, which according to pickle docs[1] must either be a dictionary or be passed to __setstate__; it's not a dictionary

[issue7735] socket.create_connection() creates IPv6 DNS requests even when built with --disable-ipv6

2012-12-30 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: -- title: python creates IPv6 DNS requests even when built with --disable-ipv6 - socket.create_connection() creates IPv6 DNS requests even when built with --disable-ipv6 ___ Python tracker rep

[issue7735] socket.create_connection() creates IPv6 DNS requests even when built with --disable-ipv6

2012-12-30 Thread Daniel Shahaf
Daniel Shahaf added the comment: Victor, thanks for the summary. I view things a little differently, so I'll offer my POV: 1. The OPs (Evan and Ralf) build with --disable-ipv6. 2. --disable-ipv6 disables support for IPv6 sockets. (as per Martin, and AFAIK as per the common meaning

[issue16808] inspect.stack() should return list of named tuples

2012-12-29 Thread Daniel Shahaf
Daniel Shahaf added the comment: Why did you set stage to 'needs patch'? One is already attached. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16808

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-29 Thread Daniel Shahaf
Daniel Shahaf added the comment: I wrote the patch against default (3.4), but it applies cleanly to 3.3. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16076

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-29 Thread Daniel Shahaf
Daniel Shahaf added the comment: Any attempt to pickle an Element object in test_xml_etree.py causes that test to fail if test___all__ had been run before it; see attached transcript. It's against 3.4, with no changes other than the testsuite changes shown within. I don't know what the root

[issue15083] Rewrite ElementTree tests in a cleaner and safer way

2012-12-29 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: -- nosy: +danielsh ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15083 ___ ___ Python-bugs

[issue16817] test___all__ has to save and restore sys.modules while it does all the importing

2012-12-29 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: -- nosy: +danielsh ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16817 ___ ___ Python-bugs

[issue16808] inspect.stack() should return list of named tuples

2012-12-29 Thread Daniel Shahaf
Daniel Shahaf added the comment: Add versionchanged per review. -- keywords: +patch Added file: http://bugs.python.org/file28488/inspect-v2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16808

[issue16379] SQLite error code not exposed to python

2012-12-28 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: -- nosy: +danielsh ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16379 ___ ___ Python-bugs

[issue16379] SQLite error code not exposed to python

2012-12-28 Thread Daniel Shahaf
Daniel Shahaf added the comment: Attached patch that: - Adds sqlite3.SQLITE_OK constants - Adds sqlite3.errorcode dictionary - Adds sqlite_errcode attribute to sqlite.Error instances The patch does not add support for extended result codes (http://www.sqlite.org/c3ref/c_abort_rollback.html

[issue16379] SQLite error code not exposed to python

2012-12-28 Thread Daniel Shahaf
Daniel Shahaf added the comment: I didn't compile-test the Doc/ part of the patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16379

[issue16808] inspect.stack() should return list of named tuples

2012-12-28 Thread Daniel Shahaf
New submission from Daniel Shahaf: Currently inspect.stack() returns a list of 6-tuples. I suggest to make it return a list of named tuples, so code that only needs one tuple element can get it by name. Current behaviour: % ./python -c 'import inspect; print(inspect.stack()[0])' (frame

[issue16731] xxlimited/xxmodule docstrings ambiguous

2012-12-21 Thread Daniel Shahaf
Daniel Shahaf added the comment: Re the review, yes there is a typo in the comment: the comment in xxlimited.c should say xxmodule.c rather than xxlimited.c. (Got a traceback from the review app) -- ___ Python tracker rep...@bugs.python.org http

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-19 Thread Daniel Shahaf
Daniel Shahaf added the comment: Re the problem from msg 177134 ('./python -mtest test___all__ test_xml_etree' failing), it is a a preexisting problem, in the sense that applying just the Lib/test/ part of this patch suffices to trigger it. Adding 'xml.etree' to the blacklist in test___all__

[issue16731] xxlimited/xxmodule docstrings ambiguous

2012-12-19 Thread Daniel Shahaf
New submission from Daniel Shahaf: Tweak the docstrings of xxmodule and xxlimited to clarify the difference between them (as derived from setup.py). While at it also add a defensive coding guard to xxlimited to ensure it remains Py_LIMITED_API-safe. -- assignee: docs@python

[issue16732] setup.py support for xxmodule without tkinker

2012-12-19 Thread Daniel Shahaf
New submission from Daniel Shahaf: In setup.py, the logic or enabling xxmodule/xxlimited is currently in detect_tkinker(), so it's not run when one of the 'return' statements in the latter is executed. On a box without tk installed, xxmodule.o gets built with the attached patch

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-16 Thread Daniel Shahaf
Daniel Shahaf added the comment: Haven't had a chance to look at the test___all__ -related failures yet. Still planning to do so once I have some time. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16076

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-08 Thread Daniel Shahaf
Daniel Shahaf added the comment: @Eli, thanks. In the meantime, attaching a patch addressing Ezio's review; the caveats from msg 177134 still apply. -- Added file: http://bugs.python.org/file28261/i16076-v4-combined.diff ___ Python tracker rep

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-07 Thread Daniel Shahaf
Daniel Shahaf added the comment: TreeBuilder was also pickleable in 3.2 but now isn't so; updating summary accordingly. Attaching a checkpoint patch. It addresses both Element and TreeBuilder, and adds tests. The added tests fail if test___all__ is included in the test run, so the patch

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-07 Thread Daniel Shahaf
Daniel Shahaf added the comment: Reattaching without the unrelated Python-ast.c change. -- Added file: http://bugs.python.org/file28252/i16076-v3-combined.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16076

[issue16076] xml.etree.ElementTree.Element and xml.etree.ElementTree.TreeBuilder are no longer pickleable

2012-12-07 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: Removed file: http://bugs.python.org/file28251/i16076-v2-combined.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16076

[issue16076] xml.etree.ElementTree.Element is no longer pickleable

2012-12-03 Thread Daniel Shahaf
Daniel Shahaf added the comment: Attached patch for your consideration. I've tested pickling/unpickling and comparing the resulting object attribute by attribute (.tag, .attrib, .text, .tail for equality; and recursively .getchildren()), and 'make test' --- all seems to work. If the approach

[issue16593] Have BSD 'make -s' DTRT

2012-12-01 Thread Daniel Shahaf
New submission from Daniel Shahaf: FreeBSD make sets $$MAKEFLAGS differently than GNU make does. Attached patch updates Makefile.pre.in to recognise that syntax too. Preliminary versions discussed with Crys on #python-dev. -- components: Build messages: 176768 nosy: danielsh priority

[issue16593] Have BSD 'make -s' DTRT

2012-12-01 Thread Daniel Shahaf
Changes by Daniel Shahaf pyt...@danielsh.fastmail.net: -- keywords: +patch Added file: http://bugs.python.org/file28182/makedashs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16593