[issue14620] Fatal Python error: Cannot recover from stack overflow.

2012-04-19 Thread Florian Bruhin
New submission from Florian Bruhin python@the-compiler.org: Hey, I just got the error message in the title when trying to run a script with python. You can find the coredump, stacktrace, and the scripts I ran at http://the-compiler.org/tmp/pythoncrash/ The command line I ran: python -u

[issue20451] os.exec* mangles argv on windows (splits on spaces, etc)

2014-01-30 Thread Florian Bruhin
New submission from Florian Bruhin: The os.exec* functions seem to mangle arguments on Windows. So far I noticed the supplied argv gets split on spaces, and double-quotes get stripped when not escaped. Example, on Windows 7: platform.platform() 'Windows-7-6.1.7601-SP1' os.execlp('python

[issue20451] os.exec* mangles argv on windows (splits on spaces, etc)

2014-02-03 Thread Florian Bruhin
Florian Bruhin added the comment: I can't test this right now, but I'd guess you also have to escape a inside an argument (with \ presumably), and a \ with \\. Maybe more, no idea. Actually the documentation doesn't say anything about me _having_ to escape anything, so I'd assume I don't

[issue21497] faulthandler should handle sys.stderr being None gracefully

2014-05-13 Thread Florian Bruhin
New submission from Florian Bruhin: When faulthandler is used while sys.stderr is None (e.g. when using pythonw.exe), a (IMHO) confusing exception is raised: Traceback (most recent call last): File test.py, line 7, in module faulthandler.enable() AttributeError

[issue21498] configparser accepts keys beginning with comment_chars when writing

2014-05-13 Thread Florian Bruhin
New submission from Florian Bruhin: When adding something to a configparser instance which has a key beginning with a comment char, it writes the data to a file without generating an error, and when reading the file back obviously the data is different as it's a comment: cp

[issue21497] faulthandler should handle sys.stderr being None gracefully

2014-05-13 Thread Florian Bruhin
Florian Bruhin added the comment: I didn't test the patch (I don't have the toolchain set up to do so), but it looks like this is indeed an exception which makes more sense to the developer. When I saw the exception as it is now, I only discovered it's related to stderr being None by finding

[issue21497] faulthandler should handle sys.stderr being None gracefully

2014-05-13 Thread Florian Bruhin
Florian Bruhin added the comment: The thing is the developer is not necessarely the one controlling if sys.stderr is None, sometimes the user is. For example, see https://docs.python.org/3.4/using/windows.html#executing-scripts-without-the-python-launcher - an user might have decided to use

[issue22836] Broken Exception ignored in: message on exceptions in __repr__

2014-11-10 Thread Florian Bruhin
New submission from Florian Bruhin: When there's an unraisable exception (e.g. in __del__), and there's an exception in __repr__ as well, PyErr_WriteUnraisable returns after writing Exception ignored in: immediately. I'd expect it to fall back to the default __repr__ instead. See

[issue22837] getpass returns garbage when typing tilde on Windows with deadkeys

2014-11-10 Thread Florian Bruhin
New submission from Florian Bruhin: When using getpass.getpass() on Windows and typing a tilde (~) with a layout with dead keys (e.g. Swiss German), one would typically type ~ to get a single tilde. However, this returns '\x00\x83~' with getpass. It seems this is what msvcrt.getch() returns

[issue22836] Broken Exception ignored in: message on exceptions in __repr__

2014-11-10 Thread Florian Bruhin
Changes by Florian Bruhin python@the-compiler.org: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22836 ___ ___ Python-bugs

[issue22837] getpass returns garbage when typing tilde on Windows with deadkeys

2014-11-10 Thread Florian Bruhin
Changes by Florian Bruhin python@the-compiler.org: -- nosy: +christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22837

[issue22837] getpass returns garbage when typing tilde on Windows with deadkeys

2014-11-10 Thread Florian Bruhin
Florian Bruhin added the comment: Maybe this is related: U+0083 is the no break here char: http://www.fileformat.info/info/unicode/char/0083/index.htm http://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_set From wikipedia: Follows the graphic character that is not to be broken

