[issue17041] Fix tests for build --without-doc-strings

2013-01-26 Thread Stefan Krah
Stefan Krah added the comment: I've already committed a decorator in 5c7f92bfe785, but it isn't quite robust. I think the one in issue17041-decorator.diff should do the trick. Also, we then can use support.HAVE_DOCSTRINGS for some doctests. -- Added file: http://bugs.

[issue17041] Fix tests for build --without-doc-strings

2013-01-26 Thread Stefan Krah
Stefan Krah added the comment: Serhiy Storchaka wrote: > > It seems like it would make more sense to combine both checks into one > > decorator. > > These are different cases. @unittest.skipIf(sys.flags.optimize >= 2) is about > docstrings in Python

[issue17042] Example in C-API memory management doc has confusing order

2013-01-26 Thread Stefan Krah
Stefan Krah added the comment: Please don't change this: It's a common pattern in C to undo memory allocations in the opposite order. -- nosy: +skrah ___ Python tracker <http://bugs.python.o

[issue17043] Invalid read in test_codecs

2013-01-26 Thread Stefan Krah
New submission from Stefan Krah: Found this in test_codecs running under Valgrind (Python 3.3): test_bug1251300 (test.test_codecs.UnicodeInternalTest) ... ==11511== Invalid read of size 1 ==11511==at 0x44AF37: _PyUnicode_DecodeUnicodeInternal (unicodeobject.c:6133) ==11511==by

[issue17043] Invalid read in test_codecs

2013-01-26 Thread Stefan Krah
Stefan Krah added the comment: Same in test_codeccallbacks: test_badhandlerresults (test.test_codeccallbacks.CodecCallbackTest) ... ==11604== Invalid read of size 1 ==11604==at 0x44AF37: _PyUnicode_DecodeUnicodeInternal (unicodeobject.c:6133) ==11604==by 0x4DEB5C

[issue17041] Fix tests for build --without-doc-strings

2013-01-26 Thread Stefan Krah
Stefan Krah added the comment: The patches are really small, so +1 for committing this before the rc1 for 2.7.4 is released. -- ___ Python tracker <http://bugs.python.org/issue17

[issue17041] Fix tests for build --without-doc-strings

2013-01-26 Thread Stefan Krah
Stefan Krah added the comment: I left some comments but have no indication that they got mailed. -- ___ Python tracker <http://bugs.python.org/issue17041> ___ ___

[issue10156] Initialization of globals in unicodeobject.c

2013-01-26 Thread Stefan Krah
Stefan Krah added the comment: Buildbots etc. look all good. Thanks for fixing this. -- ___ Python tracker <http://bugs.python.org/issue10156> ___ ___ Python-bug

[issue10156] Initialization of globals in unicodeobject.c

2013-01-26 Thread Stefan Krah
Changes by Stefan Krah : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue10156> ___ ___ Python-bugs-list mailing list Unsubscri

[issue10156] Initialization of globals in unicodeobject.c

2013-01-26 Thread Stefan Krah
Changes by Stefan Krah : -- resolution: -> fixed stage: patch review -> committed/rejected ___ Python tracker <http://bugs.python.org/issue10156> ___ ___

[issue17042] Example in C-API memory management doc has confusing order

2013-01-26 Thread Stefan Krah
Stefan Krah added the comment: Moderately opposed, yes. PyMem_Malloc()/PyMem_Free() and PyMem_New()/PyMem_Del() are already explained in depth above. -- ___ Python tracker <http://bugs.python.org/issue17

[issue7576] Avoid warnings in PyModuleDef_HEAD_INIT

2013-01-26 Thread Stefan Behnel
Stefan Behnel added the comment: This is a duplicate of issue 9518 (or the other way round) and should be closed as fixed in 3.2. -- components: +Extension Modules nosy: +scoder ___ Python tracker <http://bugs.python.org/issue7

[issue17041] Fix tests for build --without-doc-strings

