[issue24622] tokenize.py: missing EXACT_TOKEN_TYPES

2018-06-08 Thread Stefan Krah
Stefan Krah added the comment: I agree, it would be strange to backport now. -- stage: backport needed -> versions: +Python 3.7 -Python 3.6 ___ Python tracker <https://bugs.python.org/issu

[issue33815] List a = []*19 doesn't create a list with index length of 19

2018-06-09 Thread Stefan Behnel
Stefan Behnel added the comment: You misunderstood what the code is doing, and the response that you got indicates that the bug tracker is not the right place to discuss this misunderstanding. If you want to discuss this further, please ask on the Python mailing list (python-l...@python.org

[issue33844] Writing capital letters with csvwriter.writerow changes the csv file format

2018-06-12 Thread Stefan Vasilev
New submission from Stefan Vasilev : import csv csv.writer(open('./file.csv', 'a', newline='')).writerow(['ID', 0]) If you try to open file.csv with Excel on Windows 10 it says: The file format and extension of 'file.csv' don't match. T

[issue33844] Writing capital letters with csvwriter.writerow changes the csv file format

2018-06-13 Thread Stefan Vasilev
Stefan Vasilev added the comment: Ah, I see now. What a coincidence :) Thank you for explaining that! -- resolution: not a bug -> works for me ___ Python tracker <https://bugs.python.org/issu

[issue34068] Assertion failure in _PyType_Lookup

2018-07-08 Thread Stefan Behnel
Stefan Behnel added the comment: I added this assertion exactly for the purpose of finding this kind of bug. It means that some code tried to look up an attribute with a live exception set, which previously could swallow the exception in certain situations, and even if not, it is always the

[issue34151] use malloc() for better performance of some list operations

2018-07-18 Thread Stefan Behnel
Stefan Behnel added the comment: Nice! Patch looks good to me, minus the usual naming nit-pick. -- nosy: +scoder versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue34

[issue34160] ElementTree not preserving attribute order

2018-07-20 Thread Stefan Behnel
Stefan Behnel added the comment: At least for lxml, attributes were never specified to have a sorted order (although attribute dicts are sorted on *input*, to give a *predictable* order as in ET), and the tutorial says: "Attributes are just unordered name-value pairs". Howeve

[issue34179] test_statistics fails after test_time

2018-07-21 Thread Stefan Krah
Stefan Krah added the comment: New changeset 938045f335b52ddb47076e9fbe4229a33b4bd9be by Stefan Krah (Bo Bayles) in branch 'master': bpo-34179: Make sure decimal context doesn't affect other tests. (#8376) https://github.com/python/cpython/commit/938045f335b52ddb47076e9fb

[issue34179] test_statistics fails after test_time

2018-07-21 Thread Stefan Krah
Stefan Krah added the comment: New changeset 92ce6a64afcebd414def3b80b18b56448792a587 by Stefan Krah (Miss Islington (bot)) in branch '3.7': bpo-34179: Make sure decimal context doesn't affect other tests. (GH-8376) (#8383) https://github.com/python

[issue34179] test_statistics fails after test_time

2018-07-21 Thread Stefan Krah
Stefan Krah added the comment: New changeset 9c136700aa1f755fa2ea64594688a0930b716597 by Stefan Krah (Miss Islington (bot)) in branch '3.6': bpo-34179: Make sure decimal context doesn't affect other tests. (GH-8376) (#8384) https://github.com/python

[issue34179] test_statistics fails after test_time

2018-07-21 Thread Stefan Krah
Stefan Krah added the comment: Ok, looks fixed to me. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-07-28 Thread Stefan Behnel
Stefan Behnel added the comment: >> Commutativity guarantees can be delivered by sorting arguments before >> summation. > No thanks -- that's too expensive for such a small payoff. Since I don't really see people use this on vectors with hundreds of dimensions, l

[issue34280] METH_NOARGS: no longer require that second arg is NULL

2018-07-30 Thread Stefan Behnel
Stefan Behnel added the comment: Agree with Raymond. If the goal is to pass something else, then functions that want to make use of that "something else" have to be modified anyway, in which case also changing the call type wouldn't hurt (assuming the new value still fit

