[issue44996] tarfile missing TarInfo.offset_data member in documentation

2021-08-25 Thread Nils
New submission from Nils : The title says it all: `TarInfo` objects are missing their `offset_data` member in all documentation versions. -- assignee: docs@python components: Documentation messages: 400248 nosy: docs@python, nilsnolde priority: normal severity: normal status: open

[issue22240] argparse support for "python -m module" in help

2021-08-08 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: I implemented the logic and adjusted the existing tests to have a fixed program name. I also fixed the build error by changing how zip files are detected. Based on you comment Nick you however even had a different idea. Currently I check if __spec__

[issue13824] argparse.FileType opens a file and never closes it

2021-07-25 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: A good alternative would be to use pathlib.Path. The only downside would be that one has to manually handle `-` but besides that it solves most problems. Still the fact that file descriptors are kept open should be added as a warning to the docs

[issue22240] argparse support for "python -m module" in help

2021-07-23 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: I expanded the patch from tebeka to also work with invocations like `python3 -m serial.tools.miniterm` where `miniterm.py` is a file and not a directory with a `__main__.py`. This was able to handle everything I threw at it. However due to the import

[issue22240] argparse support for "python -m module" in help

2021-07-18 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: I am not sure if the patch correctly handles calling a nested module (e.g. `python3 -m serial.tools.miniterm`). Would it also be possible to detect if python or python3 was used for the invocation? -- nosy: +Nils Kattenbeck

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-07-03 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: > The way I fixed this is I added `__forward_module__` to `typing.ForwardRef`, > so that it can resolve the forward reference with the same globals as the > ones specified by the module in `__forward_module__`. `TypedDict`'s metaclass > shou

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-06-07 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: > I believe it had something to do with TypedDict instances being instances of > dict at runtime, but I can't actually reconstruct the reason. Hm that may be true. My limited low-level Python knowledge leads me to believe that this could also be done

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-05-29 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: What is/was the initial reason to not preserve the MRO for a TypedDict? The only thing which came to my mind would be instantiation performance but as annotations are not evaluated by default and on the right-hide side of assignment most people will use

[issue25024] Allow passing "delete=False" to TemporaryDirectory

2021-05-26 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: While the proposal linked by C.A.M. solves one of the use cases but it does not address the others. One use cases which is rather common for me it is e.g. to have scripts/programs which allow configuring whether temporary directories should get deleted

[issue1717] Get rid of more references to __cmp__

2021-05-26 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: Has there been any resolution regarding `sortTestMethodsUsing`? See https://bugs.python.org/msg77261 I spend a decent time and read the documentation thrice before realizing it received an old-style compare function. Brett's proposal for a new attribute

[issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager

2021-05-22 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: Thanks for looking into it. Yes I can confirm that `importlib_resources` has the expected behaviour - I did not download Python 3.10 as the code seems to be the same. -- ___ Python tracker <ht

[issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager

2021-05-17 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: Yes I understand that the function handles this specially to not raise an exception if the file is not found in the package (even though the intention behind this is not clear to me). However if a user causes a FileNotFoundException itself inside

[issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager

2021-05-14 Thread Nils Kattenbeck
Change by Nils Kattenbeck : -- title: importlib.resources.path raises RuntimeError import FileNotFoundError is raise in context manager -> importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager ___ Pyt

[issue44137] importlib.resources.path raises RuntimeError import FileNotFoundError is raise in context manager

2021-05-14 Thread Nils Kattenbeck
New submission from Nils Kattenbeck : When a FileNotFoundError is raised inside while the importlib.resources.path context manager is active a RuntimeError is raised. Looking at the (3.8) code it seems that FileNotFound exceptions are handled specially from all other exceptions which may lead

[issue34137] Add Path.lexist() to pathlib

2020-06-25 Thread Nils Philippsen
Nils Philippsen added the comment: I've come across this issue lately and proposed a PR which implements this and, analogous to os.stat(), adds a follow_symlinks parameter to Path.exists(). -- ___ Python tracker <https://bugs.python.

[issue34137] Add Path.lexist() to pathlib

2020-06-25 Thread Nils Philippsen
Change by Nils Philippsen : -- keywords: +patch pull_requests: +20316 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21157 ___ Python tracker <https://bugs.python.org/issu

[issue34137] Add Path.lexist() to pathlib

2020-06-25 Thread Nils Philippsen
Change by Nils Philippsen : -- nosy: +nils ___ Python tracker <https://bugs.python.org/issue34137> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38756] Add generic versions of weakref types to typing module

2019-11-10 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: Okay, if I want to start a discussion about adding weakref types to PEP 585 where should do it? The mailing list or as an issue in the PEP repo? -- ___ Python tracker <https://bugs.python.org/issue38

[issue38761] weakref.WeakSet not instanceof collections.abc.Set

2019-11-10 Thread Nils Kattenbeck
New submission from Nils Kattenbeck : Instances of weakref.WeakSet are not instances of Set and therefore not of MutableSet but they are instances of Collection. They however implement all required methods for a MutableSet and Weak(Key|Value)Dictionary are correctly identified. Is this just

[issue38756] Add generic versions of weakref types to typing module

2019-11-10 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: Okay nevermind, after looking in the PEP again and inspecting the __annotations__ property I learned that annotations are never evaluated and just saved as a string when using said future statement. However this may still be relevant

[issue38756] Add generic versions of weakref types to typing module

2019-11-10 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: Yes thank you, using 'from __future__ import annotations' works fantastic. I did not knew about this functionality of the annotations future import statement, I thought it was only for postponed evaluation but I probably missed something in the PEP

[issue38756] Add generic versions of weakref types to typing module

2019-11-09 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: A possible use case would be having multiple users and some groups said users can belong to. When using a WeakSet a user won't be part of a groups after he deleted his account without having to iterate over all groups. class User: pass class Group

[issue38756] Add generic versions of weakref types to typing module

2019-11-09 Thread Nils Kattenbeck
New submission from Nils Kattenbeck : I would like to request the addition of generic variants of some of the types in weakref to the typing module. This would for example include weakref.WeakKeyDictionary among others. Doing so would allow one to add type annotations to code using such data

[issue31652] make install fails: no module _ctypes

2019-04-18 Thread Nils Goroll
Nils Goroll added the comment: In case this helps: I noticed this during the build: *** WARNING: renaming "_ssl" since importing it failed: ld.so.1: python: fatal: libssl.so.1.1: open failed: No such file or directory *** WARNING: renaming "_hashlib" since importin

[issue35558] venv: running activate.bat gives ' parameter format not correct - 65001'

2018-12-22 Thread Nils Lindemann
Change by Nils Lindemann : -- resolution: -> duplicate stage: -> resolved status: -> closed ___ Python tracker <https://bugs.python.org/issue35558> ___ ___

[issue35558] venv: running activate.bat gives ' parameter format not correct - 65001'

2018-12-21 Thread Nils Lindemann
New submission from Nils Lindemann : Windows 7, Python 3.7.1:260ec2c36a after doing C:\python\python -m venv C:\myvenv and then C:\>myvenv\Scripts\activate.bat it prints parameter format not correct - 65001 However, it activates the venv - the prompt shows (myvenv

[issue31816] Unexpected behaviour of `dir()` after implementation of __dir__

2017-10-19 Thread Nils Diefenbach
Nils Diefenbach <23okrs20+pyt...@mykolab.com> added the comment: Alright. Are there any other magic methods that do some post-processing on a custom implementation of them ? I couldn't think of one, which is why this behaviour appeared odd to me. -- status: pending -

[issue31816] Unexpected behaviour of `dir()` after implementation of __dir__

2017-10-19 Thread Nils Diefenbach
New submission from Nils Diefenbach <23okrs20+pyt...@mykolab.com>: When defining a custom __dir__ method in a class, calling dir() on said class still sorts the output. This is, imo, unexpected behaviour, especially if the order of output was specified in __dir__ and is somehow re

[issue30580] WSGI examples raise AttributeError: __exit__

2017-06-06 Thread Nils Lindemann
Nils Lindemann added the comment: ok -- status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30580> ___ ___ P

[issue30580] WSGI examples raise AttributeError: __exit__

2017-06-06 Thread Nils Lindemann
Nils Lindemann added the comment: I am not sure if the py package i found on PyPi is what you meant, but if you mean the py launcher (the py.exe in the windows dir), yes, i have that. My system was indeed misconfigured as you correctly guessed, i had the .py filetype pointing to a Python

[issue30580] WSGI examples raise AttributeError: __exit__

2017-06-06 Thread Nils Lindemann
Nils Lindemann added the comment: What would that be? If i google 'py helper command' i get no good results. -- resolution: not a bug -> status: closed -> open ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30580] WSGI examples raise AttributeError: __exit__

2017-06-06 Thread Nils Lindemann
Nils Lindemann added the comment: I just found out that the example works in idle and if i do in a console: python server.py but not if i do just: server.py What is the secret behind this? -- ___ Python tracker <rep...@bugs.python.org>

[issue30580] WSGI examples raise AttributeError: __exit__

2017-06-06 Thread Nils Lindemann
Nils Lindemann added the comment: I tried a few online python 3 interpreters. These give the same exception: http://www.learnpython.org/en/Hello%2C_World%21 http://rextester.com/l/python3_online_compiler http://ideone.com/pIMilt http://www.tutorialspoint.com/execute_python3_online.php

[issue30580] WSGI examples raise AttributeError: __exit__

2017-06-06 Thread Nils Lindemann
New submission from Nils Lindemann: All examples on https://docs.python.org/3/library/wsgiref.html raise this exception: Traceback (most recent call last): File "C:\Code\test\server.py", line 110, in with make_server('', 8000, simple_app) as httpd: AttributeError: __exit

[issue25444] Py Launch Icon

2017-06-06 Thread Nils Lindemann
Nils Lindemann added the comment: Two years later: To the dude who removed the rocket from the icons in 3.6: I LOVE YOU! -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25444] Py Launch Icon

2015-10-29 Thread Nils Lindemann
Nils Lindemann added the comment: i see now what you mean. I have this icon too (py 3.5.0 idle icon.png). Something is misconfigured with the icons in the python 3.5.0 windows installer, also python files in explorer have no icons. Thanks for your hint with the python ideas list, i will post

[issue25444] Py Launch Icon

2015-10-26 Thread Nils Lindemann
Nils Lindemann added the comment: it seems i have still not explained my issue in an understandable way: the three first icons in the file list in the screenshot, aka the icons which are used in eg py 3.2, these icons are cool. the icon i do not like, is the launcher icon which is used in eg

[issue25444] Py Launch Icon

2015-10-20 Thread Nils Lindemann
Nils Lindemann added the comment: The icons are not intended to be used instead of the three default icons, please dont, these are just great. I am just targeting the current launcher symbol: * It contains a symbol of an instrument which can be used to kill people. * in the 16x16 icon

[issue25444] Py Launch Icon

2015-10-20 Thread Nils Lindemann
Nils Lindemann added the comment: let me reformulate it: my main intention is to get rid of the launcher symbol, or at least have a nicer looking symbol, i dont care for the idle symbol. -- ___ Python tracker <rep...@bugs.python.org>

[issue25444] Py Launch Icon

2015-10-20 Thread Nils Lindemann
Nils Lindemann added the comment: Here is also a zip containing the icons. -- Added file: http://bugs.python.org/file40818/icons.zip ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25444] Py Launch Icon

2015-10-19 Thread Nils Lindemann
Nils Lindemann added the comment: Hm actually an alternative icon for idle can be useful to separate it from command lines in the task bar. But a special launcher symbol is not necessary in my opinion. -- ___ Python tracker <rep...@bugs.python.

[issue25444] Py Launch Icon

2015-10-19 Thread Nils Lindemann
New submission from Nils Lindemann: Hi, See attached screen for a list of alternative 16x16 icon suggestions to the current launcher symbol, which i dont like (Dudes, rockets are used in wars!). I copied them a few times to show how they look in groups. (while i was at it i also created

[issue21121] -Werror=declaration-after-statement is added even for extension modules through setup.py

2014-04-01 Thread nils
New submission from nils: I got an error while rebuilding a module for 3.4. This was a ISO C90 error but setup.py explicitely adds -std=c99 to the gcc parameters, and indeed it is used. fifo.h:114:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement

[issue21121] -Werror=declaration-after-statement is added even for extension modules through setup.py

2014-04-01 Thread nils
nils added the comment: The workaround indeed works. At least I can work now until this gets officialy fixed. Thanks! export CFLAGS=$(python3.4 -c 'import sysconfig; print(sysconfig.get_config_var(CFLAGS).replace(-Werror=declaration-after-statement

[issue17816] Weak*Dictionary KeyErrors during callbacks

2013-05-01 Thread Nils Bruin
Nils Bruin added the comment: One solution is to patch both WeakValueDictionary and WeakKeyDictionary with their own clear methods where we first store the strong links (to keys, resp. values) in a list, then clear the underlying dictionaries (this will now trigger the deletion

[issue17816] Weak*Dictionary KeyErrors during callbacks

2013-04-22 Thread Nils Bruin
New submission from Nils Bruin: The following program is a little dependent on memory layout but will usually generate lots of Exception KeyError: (A(9996),) in function remove at 0xa47050 ignored messages in Python 2.7. import weakref class A(object): def __init__(self

[issue17816] Weak*Dictionary KeyErrors during callbacks

2013-04-22 Thread Nils Bruin
Nils Bruin added the comment: Have you tried if the fix at issue7105 solves the problem? I don't see the patch there introduce a `clear` method override for WeakValueDictionary or WeakKeyDictionary. The one for WeakSet still calls self.data.clear(), which for dictionaries would still result

[issue17816] Weak*Dictionary KeyErrors during callbacks

2013-04-22 Thread Nils Bruin
Nils Bruin added the comment: I think the difference in behaviour between Py3 and Py2 is coming from: http://hg.python.org/cpython/file/a26df2d03989/Objects/dictobject.c#l1275 which first clears all values before removing any keys. For a WeakValueDictionary that means all the weakrefs

[issue17526] inspect.findsource raises undocumented error for code objects with empty filename

2013-03-25 Thread Nils Bruin
Nils Bruin added the comment: The most straightforward change I can think of is to change the line if not sourcefile and file[0] + file[-1] != '': to if not sourcefile and (not file or file[0] + file[-1] != ''): That solves the problem in the cases I have observed

[issue17526] inspect.findsource raises undocumented error for code objects with empty filename

2013-03-22 Thread Nils Bruin
New submission from Nils Bruin: It would seem reasonable that an empty filename would be a legitimate way of indicating that a code object does not have a corresponding source file. However, if one does that then inspect.findsource raises an unexpected IndexError rather than the documented

[issue11912] Python shouldn't use the mprotect() system call

2011-04-25 Thread Nils Breunese
Nils Breunese n...@breun.nl added the comment: I contacted the author of iotop and he told me iotop does not use mprotect (but it does use dlopen). Guess I'll have to do some more digging to find what is exactly doing the call to mprotect

[issue11912] Python shouldn't use the mprotect() system call

2011-04-23 Thread Nils Breunese
New submission from Nils Breunese n...@breun.nl: When I try to run iotop [0] on CentOS 5.6 on a kernel with grsecurity [1] then iotop won't start because grsecurity is blocking Python because of its use of the mprotect() system call. Please see http://www.atomicorp.com/wiki/index.php/ASL_FAQ

[issue11912] Python shouldn't use the mprotect() system call

2011-04-23 Thread Nils Breunese
Nils Breunese n...@breun.nl added the comment: I got this error message in /var/log/messages when trying to start iotop: Apr 13 08:49:37 hostname kernel: grsec: From xxx.xxx.xxx.xxx: denied RWX mprotect of /lib64/ld-2.5.so by /usr/bin/iotop[iotop:9836] uid/euid:0/0 gid/egid:0/0, parent

[issue11912] Python shouldn't use the mprotect() system call

2011-04-23 Thread Nils Breunese
Nils Breunese n...@breun.nl added the comment: I haven't had any problems with other Python applications like this, Python seems fine otherwise. I just noticed that iotop has a dependency on python-ctypes, which sounds like it could be iotop doing the mprotect() calls via ctypes. Does

[issue6011] python doesn't build if prefix contains non-ascii characters

2011-01-25 Thread Nils Philippsen
Nils Philippsen n...@redhat.com added the comment: NB: it's not the shell, but the kernel which interprets the shebang line (and subsequently calls the shell /bin/sh with it if it's missing, causing funny effects when it encounters the first import line and you happen to have ImageMagick

[issue6011] python doesn't build if prefix contains non-ascii characters

2010-10-05 Thread Nils Philippsen
Changes by Nils Philippsen n...@redhat.com: -- nosy: +nils ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6011 ___ ___ Python-bugs-list mailing

[issue1675951] [gzip] Performance for small reads and fix seek problem

2010-06-17 Thread Nils Philippsen
Changes by Nils Philippsen n...@redhat.com: -- nosy: +nils ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1675951 ___ ___ Python-bugs-list mailing

[issue2504] Add gettext.pgettext() and variants support

2010-06-15 Thread Nils Philippsen
Changes by Nils Philippsen n...@redhat.com: -- nosy: +nils ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2504 ___ ___ Python-bugs-list mailing