2013-01-27 Thread Stefan Krah
Stefan Krah added the comment: Right, keeping the cases separate is indeed clearer. Serhiy, in case you are waiting for my "stick to minimal changes" comment to be resolved: People apparently *do* use --without-doc-strings, so the additional code in test_pydoc.py is r

[issue17041] Fix tests for build --without-doc-strings

2013-01-27 Thread Stefan Krah
Stefan Krah added the comment: doctests_without_docstrings.patch looks good to me. -- ___ Python tracker <http://bugs.python.org/issue17041> ___ ___ Python-bug

[issue17041] Fix tests for build --without-doc-strings

2013-01-31 Thread Stefan Krah
Stefan Krah added the comment: Serhiy, if you have time, I think it would be nice to get the remaining fix into the upcoming release candidates. -- ___ Python tracker <http://bugs.python.org/issue17

[issue17034] Initialization of globals in stringobject.c and bytesobject.c

2013-01-31 Thread Stefan Krah
Stefan Krah added the comment: This is mainly about Py_CLEAR(), right? The initializations to NULL should be guaranteed by the C standard. -- ___ Python tracker <http://bugs.python.org/issue17

[issue17034] Use Py_CLEAR() in stringobject.c and bytesobject.c

2013-01-31 Thread Stefan Krah
Stefan Krah added the comment: Yes, it's guaranteed: 6.7.8 Initialization 10) If an object that has automatic storage duration is not initialized explicitly, its value is indeterminate. If an object that has static storage duration is not initialized expli

[issue17094] sys._current_frames() reports too many/wrong stack frames

2013-01-31 Thread Stefan Ring
New submission from Stefan Ring: After a fork, the list of thread states contains all the threads from before. It is especially unfortunate that, at least for me, it usually happens that threads created in the forked process reuse the same thread ids, and sys._current_frames will then return

[issue17094] sys._current_frames() reports too many/wrong stack frames

2013-01-31 Thread Stefan Ring
Changes by Stefan Ring : Added file: http://bugs.python.org/file28925/test-fork-frames.py ___ Python tracker <http://bugs.python.org/issue17094> ___ ___ Python-bugs-list m

[issue17105] Python 3.2 segfault

2013-02-02 Thread Stefan Krah
Stefan Krah added the comment: Thanks for the report. I cannot reproduce it with the latest 3.2 version. Perhaps the version shipped with Ubuntu 11.04 has this problem. -- nosy: +doko, skrah ___ Python tracker <http://bugs.python.org/issue17

[issue17105] Python 3.2 segfault

2013-02-02 Thread Stefan Krah
Stefan Krah added the comment: IOW, my advice is to get Python 3.3 from hg.python.org and see if you can reproduce the issue. -- ___ Python tracker <http://bugs.python.org/issue17

[issue17105] Python 3.2 segfault

2013-02-02 Thread Stefan Krah
Stefan Krah added the comment: Thanks for testing. The problem with the Ubuntu Python "Python 3.2 (r32:88445, Oct 20 2012, 14:09:50)" is that it seems to be a patched 3.2.0, while we're already at 3.2.3. So it might be worth reporting this issue to Ubuntu. -- resolu

[issue5308] cannot marshal objects with more than 2**31 elements

2013-02-06 Thread Stefan Krah
Stefan Krah added the comment: Theoretically int may be 16 bits (C99): 5.2.4.2.1 Sizes of integer types -- maximum value for an object of type int INT_MAX +32767 // 2**15 − 1 I agree that Python wouldn't compile on such a platform anyway. -- nosy: +

[issue5308] cannot marshal objects with more than 2**31 elements

2013-02-06 Thread Stefan Krah
Stefan Krah added the comment: Hmm, Mark was faster. ;) -- ___ Python tracker <http://bugs.python.org/issue5308> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17145] memoryview(array.array)