[issue23202] pyvenv does not fail like documented when a venv already exists

2015-01-08 Thread Florian Bruhin
New submission from Florian Bruhin: https://docs.python.org/3/library/venv.html says: If the target directory already exists an error will be raised, unless the --clear or --upgrade option was provided. However, that doesn't seem to be the case: [florian@ginny ~]$ python --version Python

[issue23207] logging.basicConfig does not validate keyword arguments

2015-01-09 Thread Florian Bruhin
New submission from Florian Bruhin: logging.basicConfig uses **kwargs and does not validate them. This caused me to shoot myself in the foot multiple times by passing logLevel instead of level accidentally, and then trying to figure out why my messages don't get logged. -- messages

[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2015-03-27 Thread Florian Bruhin
Changes by Florian Bruhin python@the-compiler.org: -- nosy: +The Compiler ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7511 ___ ___ Python

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread Florian Bruhin
New submission from Florian Bruhin: I just accidentally passed a list (instead of unpacking it) to os.path.join. I was surprised when it just returned the list unmodified: os.path.join([1, 2, 3]) [1, 2, 3] Looking at the source, it simply returns the first argument (path = a; ...; return

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-05-16 Thread Florian Bruhin
Florian Bruhin added the comment: Serhiy, I don't see a new patch added - did you forget to attach it or am I missing something? :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23780

[issue24493] subprocess with env=os.environ fails with fatal python error when calling 32-bit python from 64-bit one on Windows

2015-06-23 Thread Florian Bruhin
New submission from Florian Bruhin: Trying to call a 32bit Python via subprocess from a 64bit one works as expected: Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:16:31) [MSC v.1600 64 bit (AMD64)] on win32 [...] subprocess.check_call([r'C:\Python34_x32\python.exe', '-c

[issue24493] subprocess with env=os.environ fails with fatal python error when calling 32-bit python from 64-bit one on Windows

2015-06-23 Thread Florian Bruhin
Florian Bruhin added the comment: That gives me Environment variable SYSTEMROOT not defined which would explain the Fatal Python error I'm seeing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24493

[issue24493] subprocess with env=os.environ doesn't preserve environment variables when calling a 32bit process on Windows 8.1

2015-06-24 Thread Florian Bruhin
Florian Bruhin added the comment: I've now updated to Python 3.4.3 and it's broken there as well. I tried on two other Windows 8.1 machines (with Python 3.4.3 and 3.4.1 respectively), and I can't reproduce there either... It works with shell=True indeed. I wonder why this is only broken

[issue24493] subprocess with env=os.environ doesn't preserve environment variables when calling a 32bit process on Windows 8.1

2015-06-23 Thread Florian Bruhin
Florian Bruhin added the comment: Sorry I missed this - I can reproduce this on Windows 8.1, but not on Windows 7. I hope I'll be able to try another Windows 8.1 machine today. SYSTEMROOT is definitely set in the original environment: os.environ['SYSTEMROOT'] 'C:\\Windows

[issue24294] DeprecationWarnings should be visible by default in the interactive REPL

2015-05-28 Thread Florian Bruhin
Changes by Florian Bruhin python@the-compiler.org: -- nosy: +The Compiler ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24294 ___ ___ Python

[issue25550] RecursionError in re with '(' * 500

2015-11-04 Thread Florian Bruhin
New submission from Florian Bruhin: I just found this thanks to Hypothesis[1]: >>> import re >>> re.compile('(' * 500) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/re.py", line 224, in compile

[issue25550] RecursionError in re with '(' * 500

2015-11-04 Thread Florian Bruhin
Florian Bruhin added the comment: I see how it's not possible to compile that pattern as it's using recursion - I don't mind that. However, I think this should be handled and re-raised as a re.error ("Exception raised [...] when some other error occurs during compilation or matching.&

[issue25409] fnmatch.fnmatch normalizes slashes/backslashes on Windows

2015-10-15 Thread Florian Bruhin
New submission from Florian Bruhin: On Windows 8: >>> fnmatch.fnmatch(r'foo\bar', 'foo/bar') True >>> fnmatch.fnmatchcase(r'foo\bar', 'foo/bar') False This is due to fnmatch calling os.path.normpath on the arguments (to get the case-sensitivity of the filesystem), whic

[issue24946] Tkinter tests that fail on linux in tiling window manager

2015-09-01 Thread Florian Bruhin
Florian Bruhin added the comment: At least with my WM, there is no concept of having floating windows when in tiling mode, so I don't think that would be possible. I also don't think there's a standard way to tell a window manager to not tile windows. What about opening a simple window

[issue24946] Tkinter tests that fail on linux in tiling window manager

2015-09-01 Thread Florian Bruhin
Changes by Florian Bruhin <python@the-compiler.org>: -- nosy: -The-Compiler ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue24493] subprocess with env=os.environ doesn't preserve environment variables when calling a 32bit process on Windows 8.1

2015-09-16 Thread Florian Bruhin
Florian Bruhin added the comment: I just ran into this again - when trying to run `git` via subprocess with "env" set, I got: # Start the process try: hp, ht, pid, tid = _winapi.CreateProcess(executable, args, #

[issue24493] subprocess with env=os.environ doesn't preserve environment variables when calling a 32bit process on Windows 8.1

2015-09-16 Thread Florian Bruhin
Florian Bruhin added the comment: > Sounds like there's something in the cwd that is making the difference (this > being Windows which looks for things in the cwd always). The cwd is an empty temporary directory. And that still wouldn't explain why passing env=os.environ breaks it a

[issue25271] SystemError when doing codecs.escape_encode(b'')

2015-09-29 Thread Florian Bruhin
New submission from Florian Bruhin: I can reproduce this with 3.4.3 and 3.5.0: >>> import codecs >>> codecs.escape_encode(b'') Traceback (most recent call last): File "", line 1, in SystemError: Objects/bytesobject.c:3553: bad argument to internal function --

[issue26323] Add a assert_called() method for mock objects

2016-02-09 Thread Florian Bruhin
Florian Bruhin added the comment: I agree this would be useful. "assert themock.called" (or self.assertTrue) works, but always trips me up. -- nosy: +The Compiler ___ Python tracker <rep...@bugs.python.org> <http://bugs.py

[issue26323] Add a assert_called() method for mock objects

2016-02-09 Thread Florian Bruhin
Changes by Florian Bruhin <python@the-compiler.org>: -- nosy: +michael.foord ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue26203] nesting venv in virtualenv segfaults

2016-01-25 Thread Florian Bruhin
Changes by Florian Bruhin <python@the-compiler.org>: -- nosy: +The Compiler, dstufft, vinay.sajip ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue22836] Broken "Exception ignored in:" message on exceptions in __repr__