[issue34309] Embedding Python; Py_Initialize / Py_Finalize cycles

2018-08-01 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue34309> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34309] Trouble when reloading extension modules.

2018-08-02 Thread Stefan Behnel
Stefan Behnel added the comment: a) Probably not something to fix in released versions any more, so increasing version from 3.5 to 3.8. b) Regarding shared library unloading and the problems mentioned, I'm also not sure if there is a way to safely unload transitively imported libraries

[issue34329] Document how to remove a suffix with pathlib.Path.with_suffix

2018-08-03 Thread Stefan Otte
New submission from Stefan Otte : Hello folks! I didn't realize that you can remove a suffix with the `with_suffix` function of the `Path` class of `pathlib` and I always used a little utility function that I wrote. I wanted to add that functionality (removing of a suffix) and submit

[issue34329] Document how to remove a suffix with pathlib.Path.with_suffix

2018-08-03 Thread Stefan Otte
Change by Stefan Otte : -- keywords: +patch pull_requests: +8150 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34329> ___ ___ Py

[issue34329] Document how to remove a suffix with pathlib.Path.with_suffix

2018-08-03 Thread Stefan Otte
Stefan Otte added the comment: I'm waiting for the CLA to be accepted. I'll get back to you ASAP. -- ___ Python tracker <https://bugs.python.o

[issue34329] Document how to remove a suffix with pathlib.Path.with_suffix

2018-08-03 Thread Stefan Otte
Stefan Otte added the comment: No problem, I'm just excited to contribute to python (as small as the contribution might be) :) -- ___ Python tracker <https://bugs.python.org/is

[issue33731] string formatting that produces floats with preset precision while respecting locale

2018-08-04 Thread Stefan Krah
Change by Stefan Krah : -- nosy: +skrah ___ Python tracker <https://bugs.python.org/issue33731> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32797] Tracebacks from Cython modules no longer work

2018-08-04 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, I can see that Cython is a special case because it can control the source line mapping and reporting through the C-API. Other code generators might not be able to do that, e.g. for a DSL or template language that gets translated to Python code, for

[issue32797] Tracebacks from Cython modules no longer work

