[issue11258] ctypes: Speed up find_library() on Linux by 500%

2011-02-20 Thread Jonas H.
New submission from Jonas H. jo...@lophus.org: (This applies to all versions of Python I investigated, although the attached patch is for Python 2.7) I wondered why `import uuid` took so long, so I did some profiling. It turns out that `find_library` wastes at lot of time because

[issue11258] ctypes: Speed up find_library() on Linux by 500%

2011-02-20 Thread Jonas H.
Changes by Jonas H. jo...@lophus.org: Added file: http://bugs.python.org/file20809/faster-find-library2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11258

[issue11258] ctypes: Speed up find_library() on Linux by 500%

2011-02-20 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: (might also be related to http://bugs.python.org/issue11063) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11258

[issue11258] ctypes: Speed up find_library() on Linux by 500%

2011-02-24 Thread Jonas H.
Changes by Jonas H. jo...@lophus.org: Added file: http://bugs.python.org/file20874/faster-find-library1-py3k-with-escaped-name.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11258

[issue11258] ctypes: Speed up find_library() on Linux by 500%

2011-02-24 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: As far as I can tell, it doesn't matter. We're looking for the part after the = in any case - ignoring the ABI/architecture information - so the regex would chose the first of those entries

[issue11258] ctypes: Speed up find_library() on Linux by 500%

2011-02-27 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Humm. Would be great to have the `ldconfig -p` output of such a machine... I can't get ldconfig to recognize 64-bit libraries on my 32-bit machines, so I have no output to test against... -- ___ Python

[issue11345] Fix a link in library/json docs

2011-02-27 Thread Jonas H.
New submission from Jonas H. jo...@lophus.org: I guess this should be a link. -- assignee: docs@python components: Documentation files: fix-json-link.diff keywords: patch messages: 129629 nosy: docs@python, jonash priority: normal severity: normal status: open title: Fix a link

[issue11258] ctypes: Speed up find_library() on Linux by 500%

2011-02-27 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: the orig impl matches the abi_type at the beginning of the parentheses, yours simply ignores the abi_type (that should have caught my eye, but that regex looked so much like magic that I didn't try to make sense of it :-)) Same here

[issue4600] __class__ assignment: new-style? heap? == confusing

2011-02-27 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Here comes a patch, changing the behaviour to: ./python -q class C: ... pass ... (1).__class__ = 1 Traceback (most recent call last): File stdin, line 1, in module TypeError: __class__ must be set to a class defined by a class statement

[issue1731717] race condition in subprocess module

2010-09-06 Thread Jonas H.
Changes by Jonas H. jo...@lophus.org: -- nosy: +jonash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1731717 ___ ___ Python-bugs-list mailing list

[issue11484] `with_traceback` in 2.7 docs but not implemented

2011-03-13 Thread Jonas H.
New submission from Jonas H. jo...@lophus.org: Either a `BaseException.with_traceback` implementation is missing or the docs are wrong. http://docs.python.org/library/exceptions.html?highlight=with_traceback#exceptions.BaseException.with_traceback python3 -c 'print(with_traceback in dir

[issue11258] ctypes: Speed up find_library() on Linux by 500%

2011-04-19 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: *push* Any way to get this into the codebase? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11258

[issue11975] Fix intersphinx-ing of built-in types (list, int, ...)

2011-05-01 Thread Jonas H.
New submission from Jonas H. jo...@lophus.org: Intersphinx-ing of int, list, float, ... should work with :class:`int` (list, float, ...). Also, intersphinx-ing list methods, e.g. :meth:`list.insert`, should work. -- assignee: docs@python components: Documentation messages: 134923 nosy

[issue11976] Provide proper documentation for list data type

2011-05-01 Thread Jonas H.
New submission from Jonas H. jo...@lophus.org: Provide a proper `list` method reference (like the one for `dict`, http://docs.python.org/library/stdtypes.html#dict). Right now, documentation about lists is spread over multiple topics (.rst files) and methods are documented in footnotes. Also

[issue11977] Document int.conjugate, .denominator, ...

2011-05-01 Thread Jonas H.
New submission from Jonas H. jo...@lophus.org: Various `int` attributes and methods seem undocumented (at least it does not work to intersphinx them): * .conjugate * .denominator * .imag * .numerator * .real -- assignee: docs@python components: Documentation messages: 134926 nosy

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-02 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Actually I need to be able to intersphinx (because my documentation work is not the Python docs :-) but I guess it boils down to the same problem of incomplete Sphinx module/class indices. -- ___ Python

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-02 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Indeed they do; but documentation writers need to know that `int()` and `float()` are functions, which is counterintuitive. (and a CPython implementation detail) -- ___ Python tracker rep

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-06 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Is this a problem in our markup or a bug in intersphinx? It's a markup problem -- those types are documented as functions, using the :func: role/`.. func::` directive. It's not only a markup mismatch but, strictly speaking, it's *wrong

[issue11977] Document int.conjugate, .denominator, ...

2011-05-06 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: It doesn't. Sphinx still can't make any links, which btw also means that it's impossible to reference those methods within the Python documentation. Also I want to point out that I find the information very hard to find as a human. The fact

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-06 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Shouldn't have used decent here, sorry. What I was trying to say is that there's no reference-like documentation for the list datatype (as for dict). There's more than enough quality documentation about lists but I think the way it's arranged can

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-28 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Does that look good to you? If it does, I'll go on using the script (http://paste.pocoo.org/show/396661/) on the 3.x docs. -- keywords: +patch Added file: http://bugs.python.org/file22164/p1.patch

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-29 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Linking a class using a function directive is counter-intuitive. That's why we need to make use of class directives rather than function directives here. -- ___ Python tracker rep...@bugs.python.org http

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-30 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: I'm not. My patch doesn't address the problem of unlinkable methods but wrong type declarations (read, wrong usage of .. function:: directives) for builtins like int, float, bool, list etc. Because the directives change, the roles used to link

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-30 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Could you make an effort to accept our word that using :class: instead of :func: would bring zero value to the indexing system nor to human readers? I'm already doing; but I don't see anyone having made a good point against my preference of using

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-30 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: What's wrong with the changes I propose with the patch, then? Sorry, I really don't get it, no matter how hard I try. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11975

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-30 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: when you mark up something with a mod, func, class or meth role, Sphinx will find the target without paying attention to its type. So changing :func: to :class: does not bring anything. From a quick test this seems to hold true for links within

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-05-30 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: So the intersphinx behavior is the correct one, but we can't change the other now because of compatibility. Could you be convinced to use that legacy behaviour for intersphinx, too? :-) -- ___ Python

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-06-01 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Jonas, I owe you an apology [...] Thanks Éric, I got a bit worried about getting on your nerves... Based on Ezio's idea: What happens if we have both a .. function:: foo and .. class:: foo -- where do :func:`foo` and :class:`foo` link

[issue11975] Fix referencing of built-in types (list, int, ...)

2011-06-07 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Having one page with two objects of the same name, e.g. .. function:: foo .. class:: foo renders to two entries with the same anchor name (#foo). The first entry gets a link-to-this-paragraph marker, the second one doesn't. Internal

[issue12284] argparse.ArgumentParser: usage example option

2011-06-08 Thread Jonas H.
New submission from Jonas H. jo...@lophus.org: I'd like to see an `examples` option added to argparse.ArgumentParser as found in many man pages. This could also be done using the `epilog` option, but that misses the %(proc)s replacement which makes usage examples like this Example usage

[issue12284] argparse.ArgumentParser: usage example option

2011-06-09 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Nope. I want an examples section, for example from `man git log`: EXAMPLES git log --no-merges Show the whole commit history, but skip any merges git log v2.6.12.. include/scsi drivers/scsi Show all commits since

[issue12877] Popen(...).stdout.seek(...) throws Illegal seek

2011-09-01 Thread Jonas H.
New submission from Jonas H. jo...@lophus.org: from subprocess import Popen, PIPE p = Popen(['ls'], stdout=PIPE) p.wait() p.stdout.seek(0) Traceback (most recent call last): File t.py, line 5, in module p.stdout.seek(0) IOError: [Errno 29] Illegal seek Python 2.7.2, Arch Linux x86-64

[issue12877] Popen(...).stdout.seek(...) throws Illegal seek

2011-09-01 Thread Jonas H.
Jonas H. jo...@lophus.org added the comment: Why does it have a 'seek' method then? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12877

[issue18179] SMTP.local_hostname is undocumented

2013-06-10 Thread Jonas H.
New submission from Jonas H.: The Sphinx docs don't contain any explanation for `local_hostname`. -- assignee: docs@python components: Documentation messages: 190898 nosy: docs@python, jonash priority: normal severity: normal status: open title: SMTP.local_hostname is undocumented

[issue19767] pathlib: iterfiles() and iterdirs()

2013-11-25 Thread Jonas H.
New submission from Jonas H.: From my personal experience, listing all real files and all subdirectories in a directory is a very common use case. Here's a patch that adds the `iterfiles()` and `iterdirs()` methods as a shortcut for `[f for f in p.iterdir() if f.is_dir/file

[issue24358] Should compression file-like objects provide .fileno(), misleading subprocess?

2016-05-13 Thread Jonas H.
Jonas H. added the comment: I just hit this too. I'd say remove the fileno() method from wrapper objects like GzipFile. I'm happy to submit a patch. -- nosy: +jonash ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-27 Thread Jonas H.
Jonas H. <jo...@lophus.org> added the comment: https://github.com/python/cpython/pull/4589 - Add 3.7 What's New entry - Fix regression (thanks Tim for the report) -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-27 Thread Jonas H.
Change by Jonas H. <jo...@lophus.org>: -- pull_requests: +4513 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32071> ___ __

[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-27 Thread Jonas H.
Jonas H. <jo...@lophus.org> added the comment: Ah, the problem isn't that it's running getattr() on test methods, but that it runs getattr() on all methods. Former code: attrname.startswith(prefix) and \ callable(getattr(testCaseClass, attrname)) New code: testFunc = g

[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-27 Thread Jonas H.
Jonas H. <jo...@lophus.org> added the comment: Sure! -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32071> ___ ___ Python

[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Jonas H.
Jonas H. <jo...@lophus.org> added the comment: > > 3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped > > test cases OK? > I think this is the wrong approach. A test that isn't selected shouldn't be > skipped, it should not appear in the output

[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-20 Thread Jonas H.
Jonas H. <jo...@lophus.org> added the comment: Thanks Antoine. I will need some guidance as to what are the correct places to make these changes. I'm not quite sure about the abstractions here (runner, loader, suite, case, etc.) My PoC (see GitHub link in first post) uses a TestSuite su

[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-18 Thread Jonas H.
Jonas H. <jo...@lophus.org> added the comment: Just to be clear, the current implementation is limited to substring matches. It doesn't support py.test like "and/or" combinators. (Actually, py.test uses 'eval' to support arbitrary patterns.) So say we have test case SomeCl

[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-18 Thread Jonas H.
New submission from Jonas H. <jo...@lophus.org>: I'd like to add test selection based on parts of the test class/method name to unittest. Similar to py.test's "-k" option: https://docs.pytest.org/en/latest/example/markers.html#using-k-expr-to-select-tests-based-on-their-name

[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-21 Thread Jonas H.
Jonas H. <jo...@lophus.org> added the comment: Interesting, Victor. I've had a look at the code you mentioned, but I'm afraid it doesn't really make sense to re-use any of the code. Here's a new patch, implemented in the loader as suggested by Antoine, and with tests. I'm happy to

[issue31526] Allow setting timestamp in gzip-compressed tarfiles

2017-11-08 Thread Jonas H.
Jonas H. <jo...@lophus.org> added the comment: This affects me too. -- nosy: +jonash ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32679] concurrent.futures should store full sys.exc_info()

2018-01-26 Thread Jonas H.
Jonas H. <jo...@lophus.org> added the comment: See also https://stackoverflow.com/questions/19309514/getting-original-line-number-for-exception-in-concurrent-futures for other people having the same problem -- ___ Python tracke

[issue32679] concurrent.futures should store full sys.exc_info()

2018-01-26 Thread Jonas H.
New submission from Jonas H. <jo...@lophus.org>: Use case: Try to get a future's result using concurrent.futures.Future.result(), and log the full exception if there was any. Currently, only "excinst" (sys.exc_info()[1]) is provided with the Future.exception() method. P

[issue34087] django: segmentation fault on garbage collection in visit_decref()

2018-07-12 Thread Jonas H.
Jonas H. added the comment: I can reproduce this on Ubuntu 18.04. INADA, I have a full gdb backtrace with Python 3.7 development build. I'd like to share it with you privately as I'm concerned it may contain sensible information. I know that's a bit unconventional; if you have other

[issue34087] django: segmentation fault on random places

2018-07-13 Thread Jonas H.
Jonas H. added the comment: Here's a Docker image that reproduces the bug. FROM ubuntu:18.04 RUN apt update && apt install -y python3.7-dbg python3.7-venv python3-venv wget RUN python3.7 -m venv venv RUN venv/bin/pip install django RUN wget https://bugs.python.org/file47688/testproj.t

[issue34087] django: segmentation fault on random places

2018-07-13 Thread Jonas H.
Jonas H. added the comment: Reduced it to something that seems unicode related? No extension modules involved. Vanilla Django project with a single url + template. See testproj/urls.py and tmpl/index.html -- Added file: https://bugs.python.org/file47688/testproj.tar.gz

[issue34087] django: segmentation fault on random places

2018-07-13 Thread Jonas H.
Jonas H. added the comment: Sure. Unpack archive, create new 3.7 venv with Django (latest version is fine), ./manage.py runserver, curl localhost:8000. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread Jonas H.
Jonas H. added the comment: I don't think this can be tested with Python code, unless you can make sure the target buffer _PyUnicode_TransformDecimalAndSpaceToASCII operates on is initialised with garbage bytes. -- ___ Python tracker <ht

[issue34087] int(s), float(s) and others may cause segmentation fault

2018-07-13 Thread Jonas H.
Jonas H. added the comment: The assertion in the patched code, yes. The segfault in the unpatched code, no. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34087] django: segmentation fault on garbage collection in visit_decref()

2018-07-12 Thread Jonas H.
Jonas H. added the comment: I also have a segfault that goes away with malloc debugging. Not sure if it's the same issue. My extension modules are venv/lib/python3.7/site-packages//_yaml.cpython-37m-darwin.so venv/lib/python3.7/site-packages//netifaces.cpython-37m-darwin.so venv/lib

[issue34087] django: segmentation fault on garbage collection in visit_decref()

2018-07-12 Thread Jonas H.
Jonas H. added the comment: Btw my segfault is from Django too, but that may just be a coincidence -- ___ Python tracker <https://bugs.python.org/issue34

[issue45462] Speed up re.match with pre-compiled patterns

2021-10-13 Thread Jonas H.
Change by Jonas H. : -- keywords: +patch pull_requests: +27224 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28936 ___ Python tracker <https://bugs.python.org/issu

[issue45462] Speed up re.match with pre-compiled patterns

2021-10-13 Thread Jonas H.
New submission from Jonas H. : re.match(p, ...) with a pre-compiled pattern p = re.compile(...) can be much slower than calling p.match(...). Probably mostly in cases with "easy" patterns and/or short strings. The culprit is that re.match -> re._compile can spend a lot of time

[issue45462] Speed up re.match with pre-compiled patterns

2021-10-15 Thread Jonas H.
Jonas H. added the comment: I agree with your statement in principle. Here are numbers for the slowdown that's introduced: Without the change: ./python.exe -m timeit -s 'import re'\n'[re.compile(f"fill_cache{i}") for i in range(512)]'\n'pat = re.compile(".")'

[issue45462] Speed up re.match with pre-compiled patterns

2021-10-15 Thread Jonas H.
Jonas H. added the comment: pat.match() has 110 nsec. Feel free to close the issue and PR if you think this isn't worth changing. -- ___ Python tracker <https://bugs.python.org/issue45