2016-02-17 Thread Florian Bruhin
Florian Bruhin added the comment: I just got bitten by this again - is anything holding this back from being merged (other than lack of review-manpower)? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2016-02-18 Thread Florian Bruhin
Florian Bruhin added the comment: FWIW, this also affects pytest users: https://github.com/pytest-dev/pytest/issues/1217 -- nosy: +The Compiler ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28165] The 'subprocess' module leaks roughly 4 KiB of memory per call

2016-09-15 Thread Florian Bruhin
Changes by Florian Bruhin <python@the-compiler.org>: -- nosy: +The Compiler ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30998] faulthandler: Show C stacktrace

2017-07-23 Thread Florian Bruhin
New submission from Florian Bruhin: While faulthandler's output is already quite useful when dealing with crashes in C libraries, it'd be much more useful when it could also show a low-level C/C++ stack. glibc has functions to do that: https://www.gnu.org/software/libc/manual/html_node

[issue30998] faulthandler: Show C stacktrace

2017-07-23 Thread Florian Bruhin
Florian Bruhin added the comment: Hmm, fair point. I thought I had seen this being used in a SEGV handler in some other software I use, but I can't find that anymore - so either I was dreaming, or they noticed it was problematic and removed it again. I'm closing this then. My goal was to get

[issue25409] fnmatch.fnmatch normalizes slashes/backslashes on Windows