2013-02-06 Thread Stefan Krah
Stefan Krah added the comment: Changing array.array would be a new feature, so it cannot go into 2.7. The documentation could be improved, see also #14198. -- assignee: -> docs@python components: +Documentation -None nosy: +docs@python, sk

[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2013-02-07 Thread Stefan Krah
Stefan Krah added the comment: The FreeBSD 6.4 bot is failing, too. Note that the other functions in test_returnfuncptrs.py do this in order to get strchr(): dll = CDLL(_ctypes_test.__file__) get_strchr = dll.get_strchr get_strchr.restype = CFUNCTYPE(c_char_p, c_char_p, c_char

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2013-02-08 Thread Stefan Behnel
New submission from Stefan Behnel: I can't see a reason why Signature.from_function() should explicitly check the type of the object being passed in. As long as the object has all required attributes, it should be accepted. This is specifically an issue with Cython compiled functions,

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2013-02-08 Thread Stefan Behnel
Stefan Behnel added the comment: This patch removes the type check from Signature.from_function() and cleans up the type tests in signature() to use whatever the inspect module defines as isfunction() and isbuiltin(), so that it becomes properly monkey-patchable. It also adds a test that

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2013-02-08 Thread Stefan Behnel
Stefan Behnel added the comment: The method doesn't seem to be documented, and I'm not sure if the docstring really benefits from this lengthy addition. Anyway, here's a patch that includes the docstring update. The exception could be kept the same if we catch an Att

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2013-02-08 Thread Stefan Behnel
Stefan Behnel added the comment: Fine with me. Updated patch attached. -- Added file: http://bugs.python.org/file29007/inspect_sig_2.patch ___ Python tracker <http://bugs.python.org/issue17

[issue9067] Use macros from pyctype.h

2013-02-09 Thread Stefan Krah
Changes by Stefan Krah : -- resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> uses of locale-dependent ctype functions ___ Python tracker <http://bugs.pytho

[issue17173] uses of locale-dependent ctype functions

2013-02-09 Thread Stefan Krah
Stefan Krah added the comment: I'm not sure if I'll use pyctype.h in libmpdec: It's still going to be an external project that should be completely identical to the version in the Python tree. libmpdec/io.c is specified to be ASCII only (while handling the Turkish 'I'

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2013-02-10 Thread Stefan Behnel
Stefan Behnel added the comment: Any more comments? Any objections to applying the last patch? Anyone ready to do it? -- ___ Python tracker <http://bugs.python.org/issue17

[issue4591] 32-bits unsigned user/group identifier

2013-02-10 Thread Stefan Krah
Stefan Krah added the comment: Not technically the topic of this issue, but should we just lock down _Py_Uid_Converter() to ints? This is still accepted: os.setuid(Decimal("1000.2")) -- nosy: +skrah ___ Python tracker <http://bu

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2013-02-10 Thread Stefan Behnel
Stefan Behnel added the comment: 1) that's a regex test, so it just looks for the text. I only extended it to include the object it's supposed to test for. It's not actually related to my changes, but I considered it the right thing to do. I used "42.*is not" in order

[issue4591] 32-bits unsigned user/group identifier

2013-02-11 Thread Stefan Krah
Stefan Krah added the comment: Serhiy Storchaka wrote: > > Not technically the topic of this issue, but should we just lock > > down _Py_Uid_Converter() to ints? > > I just copied this code from PyArg_ParseTuple*() for 'l' format. > > os.setuid(Decimal(&qu

[issue18990] Remove unnecessary API inconsistency from ElementTree.XMLPullParser.close()

2013-09-12 Thread Stefan Behnel
Stefan Behnel added the comment: ping - I would like to see this fixed for alpha3, which is due in two weeks. -- ___ Python tracker <http://bugs.python.org/issue18

[issue18902] Make ElementTree event handling more modular to allow custom targets for the non-blocking parser

2013-09-12 Thread Stefan Behnel
Stefan Behnel added the comment: The way the XMLPullParser is implemented in lxml.etree now is that it simply inherits from XMLParser. This would also make sense for ElementTree, even before supporting arbitrary targets. The patch in ticket #18990 makes this simple to do. For reference, here

[issue17741] event-driven XML parser

2013-09-12 Thread Stefan Behnel
Stefan Behnel added the comment: The way the XMLPullParser is implemented in lxml.etree now is that it simply inherits from XMLParser. This would also make sense for ElementTree, even before supporting arbitrary targets. The patch in ticket #18990 makes this simple to do. For reference, here

[issue18902] Make ElementTree event handling more modular to allow custom targets for the non-blocking parser

2013-09-13 Thread Stefan Behnel
Stefan Behnel added the comment: > Also, +1 for allowing start-ns and end-ns event callbacks on parser targets, > although that's a different feature entirely. Actually, I take that back. I can't see a use case for this feature, and it doesn't really fit with the notion o

[issue18902] Make ElementTree event handling more modular to allow custom targets for the non-blocking parser

2013-09-13 Thread Stefan Behnel
Stefan Behnel added the comment: I created a separate ticket #19010 for the inheritance issue. -- ___ Python tracker <http://bugs.python.org/issue18902> ___ ___

[issue19010] Make XMLPullParser in ElementTree inherit from XMLParser

2013-09-13 Thread Stefan Behnel
New submission from Stefan Behnel: As mentioned in tickets #18902 and #17741, the XMLPullParser in the external lxml.etree package inherits from the existing XMLParser class. This makes the interface simpler, both simpler to explain and to implement. The implementation in ElementTree should

[issue18990] Remove unnecessary API inconsistency from ElementTree.XMLPullParser.close()

2013-09-13 Thread Stefan Behnel
Stefan Behnel added the comment: I've updated the lxml documentation to reflect the new implementation. It also has a couple of examples that show how the API works now. https://github.com/lxml/lxml/blob/74ab4b10176750e7797eb0eff3c7c91901ab6adb/doc/parsing.txt

[issue18059] Add multibyte encoding support to pyexpat

2013-09-13 Thread Stefan Behnel
Stefan Behnel added the comment: I don't think I have my head deep enough in the encodings implementation to say that this is the correct/best way to do it, but the patch looks mostly reasonable to me and would be a helpful addition. I have two comments on the pyexpat_encoding_co

[issue19014] Allow memoryview.cast() for empty views

2013-09-15 Thread Stefan Krah
Stefan Krah added the comment: I agree that this cast should work. Perhaps disallowing zero strides is enough -- I have to look at this more closely though. -- ___ Python tracker <http://bugs.python.org/issue19

[issue18990] Remove unnecessary API inconsistency from ElementTree.XMLPullParser.close()

2013-09-19 Thread Stefan Behnel
Stefan Behnel added the comment: Inviting some more people to get this patch reviewed in a timely fashion. Given that it's a cleanup of a newly introduced API, it must go in before the first beta release of 3.4. The even wider cleanup would be to make XMLPullParser inherit from XMLParser

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-19 Thread Stefan Behnel
Stefan Behnel added the comment: I'm not entirely happy about the docs anyway. Most people just want to loop over iterparse() and be done (use case being to save memory). The new parser class is a rather special and more complex thing that we shouldn't let innocent users run into t

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-20 Thread Stefan Behnel
Stefan Behnel added the comment: Ah, right - I forgot that it currently only implements a part of the parser API in ElementTree. Adding "Returns the toplevel document element." behind the current sentence would do, I guess. That will need updating once the XMLPullParser implements s

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-20 Thread Stefan Behnel
Stefan Behnel added the comment: > Just as an example: consider that in a lot of use cases the programmer will > want to discard parts of the tree that's parsed iteratively (similarly to the > main use case of iterparse()), because the XML itself is too huge. It's a > co

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: Eli, seeing our discussion so far, ISTM that the parser-target interface is at the very heart of our disagreement. For me, it's a good design that provides a clean separation of concerns between the parser that generates events, and the target (usually

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: > That means the patch could be simplified to just removing the root > attribute without changing the result of calling close(). Absolutely. Returning the parse result from close() would still make it both more consistent and easier to use (also from

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: > Unfortunately I don't have time to review refactoring patches now. In light > of a larger refactoring planned in this part of the module in the future, I > don't think it's very important to tweak things right now. You misunderst

[issue19001] test_gdb fails on Fedora buildbot

2013-09-21 Thread Stefan Krah
Stefan Krah added the comment: The regular build (with threads) on that machine has the same problem. Closing the issue is fine, but there does not seem to be an easy way to upgrade Fedora from 16 to 19. Perhaps we can skip the test so that the buildbot continues to be useful

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: > I still consider this refactoring gratuitious at this point. The API is > well defined by the documentation. All the rest is implementation details. Famous last words. -- ___ Python tracker <http://bugs.p

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-26 Thread Stefan Behnel
Stefan Behnel added the comment: Here's the obvious minimal patch that removes the non-public 'root' attribute. Please apply it for Py3.4 and then set the version tag of this ticket to Py3.5 (instead of closing it, because it's not resolved yet). As I said, the expected t

[issue19107] CSV output of benchmark runner tries to write to binary file

2013-09-27 Thread Stefan Behnel
New submission from Stefan Behnel: The perf.py script opens the file for CSV output in binary mode, which no longer works in Py3: Index: perf.py === --- perf.py (Revision 80409) +++ perf.py (Arbeitskopie) @@ -2443,7

[issue19107] CSV output of benchmark runner tries to write to binary file

2013-09-27 Thread Stefan Behnel
Changes by Stefan Behnel : -- nosy: +brett.cannon, pitrou ___ Python tracker <http://bugs.python.org/issue19107> ___ ___ Python-bugs-list mailing list Unsub

[issue19108] Benchmark runner tries to execute external Python command and fails on error reporting

2013-09-27 Thread Stefan Behnel
New submission from Stefan Behnel: In changeset 88b6ef9aa9e9, a new function ported_lib() was added that crashes on error reporting in Py3 because it tries to do this: raise RuntimeError("Benchmark died: " + err) "err" is a bytes object that comes straight from the s

[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

2013-09-28 Thread Stefan Behnel
Stefan Behnel added the comment: Eli didn't explicitly comment on the patch so far, but let me quote some of his earlier comments: > if the reader discards parts of the tree (by deleting subtrees), then > returning the root from close() becomes even more meaningless, because it

[issue19001] test_gdb fails on Fedora buildbot

2013-09-28 Thread Stefan Krah
Stefan Krah added the comment: Nick Coghlan wrote: > My F19 system (which works) shows gdb-7.6-34, while the new debugging output > Antoine added shows 7.3.50.20110722-16.fc16 on F16 > > Maybe the new gdb version check needs to be looking for 7.4+ rather than 7.3+? Yes, pro

[issue18990] Remove root attribute from XMLPullParser

2013-09-28 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks, Nick. Your changes look good to me. -- ___ Python tracker <http://bugs.python.org/issue18990> ___ ___ Python-bugs-list m

[issue19078] Allow reversed(memoryview), like memoryview

2013-09-28 Thread Stefan Krah
Stefan Krah added the comment: Yes, len() should return the number of items. +1 for making reversed() work. NumPy does this: >>> x = numpy.array([1,2,3,4,5,6,7,8]) >>> list(reversed(x)) [8, 7, 6, 5, 4, 3, 2, 1] >>> >>> x = numpy.array([[1,2,3], [4,5,6]]) &

[issue19078] Allow reversed(memoryview), like memoryview

2013-09-28 Thread Stefan Krah
Stefan Krah added the comment: Hmm, I meant: Number of items in the first dimension, thus 4 in Claudiu's example. -- ___ Python tracker <http://bugs.python.org/is

[issue19010] Make XMLPullParser in ElementTree inherit from XMLParser

2013-09-28 Thread Stefan Behnel
Stefan Behnel added the comment: Any comment and/or reason? -- ___ Python tracker <http://bugs.python.org/issue19010> ___ ___ Python-bugs-list mailing list Unsub

[issue18902] Make ElementTree event handling more modular to allow custom targets for the non-blocking parser

2013-09-28 Thread Stefan Behnel
Stefan Behnel added the comment: Closing #18990 defines the API of the new XMLPullParser that 3.4 will ship with, so this ticket becomes an enhancement for future versions. -- type: behavior -> enhancement versions: -Python 3.4 ___ Python trac

[issue19108] Benchmark runner tries to execute external Python command and fails on error reporting

2013-09-28 Thread Stefan Behnel
Stefan Behnel added the comment: Well, it worked before, so the current state is clearly a regression. -- ___ Python tracker <http://bugs.python.org/issue19

[issue18902] Make ElementTree event handling more modular to allow custom targets for the non-blocking parser

2013-09-28 Thread Stefan Behnel
Stefan Behnel added the comment: Copying a relevant comment by Eli from http://bugs.python.org/issue18990#msg198145 and replying inline. """ The way the APIs are currently defined, XMLParser and XMLPullParser are different animals. XMLParser can be considered to only have one

[issue19010] Make XMLPullParser in ElementTree inherit from XMLParser

2013-09-29 Thread Stefan Behnel
Stefan Behnel added the comment: Given that the inheritance chain has no real user impact, I can live with this difference. -- ___ Python tracker <http://bugs.python.org/issue19

[issue18594] C accelerator for collections.Counter is slow

2013-09-30 Thread Stefan Behnel
Stefan Behnel added the comment: Patch LGTM and seems to work well, according to your numbers. Only minor nitpick would be that the method references could be decref-ed earlier, but that would complicate the code a bit. -- ___ Python tracker <h

[issue19108] Benchmark runner tries to execute external Python command and fails on error reporting

2013-10-01 Thread Stefan Behnel
Stefan Behnel added the comment: Antoine, I really don't like this attitude of adding code and then saying "well, it's there, I won't change it" when others complain about breakage. Please undo your change that broke the ability of using (non-trivial) wrapper script

[issue18594] C accelerator for collections.Counter is slow

2013-10-01 Thread Stefan Behnel
Stefan Behnel added the comment: Can you update the benchmark numbers to show what the difference is compared to pure Python (and to the fastpath) now? One more thing: the fastpath depends on .__getitem__() and friends, whereas the fallback path depends on .get(). What if someone overrides

[issue19108] Benchmark runner tries to execute external Python command and fails on error reporting

2013-10-01 Thread Stefan Behnel
Stefan Behnel added the comment: > I'm leaving you with this, if you're wanting to do anything about it Sorry, but weren't you just asking *me* to be constructive? I'm aware that getting this change right isn't trivial. But that doesn't mean we should happ

[issue19078] Allow reversed(memoryview), like memoryview

2013-10-02 Thread Stefan Krah
Stefan Krah added the comment: > Stefan, what do you think about Claudiu's patch? Should a test be added to > test_buffer as well? I think the patch is good. We can add more tests when (if?) multi-dimensional support is added to memoryview. In that case we should probably do the sa

[issue19001] test_gdb fails on Fedora buildbot

2013-10-02 Thread Stefan Krah
Stefan Krah added the comment: Well, I got tired of the OS gdb with an almost transcendental version number and installed gdb from gnu.org. The problem seems to have disappeared. -- ___ Python tracker <http://bugs.python.org/issue19

[issue19144] test_inspect: failure without threads

2013-10-02 Thread Stefan Krah
New submission from Stefan Krah: On the Fedora 16 buildbot: == ERROR: test_qualname_source (test.test_inspect.TestMain) -- Traceback (most recent call last

[issue19108] Benchmark runner tries to execute external Python command and fails on error reporting

2013-10-02 Thread Stefan Behnel
Stefan Behnel added the comment: What about this: by default, we assume all runtimes to have the same major version as the Python runtime that executes the benchmark runner. If that's not the case, users must override it explicitly with a command line option, say, "--pyversions

[issue19014] Allow memoryview.cast() for empty views

2013-10-03 Thread Stefan Krah
Stefan Krah added the comment: Ok, I think the main reason for disallowing zeros in view->shape here was that casts are undefined if also the "shape" argument is given: x = memoryview(b'') x.cast('d', shape=[1]) Now, this case *is* already caught at a late

[issue19108] Benchmark runner tries to execute external Python command and fails on error reporting

2013-10-03 Thread Stefan Behnel
Stefan Behnel added the comment: I'm having trouble understanding your last comment. Are you saing that you want the exact value to be a two digits version and therefore use separate arguments for both Pythons (e.g. "--basever 2.7 --cmpver 3.3"), or that you want it to a

[issue16195] Difficult or impossible to figure out how garbage collector and weak references should interact for user-defined extension types

2013-10-05 Thread Stefan Behnel
Stefan Behnel added the comment: Just as a quick update here: Cython has since then switched to only using PyObject_ClearWeakRefs() and otherwise leaves the handling of the weakref slot to CPython. -- ___ Python tracker <http://bugs.python.

[issue19232] Speed up _decimal import

2013-10-12 Thread Stefan Krah
New submission from Stefan Krah: As discussed on python-dev, importing _decimal at the bottom of decimal.py is about 9x slower than importing _decimal directly. -- assignee: skrah components: Extension Modules messages: 199553 nosy: skrah priority: normal severity: normal stage: needs

[issue19232] Speed up _decimal import

2013-10-12 Thread Stefan Krah
Changes by Stefan Krah : -- keywords: +patch Added file: http://bugs.python.org/file32060/issue19232.diff ___ Python tracker <http://bugs.python.org/issue19

[issue19232] Speed up _decimal import

2013-10-12 Thread Stefan Krah
Stefan Krah added the comment: Right, let's start collecting objections. :) Mark, Raymond: Would you support the change (__name__ hack and all)? Maciej: Is this approach a problem for PyPy? -- nosy: +fijall, mark.dickinson, rhettinger ___ P

[issue19232] Speed up _decimal import

2013-10-12 Thread Stefan Krah
Changes by Stefan Krah : -- stage: needs patch -> patch review ___ Python tracker <http://bugs.python.org/issue19232> ___ ___ Python-bugs-list mailing list Un

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-12 Thread Stefan Krah
Stefan Krah added the comment: Using the microbenchmark I get (standard version): ./python -m timeit "import sys; modname='operator'" "__import__(modname); del sys.modules[modname]" 1000 loops, best of 3: 460 usec per loop Victor's version: ./python -m ti

[issue19232] Speed up _decimal import

2013-10-12 Thread Stefan Krah
Stefan Krah added the comment: I guess if some of the pickling stuff get's rewritten, we can drop __name__. The other thing is that traditionally the types were "decimal.Decimal" etc., so I'm not sure if it is good idea to have "_decimal.Decimal" and "_py

[issue19232] Speed up _decimal import

2013-10-12 Thread Stefan Krah
Stefan Krah added the comment: _decimal already lies about its name (for pickling). -- ___ Python tracker <http://bugs.python.org/issue19232> ___ ___ Python-bug

[issue19108] Benchmark runner tries to execute external Python command and fails on error reporting

2013-10-12 Thread Stefan Behnel
Stefan Behnel added the comment: Here's a patch that replaces the current simplistic Python executable command config with a dedicated PythonRuntime config class. That makes it easy to properly pass around the program specific configuration. Part of that is the Python executable path

[issue19232] Speed up _decimal import

2013-10-12 Thread Stefan Krah
Stefan Krah added the comment: I can't apply the patch that was created with diff --git, so here is another one that is less readable but applies. -- Added file: http://bugs.python.org/file32066/issue19232-2.patch ___ Python tracker

[issue19236] Add Tornado HTTP benchmark

2013-10-12 Thread Stefan Behnel
Changes by Stefan Behnel : -- components: +Benchmarks nosy: +scoder ___ Python tracker <http://bugs.python.org/issue19236> ___ ___ Python-bugs-list mailin

[issue19236] Add Tornado HTTP benchmark

2013-10-12 Thread Stefan Behnel
Stefan Behnel added the comment: +1. Does it give reasonably predictable timings? -- ___ Python tracker <http://bugs.python.org/issue19236> ___ ___ Python-bug

[issue19236] Add Tornado HTTP benchmark

2013-10-13 Thread Stefan Behnel
Stefan Behnel added the comment: Another thing: you are only using one thread for both the client and the server, and the app writes the entire content in one go (during one call to get()). Wouldn't it be more interesting to make the app's get() method asynchronous as well, so that

[issue19232] Speed up _decimal import

2013-10-13 Thread Stefan Krah
Stefan Krah added the comment: Antoine Pitrou wrote: > You can apply it using "hg import --no-commit", I think. mercurial 2.1 throws an exception even though the patch was created with that version. Now I upgraded to 2.7.2 and it works. Rietveld also seems to choke on the fi

[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError

2013-10-13 Thread Stefan Krah
Stefan Krah added the comment: To be fair, for the startup time I can't really detect any difference between importing _operator directly and the current setup. -- ___ Python tracker <http://bugs.python.org/is

[issue19232] Speed up _decimal import

2013-10-14 Thread Stefan Krah
Stefan Krah added the comment: About IDLE I can't say anything, but I'm not entirely sure if the PEP-399 import method is easier to understand for users, see e.g.: http://stackoverflow.com/questions/13194384/instantiate-decimal-class I get the impression that the posters at first di

[issue19254] Python implementation of PBKDF2_HMAC

2013-10-14 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: +skrah ___ Python tracker <http://bugs.python.org/issue19254> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19079] chameleon benchmark fails on 3.4

2013-10-14 Thread Stefan Behnel
Stefan Behnel added the comment: This commit conflicts with the patch for issue #19108 and breaks benchmarking in Py3 (at least for me). Traceback (most recent call last): File "perf.py", line 2538, in main(sys.argv[1:]) File "perf.py", line 2481, in main

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Stefan Krah
Stefan Krah added the comment: trap() is a bit ambiguous, since in floating point operations it means that something is actually raised and not suppressed. So one could write: from decimal import * c = getcontext() c.traps[Inexact] = True >>> Decimal(9) / 11 # raises now! with tra

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Stefan Krah
Stefan Krah added the comment: Zero Piraeus wrote: > 'Ignore' and 'suppress' are not synonyms: I wrote "synonyms here", meaning that in *this context* they are practically synonyms. "suppress" describes the mechanics more pr

[issue16129] No good way to set 'PYTHONIOENCODING' when embedding python.

2013-10-17 Thread Stefan Krah
Stefan Krah added the comment: Unfortunately the tests pass when I run them manually. On my FreeBSD bot thsi may be relevant: o LC_* is "C". o The filesystem encoding is ascii. -- nosy: +skrah ___ Python tracker <http://bu

[issue15237] Add capsule API to _decimal

2013-10-17 Thread Stefan Krah
Stefan Krah added the comment: I've looked at this, and the question is: Do we really need a capsule API? All relevant symbols in _decimal start with Py* and shouldn't need to be static. -- ___ Python tracker <http://bugs.python.o

<    28   29   30   31   32   33   34   35   36   37   >