[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-31 Thread Enji Cooper
Enji Cooper added the comment: Grégory: that will fix this issue, but what I really need is some of the other changes, like moving the getaddrinfo logic into a separate route (connect). -- ___ Python tracker <https://bugs.python.org/issue47

[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-30 Thread Enji Cooper
Enji Cooper added the comment: Grégory: good question. I would personally advocate for doing it out of selfish interests. I'm working with middleware based on 3.8 (moving to 3.9+ is non-trivial), and we have a common fault scenario where the system breaks if logging.handlers.SysLogHandler

[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-29 Thread Enji Cooper
Enji Cooper added the comment: Yup! Looks like it! Just needs a back port. -- ___ Python tracker <https://bugs.python.org/issue47158> ___ ___ Python-bugs-list m

[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-29 Thread Enji Cooper
New submission from Enji Cooper : Something I noticed when trying to repro another issue: % python Python 3.8.13 (default, Mar 16 2022, 17:28:59) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more

[issue46989] signal.signal, et al, doesn't support [SIGRTMIN, SIGRTMAX] on FreeBSD (not included in NSIG)

2022-03-11 Thread Enji Cooper
New submission from Enji Cooper : As noted in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262487, cpython relies on the definition of NSIG when building signal handlers to determine what signals are and aren't invalid. Unfortunately on FreeBSD, NSIG doesn't include [SIGRTMIN,SIGRTMAX

[issue43465] ./configure --help describes what --with-ensurepip does poorly

2021-03-10 Thread Enji Cooper
New submission from Enji Cooper : Many users are used to --without-* flags in autoconf disabling features (and optionally not installing them). --without-ensurepip (at face value to me) suggests it shouldn't be built/installed. This comment in https://bugs.python.org/issue20417 by dstufft

[issue42971] Some errnos for BSD/OSX are missing from errno module

2021-01-19 Thread Enji Cooper
Enji Cooper added the comment: Some items that I've noted so far that are missing: - ENOATTR (BSD/OSX) - ENOLINK (BSD; is reserved on OSX) - ENOTSUP (NetBSD, OpenBSD, OSX) -- ___ Python tracker <https://bugs.python.org/issue42

[issue42971] Some errnos for BSD/OSX are missing from errno module

2021-01-19 Thread Enji Cooper
New submission from Enji Cooper : Some errnos for BSD/OSX are currently not supported by the errno module. It would be helpful for these to be exposed to the end-user so they could programmatically use them instead of reinventing the wheel in a separate module/C extension, or hardcoding

[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2020-10-22 Thread Enji Cooper
Enji Cooper added the comment: Is there something I can do to help move this change along? 8 years is a long time for an issue to be open :(. -- ___ Python tracker <https://bugs.python.org/issue13

[issue41108] IN module removed in python 3.x; socket doesn't fill in the gap with IP_PORTRANGE*

2020-06-24 Thread Enji Cooper
New submission from Enji Cooper : The group that I work with uses the IN.py module to access constants available in netinet/in.h on BSD when adjusting socket port ranges. This compile-time module was never ported forward to 3.x and equivalent functionality doesn't exist in the `socket

[issue40786] madvise should be accessible outside of mmap instance

2020-05-26 Thread Enji Cooper
Change by Enji Cooper : -- components: +Library (Lib) ___ Python tracker <https://bugs.python.org/issue40786> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40786] madvise should be accessible outside of mmap instance

2020-05-26 Thread Enji Cooper
New submission from Enji Cooper : madvise can be used when manipulating mmap'ed pages, but it can also be used when protecting processes and other things. Having madvise be available in mmap as a function would be helpful instead of having to jump through a lot of hoops to run `MADV_PROTECT

[issue40785] `mmap.mmap(..., 0)` doesn't work as advertised in docs (fails with EINVAL); relies on compatibility behavior no longer permitted by [some] Unix OSes

2020-05-26 Thread Enji Cooper
Enji Cooper added the comment: Sidenote: all versions tested were 3.8.2: pinklady:freebsd ngie$ /usr/local/opt/python@3.8/bin/python3 -V Python 3.8.2 -- ___ Python tracker <https://bugs.python.org/issue40

[issue40785] `mmap.mmap(..., 0)` doesn't work as advertised in docs (fails with EINVAL); relies on compatibility behavior no longer permitted by [some] Unix OSes

2020-05-26 Thread Enji Cooper
New submission from Enji Cooper : The documentation for mmap.mmap() claims that passing a length of 0 will map in an entire file, but unfortunately that doesn't work as shown below: >>> mmap.mmap(-1, 0) Traceback (most recent call last): File "", line 1, in OSError:

[issue39919] C extension code reliant on static flags/behavior with PY_DEBUG (Py_SAFE_DOWNCAST, method flags) could potentially leverage _Static_assert

2020-03-09 Thread Enji Cooper
New submission from Enji Cooper : Looking at Py_SAFE_DOWNCAST, it seems that the code could (in theory) leverage _Static_assert on C11 capable compilers [1]. Looking at some other code APIs, like module initialization with METH_VARARGS, etc, there are ways to determine whether

[issue39884] "SystemError: bad call flags" exceptions added as part of BPO-33012 are difficult to debug

2020-03-06 Thread Enji Cooper
New submission from Enji Cooper : When a body of C extensions needs to be ported from python <3.8 to 3.8, one of the issues one might run into is improperly defined methods in a C extension, which results in SystemErrors stating: >>> SystemError: bad call flags This new behavi

[issue39762] PyLong_AS_LONG missing from longobject.h

2020-03-04 Thread Enji Cooper
Enji Cooper added the comment: > The reason why there was the PyInt_AS_LONG macro is that it is very simple > and efficient. It never fails, because the value of the int object always > fits in the C long. PyInt_AsLong is much slower. If you know that the object > is int,

[issue39762] PyLong_AS_LONG missing from longobject.h

2020-02-26 Thread Enji Cooper
Enji Cooper added the comment: PyInt_AS_LONG doesn't exist on python 3, however: $ grep -r PyInt_AS_LONG /usr/include/ [/usr/include/python2.7/intobject.h:#define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival) The code smell for the pieces that use PyInt_AS_LONG seems a bit questiona

[issue39762] PyLong_AS_LONG missing from longobject.h

2020-02-26 Thread Enji Cooper
Enji Cooper added the comment: @serhiy.storchaka: understood. Figured this would be a good errata note for others to potentially find in the future. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39762] PyLong_AS_LONG missing from longobject.h

2020-02-26 Thread Enji Cooper
Enji Cooper added the comment: Workaround PR posted here: https://github.com/encukou/py3c/pull/28 -- ___ Python tracker <https://bugs.python.org/issue39

[issue39762] PyLong_AS_LONG missing from longobject.h

2020-02-26 Thread Enji Cooper
Enji Cooper added the comment: For the record, this seems like it might be the only discrepancy, per the py3c project's exported PyInt APIs: $ for api in `awk '$2 ~ /^PyInt/ { print $3 }' include/py3c/compat.h`; do grep -q $api /usr/include/python2.7/longobject.h || echo $api; done

[issue39762] PyLong_AS_LONG missing from longobject.h

2020-02-26 Thread Enji Cooper
Enji Cooper added the comment: For the record, some projects (like Cython, pywin32) worked around this by adding a preprocessor alias, PyLong_AS_LONG -> PyInt_AS_LONG with python 2.x. -- ___ Python tracker <https://bugs.python.org/issu

[issue39762] PyLong_AS_LONG missing from longobject.h

2020-02-26 Thread Enji Cooper
New submission from Enji Cooper : While trying to port python 2 C extension code forward to python 3, I noticed that the python 2.6 PyInt -> PyLong unification lacks a forward-compatible API for PyLong_AS_LONG. I'm not sure if this was intentional, but it is a slightly annoying wic

[issue39742] Enhancement: add `os.getdtablesize(..)` to `os` (`posix`) module

2020-02-24 Thread Enji Cooper
Change by Enji Cooper : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue39742> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39742] Enhancement: add `os.getdtablesize(..)` to `os` (`posix`) module

2020-02-24 Thread Enji Cooper
New submission from Enji Cooper : getdtablesize({2,3}) is a wonderful library call/system call to have access to because it allows one to determine the descriptor limits at runtime in an easier manner than having to do the equivalent with os.sysconf(..): >>> os.sysconf(os.sysc

[issue39565] Modules/signalmodule.c creates handlers for signals bounded by `NSIG`; requires fudging to support realtime signals, etc

2020-02-06 Thread Enji Cooper
Change by Enji Cooper : -- title: Modules/signalmodule.c creates handlers for signals bound by `NSIG`; requires fudging to support realtime signals, etc -> Modules/signalmodule.c creates handlers for signals bounded by `NSIG`; requires fudging to support realtime signals,

[issue39565] Modules/signalmodule.c creates handlers for signals bound by `NSIG`; requires fudging to support realtime signals, etc

2020-02-06 Thread Enji Cooper
Change by Enji Cooper : -- title: Modules/signalmodule.c only works with `NSIG` signals; requires fudging to support realtime signals, etc -> Modules/signalmodule.c creates handlers for signals bound by `NSIG`; requires fudging to support realtime signals,

[issue39565] Modules/signalmodule.c only works with `NSIG` signals; requires fudging to support realtime signals, etc

2020-02-05 Thread Enji Cooper
New submission from Enji Cooper : The code in Modules/signalmodule.c makes a number of assumptions of what signals are considered valid, as well as what handlers need to be setup as part of the core interpreter. For example: much of the initialization of signal handlers, etc, is actually

[issue18213] py-bt errors on backtrace with PyRun_SimpleString and friends

2020-02-05 Thread Enji Cooper
Enji Cooper added the comment: This particular issue has been resolved in python 3.x. -- nosy: +ngie ___ Python tracker <https://bugs.python.org/issue18

[issue38354] Fix for bug 30378 regressed SysLogHandler by making it resolve addresses at initialization instead of in `.emit()`

2019-10-02 Thread Enji Cooper
Enji Cooper added the comment: Capturing more context here, based on internal discussion: other handlers are doing address resolution in `emit()` (HTTPHandler, SMTPHandler), which is expensive. In order for SysLogHandler to not regress behavior and not become expensive, performance-wise

[issue38354] Fix for bug 30378 regressed SysLogHandler by making it resolve addresses at initialization instead of in `.emit()`

2019-10-02 Thread Enji Cooper
Change by Enji Cooper : -- title: Fix for bug 30378 regressed SysLogHandler -> Fix for bug 30378 regressed SysLogHandler by making it resolve addresses at initialization instead of in `.emit()` ___ Python tracker <https://bugs.pyth

[issue38354] Fix for bug 30378 regressed SysLogHandler

2019-10-02 Thread Enji Cooper
New submission from Enji Cooper : The change made for bug 30378 caused a regression in our code by making lookups for SysLogHandler addresses at init time, instead of making them more lazy. Example: >>> import logging.handlers >>> LOGGER = logging.getLogger("logger&

[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2019-02-26 Thread Enji Cooper
Change by Enji Cooper : -- versions: +Python 2.7, Python 3.4, Python 3.5, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue13501> ___ ___

[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2019-02-26 Thread Enji Cooper
Enji Cooper added the comment: I'll try to rebase Martin's changes, as they don't apply to the master branch on GitHub today. -- ___ Python tracker <https://bugs.python.org/issue13

[issue36111] Non-zero `offset`s are no longer acceptable with SEEK_END/SEEK_CUR implementation of `seek` in python3 when in text mode, breaking py 2.x behavior/POSIX

2019-02-25 Thread Enji Cooper
Change by Enji Cooper : -- title: Non-zero `offset`s are no longer acceptable with implementation of `seek` in some cases with python3 when in text mode; should be per POSIX -> Non-zero `offset`s are no longer acceptable with SEEK_END/SEEK_CUR implementation of `seek` in pyth

[issue36111] Non-zero `offset`s are no longer acceptable with implementation of `seek` in some cases with python3 when in text mode; should be per POSIX

2019-02-25 Thread Enji Cooper
Change by Enji Cooper : -- title: Negative `offset` values are no longer acceptable with implementation of `seek` with python3 when in text mode; should be per POSIX -> Non-zero `offset`s are no longer acceptable with implementation of `seek` in some cases with python3 when in t

[issue13497] Fix for broken nice test on non-broken platforms with pedantic compilers

2019-02-25 Thread Enji Cooper
Change by Enji Cooper : -- pull_requests: +12067 ___ Python tracker <https://bugs.python.org/issue13497> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue8747] Autoconf tests in python not portably correct

2019-02-25 Thread Enji Cooper
Enji Cooper added the comment: This issue has been superseded by other work. -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/

[issue36111] Negative `offset` values are no longer acceptable with implementation of `seek` with python3 when in text mode; should be per POSIX

2019-02-25 Thread Enji Cooper
Change by Enji Cooper : -- versions: +Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue36111> ___ ___

[issue36111] Negative `offset` values are no longer acceptable with implementation of `seek` with python3 when in text mode; should be per POSIX

2019-02-25 Thread Enji Cooper
Enji Cooper added the comment: Opening and seeking using SEEK_END worked in text mode with python 2.7. I'm not terribly sure why 3.x should depart from this behavior: >>> fp = open("configure", "rt"); fp.seek(-100, os.S

[issue36111] Negative `offset` values are no longer acceptable with implementation of `seek` with python3 when in text mode; should be per POSIX

2019-02-25 Thread Enji Cooper
Change by Enji Cooper : -- title: Negative `offset` values are no longer acceptable with implementation of `seek` with python3; should be per POSIX -> Negative `offset` values are no longer acceptable with implementation of `seek` with python3 when in text mode; should be per PO

[issue36111] Negative `offset` values are no longer acceptable with implementation of `seek` with python3; should be per POSIX

2019-02-25 Thread Enji Cooper
Enji Cooper added the comment: ?! Being blunt: why should opening a file in binary vs text mode matter? POSIX doesn't make this distinction. Per the pydoc (https://docs.python.org/2/library/functions.html#open): > The default is to use text mode, which may convert '\n' charact

[issue36111] Negative `offset` values are no longer acceptable with implementation of `seek` with python3; should be per POSIX

2019-02-25 Thread Enji Cooper
New submission from Enji Cooper : I tried using os.SEEK_END in a technical interview, but unfortunately, that didn't work with python 3.x: pinklady:cpython ngie$ python3 Python 3.7.2 (default, Feb 12 2019, 08:15:36) [Clang 10.0.0 (clang-1000.11.45.5)] on darwin Type "help",