2017-05-10 Thread Florian Bruhin
Florian Bruhin added the comment: https://github.com/python/cpython/pull/1535 seems to be the correct PR, not 1634. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue34360] urllib.parse doesn't fail with multiple unmatching square brackets

2018-08-08 Thread Florian Bruhin
New submission from Florian Bruhin : Since bpo-29651, the urllib.parse docs say: > Unmatched square brackets in the netloc attribute will raise a ValueError. However, when there are at least one [ and ], but they don't match, there's somewhat inconsistent behavior: >>> urllib.pa

[issue37440] httplib should enable post-handshake authentication for TLS 1.3

2019-06-30 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue37440> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37428] SSLContext.post_handshake_auth implicitly enables cert validation

2019-06-30 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue37428> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15817] Misc/gdbinit: Expose command documentation to gdb help

2019-07-30 Thread Florian Bruhin
Change by Florian Bruhin : -- pull_requests: +14782 pull_request: https://github.com/python/cpython/pull/15021 ___ Python tracker <https://bugs.python.org/issue15

[issue38656] mimetypes for python 3.7.5 fails to detect matroska video

2019-11-18 Thread Florian Bruhin
Florian Bruhin added the comment: I'm seeing the same in ranger and I'm currently trying to debug this - I'm still not quite sure what I'm seeing as there seem to be various issues/weirdnesses which overlap each other. This strikes me as odd: >>> import mimetypes >>> mi

[issue38656] mimetypes for python 3.7.5 fails to detect matroska video

2019-11-18 Thread Florian Bruhin
Florian Bruhin added the comment: I now bisected this with the following script: #!/bin/bash git clean -dxf ./configure || exit 125 make -j2 || exit 125 output=$(./python -c "import mimetypes; mt = mimetypes.MimeTypes(); print(mt.guess_type('E01.mkv')[0])") echo "$outp

[issue38656] mimetypes for python 3.7.5 fails to detect matroska video

2019-11-18 Thread Florian Bruhin
Florian Bruhin added the comment: Ah, I think I see what's happening now. Before that commit, when doing "mt = mimetypes.MimeTypes()", its self.types_map is populated as follows: - Its __init__ method calls the mimetypes.init() function. - That then reads all

[issue38656] mimetypes for python 3.7.5 fails to detect matroska video

2019-11-18 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +r.david.murray ___ Python tracker <https://bugs.python.org/issue38656> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38656] mimetypes for python 3.7.5 fails to detect matroska video

2019-11-18 Thread Florian Bruhin
Florian Bruhin added the comment: Ah, I only saw dhess' comment after already submitting mine. > By historical design, instantiating a MimeTypes class instance directly will > not use host OS system mime type files. Yet that wasn't what happened before that commit, and it'

[issue40527] Multiple "unknown option" errors when passing unknown arguments to the interpreter

2020-05-06 Thread Florian Bruhin
New submission from Florian Bruhin : A minor issue I just discovered today: When e.g. doing "python3 --foo", the output is: unknown option --foo unknown option --foo unknown option --foo usage: /usr/bin/python3 [option] ... [-c cmd | -m mod | file | -] [arg] ... With m

[issue40527] Multiple "unknown option" errors when passing unknown arguments to the interpreter

2020-05-06 Thread Florian Bruhin
Florian Bruhin added the comment: That was an insanely fast fix - thanks everyone! :) -- ___ Python tracker <https://bugs.python.org/issue40527> ___ ___ Pytho

[issue41777] When using `python -bb`, `struct.calcsize` raises a warning when used with str argument after being used with bytes (might be a larger problem with dicts)

2020-09-13 Thread Florian Bruhin
Florian Bruhin added the comment: Ah, also see https://bugs.python.org/issue21071#msg292409 where the same thing was mentioned as part of another issue as well. After some discussions in the Python IRC channel, I guess it's acceptable for dicts to raise a ByteWarning here - after all

[issue41777] When using `python -bb`, `struct.calcsize` raises a warning when used with str argument after being used with bytes (might be a larger problem with dicts)