2018-08-05 Thread Stefan Behnel
Stefan Behnel added the comment: > SageMath is the only project that I know which actually installs .pyx sources. Ah, right. I wrongly remembered that they are automatically included in binary packages, but that only applies to .py source of Cython compiled Python modules (which

[issue32797] Tracebacks from Cython modules no longer work

2018-08-06 Thread Stefan Behnel
Stefan Behnel added the comment: Or, define a new "get_sourcemap()" method that could return additional metadata, e.g. a line number mapping. -- ___ Python tracker <https://bugs.python.o

[issue34376] Improve accuracy of math.hypot() and math.dist()

2018-08-12 Thread Stefan Behnel
Stefan Behnel added the comment: Could we maybe make an educated guess based on absmin and absmax whether scaling is needed or not? -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue34

[issue24076] sum() several times slower on Python 3 64-bit

2018-08-12 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, a PGO build of Py3.7 is now about 20% *faster* here than my Ubuntu 16/04 system Python 2.7, and for some (probably unrelated) reason, the system Python 3.5 is another 2% faster on my side. IMHO, the only other thing that seems obvious to try would be

[issue14886] json C vs pure-python implementation difference

2018-08-17 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, the C implementation of the sequence encoder uses PySequence_Fast(), so adding a lower priority instance check that calls the same encoding function would solve this. https://github.com/python/cpython/blob/cfa797c0681b7fef47cf93955fd06b54ddd09a7f

[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2018-08-17 Thread Stefan Behnel
Stefan Behnel added the comment: > Serialization of ElementTree in the stdlib is much slower than in lxml (see > issue25881). Perhaps it should be implemented in C. But it should be kept > simple for this. Should I say it? That's a first class use case for Cython. > Prett

[issue34445] asyncio support in doctests

2018-08-20 Thread Stefan Tjarks
New submission from Stefan Tjarks : When writing a docstring for an async function I wrote a doctest for it. ``` async def hello_world(): """ Will great the world with a friendly hello. >>> await hello_world() "hello world" "&qu

[issue33187] Document ElementInclude (XInclude) support in ElementTree

2018-08-23 Thread Stefan Behnel
Change by Stefan Behnel : -- versions: +Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue33187> ___ ___ Python-bug

[issue27195] Crash when RawIOBase.write(b) evaluates b.format

2018-08-23 Thread Stefan Krah
Stefan Krah added the comment: PyBUF_RECORDS pulls in PyBUF_STRIDES, which should IMO not be done in a stable release. Maybe (PyBUF_CONTIG_RO|PyBUF_FORMAT), but I'm uneasy even about that. The potential for breakage is huge. -- ___ P

[issue34461] Availability of parsers in etree initializer

2018-08-24 Thread Stefan Behnel
Stefan Behnel added the comment: The normal way to use ElementTree is to import the ElementTree module from the xml.etree package. Why do you think that needs to change? And why do you want to enforce an import of all modules before you even know which of them the users actually wants

[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-08-25 Thread Stefan Behnel
Stefan Behnel added the comment: I think the best work-around for now is to implement a bit of PEP 489, including a module create function that always returns the same static module reference instead of creating a new one after the first call, and a module exec function that simply returns

[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-08-25 Thread Stefan Behnel
Stefan Behnel added the comment: Well, first of all, it's better than a crash. :) Secondly, I'm sure NumPy doesn't currently support subinterpreters, just like most other extension modules. If I'm not mistaken, an interpreter switch can be detected through the interpre

[issue32973] Importing the same extension module under multiple names breaks non-reinitialisable extension modules

2018-08-25 Thread Stefan Behnel
Stefan Behnel added the comment: FYI, I've updated Cython's module import checks to include an interpreter check. This (multi-file) test shows the new behaviour, which is to raise an ImportError on module creation when it detects a different interpreter than during the init

[issue34445] asyncio support in doctests

2018-08-30 Thread Stefan Tjarks
Stefan Tjarks added the comment: Thanks Grant! I expected that I am missing something. You are right that I could have posted in many places to get help about this. Before posting I tried to find a doctest for asyncio but my google magic failed me. At the end I just felt that, at the very

[issue34570] Segmentation fault in _PyType_Lookup

2018-09-03 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for the report. Is the place where it crashes always the same? Could it be that your system is running out of resources, e.g. RAM? -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue34

[issue26208] decimal C module's exceptions don't match the Python version

2018-09-06 Thread Stefan Krah
Stefan Krah added the comment: The thing is that Python explicitly supports any object as the "message". I was quite pleased when I discovered that because it provides a way to include both signals and the condition list in the "message", which can be used in programs fo

[issue26208] decimal C module's exceptions don't match the Python version

2018-09-06 Thread Stefan Krah
Stefan Krah added the comment: pypy3 actually took over the terse exceptions, but without the conditions. They'd also need error codes from libmpdec now. >>>> huge = Decimal('9' * 99) >>>> huge.quantize(Decimal('0.1')) Traceback (most recent

[issue34605] Avoid master/slave terminology

2018-09-07 Thread Stefan Krah
Stefan Krah added the comment: I'm using "master" in memoryview because of the audio connotation ("the source from which all copies will be produced"): https://en.wikipedia.org/wiki/Audio_mastering The ManagedBufferObject is literally the source from whic

[issue34600] python3 regression ElementTree.iterparse() unable to capture comments

2018-09-08 Thread Stefan Behnel
Stefan Behnel added the comment: There are dedicated handler methods that you can implement: "def comment(self, comment)" and "def pi(self, target, data)". Both (c)ElementTree and lxml support those. I think the "target" argument to the parser is a bit unde

[issue34605] Avoid master/slave terminology

2018-09-08 Thread Stefan Krah
Change by Stefan Krah : -- nosy: -skrah ___ Python tracker <https://bugs.python.org/issue34605> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34605] Avoid master/slave terminology

2018-09-08 Thread Stefan Krah
Stefan Krah added the comment: I commented here to explain the master <-> view terminology of memoryview. If anyone wants to change that, please open a separate issue and add me as the author to the nosy list. -- ___ Python tracker

[issue34605] Avoid master/slave terminology

2018-09-08 Thread Stefan Krah
Stefan Krah added the comment: Trying to remove myself from the nosy list again (I know that the interface sometimes surprisingly adds/removes persons). -- ___ Python tracker <https://bugs.python.org/issue34

[issue34605] Avoid master/slave terminology

2018-09-08 Thread Stefan Krah
Change by Stefan Krah : -- nosy: -skrah ___ Python tracker <https://bugs.python.org/issue34605> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34600] python3 regression ElementTree.iterparse() unable to capture comments

2018-09-11 Thread Stefan Behnel
Stefan Behnel added the comment: lxml supports "comment" and "pi" as event types in iterparse (or, more specifically, in the XMLPullParser). If someone wants to implement this for (c)ElementTree, I'd be happy to review the PR. https://lxml.de/api/lxml.etree

[issue34739] Get rid of tp_getattro in xml.etree.ElementTree.XMLParser

2018-09-19 Thread Stefan Behnel
Stefan Behnel added the comment: Nice. Looks good to me. -- ___ Python tracker <https://bugs.python.org/issue34739> ___ ___ Python-bugs-list mailing list Unsub

[issue34762] Change contextvars C API to use PyObject

2018-09-21 Thread Stefan Behnel
Stefan Behnel added the comment: > because Py_buffer isn't a PyObject at all :) It owns a PyObject reference to the buffer owner, though. -- nosy: +scoder ___ Python tracker <https://bugs.python.org

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-09-24 Thread Stefan Krah
Change by Stefan Krah : -- nosy: +skrah ___ Python tracker <https://bugs.python.org/issue34778> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34776] Postponed annotations break inspection of dataclasses

2018-09-27 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue34776> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34905] Cannot assign memoryview values from array.array

2018-10-06 Thread Stefan Krah
Stefan Krah added the comment: >>> mview.format 'B' >>> mview[:] = array.array('B', b'hello') Bytes have format 'B', so this works as expected. -- assignee: -> skrah nosy: +skrah resolut

[issue34957] Segementation faults on ARM and ARM64

2018-10-11 Thread Stefan Rink
New submission from Stefan Rink : When trying to run dask distributed on ARM you will end with a segmentation fault on multiple in multiple tests; Works on AMD64 but does not work on ARM or AARCH64 and results in a Signal 11. Example; # python Python 3.6.6 (default, Sep 29 2018, 05:50:41

[issue34957] Segementation faults on ARM and ARM64

2018-10-11 Thread Stefan Rink
Stefan Rink added the comment: * (re)installed libffi but it was already version 3.2.1. * Currently compiling python3.7 on both ARM and AARCH64 to test them. This may take a while because I need to install dask again for 3.7 to test.. Didn't try this on Linux ARM yet so I'll als

[issue34957] Segementation faults on ARM and ARM64

2018-10-11 Thread Stefan Rink
Stefan Rink added the comment: On ARM32 it still crashed but on the ARM64 upgrade to 3.7 helped! Need to do some more testing but it looks like it's working now. # python3.7 Python 3.7.0 (default, Sep 29 2018, 05:58:20) [Clang 6.0.1 (tags/RELEASE_601/final 335540)] on freebsd12 Type

[issue34957] Segementation faults on ARM and ARM64

2018-10-11 Thread Stefan Rink
Stefan Rink added the comment: Upgrade to 3.7 fixed the main problem for me, or at least on the hardware/arch I use. -- On ARM32 it still failed but I don't have debugging symbols there so not so easy to troubleshoot further -- -- resolution: -> work

[issue34912] Update overflow checks in resize_buffer

2018-10-14 Thread Stefan Behnel
Stefan Behnel added the comment: If I understand the code right, "PY_SSIZE_T_MAX/sizeof(Py_UCS4)" would not be correct since it would unnecessarily limit the length of ASCII-only unicode strings. I think the initial check avoids the risk of integer overflow in the calculations

[issue35013] Add more type checks for children of xml.etree.ElementTree.Element

2018-10-19 Thread Stefan Behnel
Stefan Behnel added the comment: Well, if that's what it takes, then that's what it takes. I'm fine with the change. The (unaccelerated) ET doesn't strictly require it, but a) I can't really see a use case for non-Element classes in the tree, b) pretty much no

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Stefan Behnel
New submission from Stefan Behnel : I see reports from Cython users on Windows-64 that extension modules that use "longintrepr.h" get miscompiled by MinGW. A failing setup looks as follows: Stock 64 bit CPython on Windows, e.g. Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Stefan Behnel
Stefan Behnel added the comment: Some more information. CPython uses this code snippet to decide on the PyLong digit size: #ifndef PYLONG_BITS_IN_DIGIT #if SIZEOF_VOID_P >= 8 #define PYLONG_BITS_IN_DIGIT 30 #else #define PYLONG_BITS_IN_DIGIT 15 #endif #endif In MinGW, "SIZEOF_VOID

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Stefan Behnel
Stefan Behnel added the comment: > There's PyLong_GetInfo ... Thanks, I understand that this information can be found at runtime. However, in order to correctly compile C code against a given CPython runtime, there needs to be a guarantee that extension module builds use

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-23 Thread Stefan Behnel
Stefan Behnel added the comment: The relevant macro seems to be "__MINGW64__". I have neither a Windows environment nor MinGW-64 for testing, but the logic should be the same as for the "_WIN64" macro, i.e. #if defined(_WIN64) || defined(__MINGW64__) #define MS_WI

[issue35207] Disallow expressions like (a) = 42

2018-11-12 Thread Stefan Krah
Stefan Krah added the comment: I just want to add one more voice for allowing the status quo: C, OCaml, SML, Haskell allow the assignment, Ruby disallows it. The ML family must allow it, since "let (x) = 10" is pattern matching under the hood, and (10) = 10. In C (gcc, clang a

[issue34160] ElementTree not preserving attribute order

2018-11-16 Thread Stefan Behnel
Stefan Behnel added the comment: > Maybe some people prefer sorting to get a more deterministic output Note that those people are much better off with C14N. It is the one tool designed for all of these use cases, even usable for cryptographic signatures. And it's trivial to use, it&

[issue35081] Move internal headers to Include/internal/

2018-11-18 Thread Stefan Behnel
Stefan Behnel added the comment: Making _PyGC_FINALIZED() internal broke Cython (https://github.com/cython/cython/issues/2721). It's used in the finaliser implementation (https://github.com/cython/cython/blob/da657c8e326a419cde8ae6ea91be9661b9622504/Cython/Compiler/ModuleNode.py#L1442-

[issue18062] m68k FPU precision issue

2013-05-25 Thread Stefan Krah
Stefan Krah added the comment: > We do not want to change it to 64-bit because it’s not supported in all > environments. Does this also apply to changing the precision temporarily? Because that is what happens for other platforms, see Include/pyport.h: HAVE_PY_SET_53BIT_PRE

[issue18062] m68k FPU precision issue

2013-05-25 Thread Stefan Krah
Stefan Krah added the comment: I forgot to comment on this: > fixing this in general would allow keeping the FPUCW on i387 unchanged too. Actually dtoa.c (which is used on i387) explicitly requires to change the control word. Looking at the test results, it seems to me that a couple of te

[issue17768] _decimal: allow NUL fill character

2013-05-29 Thread Stefan Krah
Stefan Krah added the comment: Here's a baroque patch for _decimal. It's complicated by the fact that there's no way of knowing what kind of UTF-8 fragments might be hidden in multi-byte separators or decimal points. -- Added file: http://bugs.python.org/file30407/

[issue17768] _decimal: allow NUL fill character

2013-05-29 Thread Stefan Krah
Changes by Stefan Krah : -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue17768> ___ ___ Python-bugs-list

[issue18093] Move main functions to a separate Programs directory

2013-05-29 Thread Stefan Drees
Changes by Stefan Drees : -- nosy: +dilettant ___ Python tracker <http://bugs.python.org/issue18093> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17247] int and float should detect inconsistent format strings

2013-05-29 Thread Stefan Krah
Stefan Krah added the comment: With this patch float and int should behave like Decimal. It may break existing code that (accidentally) uses both legacy zero padding and explicit alignment. -- keywords: +patch stage: needs patch -> patch review versions: -Python 3.3 Added file: h

[issue17269] getaddrinfo segfaults on OS X when provided with invalid arguments combinations

2013-05-29 Thread Stefan Krah
Stefan Krah added the comment: Hi, I think this broke the tiger buildbot: http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/6368/steps/test/logs/stdio -- nosy: +skrah ___ Python tracker <http://bugs.python.org/issue17

[issue18090] dict_contains first argument declared register, and shouldn't be

2013-05-30 Thread Stefan Krah
Stefan Krah added the comment: +1 for removing all occurrences of "register". Regarding the grammar, we have: function-definition: declaration-specifiers-opt declarator declaration-list-opt compound-statement So I think that "part of an external declaration" ref

[issue18111] Add a default argument to min & max

2013-06-02 Thread Stefan Krah
Stefan Krah added the comment: I'd use foldl() in functional languages, where the default is part of foldl() and not of max(). Translated to Python, I'm thinking of: it = iter([328, 28, 2989, 22]) functools.reduce(max, it, next(it, None)) 2989 I agree with Raymond that a default

[issue17810] Implement PEP 3154 (pickle protocol 4)

2013-06-03 Thread Stefan Mihaila
Stefan Mihaila added the comment: On 6/3/2013 9:33 PM, Alexandre Vassalotti wrote: > Alexandre Vassalotti added the comment: > > Stefan, could you address my review comments soon? The improved support for > globals is the only big piece missing from the implementation of PEP, whic

[issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux

2013-06-08 Thread Stefan Krah
Stefan Krah added the comment: The docs say: "Native size and alignment are determined using the C compiler’s sizeof expression. This is always combined with native byte order." sizeof(long) is 8 on your platform, so I don't see anything wrong here. Or is another part of th

[issue17941] namedtuple should support fully qualified name for more portable pickling

2013-06-09 Thread Stefan Drees
Changes by Stefan Drees : -- nosy: +dilettant ___ Python tracker <http://bugs.python.org/issue17941> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14813] Can't build under VS2008 anymore

2013-06-14 Thread Stefan Krah
Stefan Krah added the comment: Building the external packages isn't fixed yet, but I don't know if it's worth the trouble. -- ___ Python tracker <http://bugs.pyt

[issue10744] ctypes arrays have incorrect buffer information (PEP-3118)

2013-06-21 Thread Stefan Krah
Stefan Krah added the comment: Basically someone has to review the patch and commit it. I'm not really using ctypes, so for me a decent review would take a while. -- ___ Python tracker <http://bugs.python.org/is

[issue18340] float related test has problem with Denormal Flush to Zero compiler options

2013-07-01 Thread Stefan Krah
Stefan Krah added the comment: With gcc I cannot reproduce this either. For icc perhaps we should just set "-fp-model strict" in ./configure. -- nosy: +skrah ___ Python tracker <http://bugs.python.o

[issue18408] Fixes crashes found by pyfailmalloc

2013-07-18 Thread Stefan Behnel
Stefan Behnel added the comment: This test from lxml's ElementTree test suite crashes for me now when run against (c)ElementTree: def test_parser_target_error_in_start(self): assertEqual = self.assertEqual events = [] class Target(object): def

[issue18408] Fixes crashes found by pyfailmalloc

2013-07-19 Thread Stefan Behnel
Stefan Behnel added the comment: @Victor: yes, the Cython project has CI tests running against debug builds of all CPython branches since 2.4, updated daily. lxml is part of an extended set of tests for Cython, and the test suite of lxml includes several compatibility tests for ElementTree

[issue18408] Fixes crashes found by pyfailmalloc

2013-07-19 Thread Stefan Behnel
Changes by Stefan Behnel : -- nosy: -scoder ___ Python tracker <http://bugs.python.org/issue18408> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18594] C accelerator for collections.Counter is slow

2013-07-29 Thread Stefan Behnel
New submission from Stefan Behnel: The C accelerator for the collections.Counter class (_count_elements() in _collections.c) is slower than the pure Python versions for data that has many unique entries. This is because the fast path for dicts is not taken (Counter is a subtype of dict) and

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: Here is a patch that cleans up the current implementation to avoid making the result of iterparse() an IncrementalParser (with all of its new API). Please note that the tulip mailing list is not an appropriate place to discuss additions to the XML libraries

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Changes by Stefan Behnel : -- components: +XML ___ Python tracker <http://bugs.python.org/issue17741> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: Copying the discussion between Antoine and me from python-dev: >> IMO it should mimic the interface of the TreeBuilder, which >> calls the data reception method "feed()" and the termination method >> "close()". There

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: Actually, let me take that last paragraph back. There is an Obvious Way to do it, and that's the feed() and close() methods. They are the existing and established ElementTree interface for incremental parsing. The fact that close() doesn't clean up

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Changes by Stefan Behnel : Added file: http://bugs.python.org/file31206/iterparse_api_cleanup.patch ___ Python tracker <http://bugs.python.org/issue17741> ___ ___ Pytho

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: Thinking about the original patch some more - I wonder why it doesn't use a wrapper for TreeBuilder to process the events. Antoine, is there a reason why you had to add this _setevents() method to the XMLParser, instead of making the IncrementalPars

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: Oh, and could we reopen this ticket, please? -- ___ Python tracker <http://bugs.python.org/issue17741> ___ ___ Python-bugs-list m

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: > The point is not to build a tree of potentially unbounded size (think > XMPP). The point is to yield events in a non-blocking way (iterparse() > is blocking, which makes it useless for non-blocking applications). Ok, but that's the only differen

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: > About the patch: I think changing the API names now that alpha1 has been > released is a bit gratuitous. Sorry for being late, but I can't see it being my fault. A change in an alpha release is still way better than a change after a final release.

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: > But worse than no change at all. Arguing about API naming is a bit > futile, *especially* when the ship has sailed. It's easy to say that as a core developer with commit rights who can simply hide changes in a low frequented bug tracker withou

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: But IncrementalParser uses an XMLParser internally, which in turn uses a TreeBuilder internally. So what exactly is your point? -- ___ Python tracker <http://bugs.python.org/issue17

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: > Well, I would rather like to understand yours. My point is that the IncrementalParser uses a TreeBuilder that builds an XML tree in the back. So I'm wondering why you are saying that it doesn't build a tree. > Whatever IncrementalParser

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: > TreeBuilder doesn't do parsing, it takes already parsed data: it has a > start() method to open a tag, and a data() method to add raw text > inside that tag. That is correct. However, the XMLParser has a feed() method that sends new data into t

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: > Unless I'm reading it wrong, when _setevents() is called, the internal > hooks are rewired to populate the events list, rather than call the > corresponding TreeBuilder methods. So, yes, there's a TreeBuilder > somewhere, but it stands

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: > ask to be added to the experts list for ET Already done, see the corresponding python-dev thread. > Now back to a productive discussion please... I think we already are. Keep reading through the rest of the

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: Ok, finally. ;) Can we agree on discarding the current implementation for now and then rewriting it based on a tree builder instead of a parser wrapper? "Because we'd need to change internal code" is not a good argument for adding a

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: What about this idea: instead of changing the internal C implementation, we could provide a simple parser target wrapper class (say, "EventBuilder") that the parser would simply recognise with isinstance(). Then it would unpack the wrapped target and

[issue17741] event-driven XML parser

2013-08-09 Thread Stefan Behnel
Stefan Behnel added the comment: > I agree, but this assumes there is a "better API". I would like to see > an API proposal and a patch before I give an opinion :-) Well, I have already proposed an API throughout this thread, and then given a usage example and an almost comple

<    18   19   20   21   22   23   24   25   26   27   >