2020-09-13 Thread Florian Bruhin
Florian Bruhin added the comment: Taking the freedom of adding people involved in the `struct` module to the nosy list. -- nosy: +The Compiler, mark.dickinson, meador.inge ___ Python tracker <https://bugs.python.org/issue41

[issue40747] sysconfig.get_config_var("py_version_nodot") should return 3_10

2020-10-08 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue40747> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41909] Segfault on __getattr__ infinite recursion on certain attribute accesses

2020-10-02 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue41909> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41944] Python testsuite calls eval() on content received via HTTP

2020-10-06 Thread Florian Bruhin
Florian Bruhin added the comment: I wonder if I should request a CVE for this as well? Just to make sure the word gets out to distributions/organizations/etc. running the Python testsuite, given that we can't be sure it which contexts this happens (and as it could be exploited by e.g

[issue41944] [security] Python testsuite calls eval() on content received via HTTP

2020-10-06 Thread Florian Bruhin
Florian Bruhin added the comment: That assumption is false. For starters, distribution packagers do: https://github.com/archlinux/svntogit-packages/blob/3fc85177e35d1ff9ab000950c5d1af9567730434/trunk/PKGBUILD#L72-L84 https://src.fedoraproject.org/rpms/python3.9/blob/master/f/python3.9.spec

[issue41944] [security] Python testsuite calls eval() on content received via HTTP

2020-10-06 Thread Florian Bruhin
Change by Florian Bruhin : -- pull_requests: +21570 pull_request: https://github.com/python/cpython/pull/22575 ___ Python tracker <https://bugs.python.org/issue41

[issue41944] [security] Python testsuite calls eval() on content received via HTTP

2020-10-06 Thread Florian Bruhin
Florian Bruhin added the comment: Thanks for the clarification - I wasn't aware those tests aren't run by default. FWIW I found another place where a similar thing is done, though by chance it's probably not exploitable - see GH-22575

[issue41940] AMD64 Debian root 3.x: tests fail because downloaded files start with:

2020-10-05 Thread Florian Bruhin
Florian Bruhin added the comment: > It is also not safe to pass data downloaded from untrusted source to eval(). To make matters worse, it's downloaded via HTTP (rather than HTTPS) - so anyone who can mess with the network of a machine running the Python testsuite can run arbitrary c

[issue41836] Improve ctypes error reporting with missing DLL path

2020-09-22 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue41836> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25655] Python errors related to failures loading DLL's lack information

2020-09-22 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue25655> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38488] Update bundled pip to 19.3

2020-05-28 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue38488> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42174] shutil.get_terminal_size() returns 0 when run in a pty

2020-10-27 Thread Florian Bruhin
New submission from Florian Bruhin : When shutil.get_terminal_size() is used in a PTY, the os.get_terminal_size() call can return (0, 0). With the pty script from https://github.com/python/mypy/issues/8144#issue-537760245: $ python3 t.py python3 -c 'import shutil; print

[issue41154] test_pkgutil:test_name_resolution fails on some platforms

2020-06-29 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue41154> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42174] shutil.get_terminal_size() returns 0 when run in a pty

2020-11-02 Thread Florian Bruhin
Florian Bruhin added the comment: Just found another workaround for this in the wild, as part of the "rich" library: https://github.com/willmcgugan/rich/blob/v9.1.0/rich/console.py#L669-L672 -- ___ Python tracker <https://bu

[issue42946] email: ValueError in get_section when parsing header with non-ASCII digit

2021-01-17 Thread Florian Bruhin
New submission from Florian Bruhin : Found mostly by accident: >>> import email.headerregistry >>> reg = email.headerregistry.HeaderRegistry() >>> h = reg('Content-Disposition', 'inline; 0*²') Traceback (most recent call last): File "", line 1,

[issue42947] email: Handling when both extended/ascii parameter (filename*/filename) are present?

2021-01-17 Thread Florian Bruhin
New submission from Florian Bruhin : Consider this reproducer: >>> import email.headerregistry >>> reg = email.headerregistry.HeaderRegistry() >>> parsed = reg('Content-Disposition', """attachment; filename="foo-ae.html"; filenam

[issue1043134] Add preferred extensions for MIME types

2021-01-04 Thread Florian Bruhin
Florian Bruhin added the comment: I think this has been fixed in Python 3.7+ via https://github.com/python/cpython/pull/14375 - at least for a couple of types. Comparing Python 3.6 with the current state, the following changed (which can be used as an "override" dict befo

[issue43248] platform.libc_ver() returns no information on Alpine Linux

2021-07-05 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue43248> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43063] zipfile.Path / importlib.resources raises KeyError if a file wasn't found

2021-01-29 Thread Florian Bruhin
Florian Bruhin added the comment: Whoops, I was mistaken about Python 3.8 not being affected. I thought it wouldn't be because importlib.resources.files was added in 3.9, but zipfile.Path was added in 3.8. With that in mind, I guess changing the behavior of 3.9 would be rather confusing

[issue43063] zipfile.Path / importlib.resources raises KeyError if a file wasn't found

2021-01-29 Thread Florian Bruhin
New submission from Florian Bruhin : When a package is installed as an egg, importlib.resources.files returns a zipfile.Path rather than a pathlib.Path (maybe it returns other things too, seeing that it's documented to return a importlib.abc.Traversable - I didn't check). However, those two

[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2021-03-12 Thread Florian Bruhin
Florian Bruhin added the comment: I suppose returning the string unchanged would work as well. However, "Errors should never pass silently." :) Perhaps that with a ignore_nameerror=True or switch or so would work? -- ___ Python track

[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2021-03-10 Thread Florian Bruhin
New submission from Florian Bruhin : Consider a file such as: # from __future__ import annotations from typing import TYPE_CHECKING, Union, get_type_hints if TYPE_CHECKING: import types def fun(a: 'types.SimpleNamespace', b: Union[int, str]): pass print

[issue43450] List amnesia

2021-03-09 Thread Florian Bruhin
Florian Bruhin added the comment: This is not a bug. itertools.product returns an iterator: https://docs.python.org/3/glossary.html#term-iterator Quoting from there: > [...] every iterator is also iterable and may be used in most places where > other iterables are accepted. One n

[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2021-03-15 Thread Florian Bruhin
Florian Bruhin added the comment: Fair points. As an aside, I'm also wondering how inspect.Parameter.annotation should interact with the changes in Python 3.10? That used to be the canonical way (as far as I'm aware) of getting a single argument's type annotation (other than getting

[issue43463] typing.get_type_hints with TYPE_CHECKING imports / getting hints for single argument

2021-03-15 Thread Florian Bruhin
Florian Bruhin added the comment: Ah, I wasn't aware of that, thanks for the pointer! So what inspect does internally is: def _get_type_hints(func, **kwargs): try: return typing.get_type_hints(func, **kwargs) except Exception: # First, try to use

[issue43355] __future__.annotations breaks inspect.signature()

2021-03-15 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue43355> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40066] Enum: modify __repr__, __str__; update docs

2021-04-08 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue40066> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40066] Enum: modify __repr__, __str__; update docs

2021-04-13 Thread Florian Bruhin
Florian Bruhin added the comment: I'm probably a bit late to the party as well, but as some additional datapoints: - This broke the tests for my project and I ended up adding a wrapper to stringify enums (since I actually prefer having the enum type in debug logs and such): https

[issue43798] Add position metadata to alias AST type

2021-04-14 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue43798> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43540] importlib: Document how to replace load_module() in What's New in Python 3.10

2021-04-08 Thread Florian Bruhin
Change by Florian Bruhin : -- nosy: +The Compiler ___ Python tracker <https://bugs.python.org/issue43540> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43146] 3.10a5 regression: AttributeError: 'NoneType' object has no attribute '__suppress_context__' in traceback.py

2021-02-06 Thread Florian Bruhin
New submission from Florian Bruhin : After upgrading to 3.10a5, calling logging.exception("test") results in: --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.10/logging/__init__.py", line 1094, in emit msg = self.forma