[issue35537] use os.posix_spawn in subprocess

2019-01-16 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > One of the issue that I have with using posix_spawn() is that the *exact* > behavior of subprocess is not properly defined by test_subprocess. Should we > more more tests, or document that the exact behavior is "an implementation > de

[issue35537] use os.posix_spawn in subprocess

2019-01-16 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Hi, > As a disclaimer, I'm a FreeBSD developer interested in making sure we're > doing the right thing here. =) > May I ask what the above assessment is based on, and specifically what we > need to address? Hello, Kyle! That assessment

[issue35537] use os.posix_spawn in subprocess

2019-01-14 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Until muscl decides to provide an "#ifdef __MUSL__"-like or any way that it's > musl, I propose to not support musl: don't use os.posix_spawn() but > _posixsubprocess. FYI, I'm researching how to use vfork(), focusing on Linux, but I

[issue35537] use os.posix_spawn in subprocess

2019-01-13 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > * On FreeBSD, if setting posix_spawn() "attributes" or execute posix_spawn() > "file actions" fails, posix_spawn() succeed but the child process exits > immediately with exit code 127 without trying to call execv(). If

[issue35674] Expose os.posix_spawnp()

2019-01-13 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- nosy: +izbyshev ___ Python tracker <https://bugs.python.org/issue35674> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28108] Python configure fails to detect tzname on platforms that have it.

2018-12-23 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: The resolution of this [1] glibc bug report effectively says that the use of global variables tzname, timezone and daylight is not supported by glibc unless a POSIX-style TZ setting is used (which is probably never in real world). [1] https

[issue35537] use os.posix_spawn in subprocess

2018-12-23 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > * cwd posix_spawn_file_actions_addchdir_np() is scheduled for glibc 2.29 [1] and exists in Solaris [2] (though its suffix indicates that it's "non-portable" -- not in POSIX). POSIX also has a bug for this [7]. > * s

[issue35537] use os.posix_spawn in subprocess

2018-12-20 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > I'm open to experiment to use vfork() in _posixsubprocess Are you going to do experiments? If not, I can try to do some in early January. > Using vfork() can cause new issues: that's why there is a > POSIX_SPAWN_USE_VFORK flag (the c

[issue35537] use os.posix_spawn in subprocess

2018-12-20 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Victor and Joannah, thanks for working on adding vfork() support to subprocess. Regarding speedups in the real world, I can share a personal anecdote. Back at the time when AOSP was built with make (I think it was AOSP 5) I've observed ~2x slowdown

[issue35537] use os.posix_spawn in subprocess

2018-12-20 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Serhiy, PyOS_* functions are called only if preexec_fn != None. But it will never be possible to implement support for preexec_fn (and some other subprocess features, e.g. close_fds) if processes are run via posix_spawn, so I don't see why anything should

[issue35537] use os.posix_spawn in subprocess

2018-12-19 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- nosy: +gregory.p.smith, izbyshev ___ Python tracker <https://bugs.python.org/issue35537> ___ ___ Python-bugs-list mailin

[issue35430] Lib/argparse.py uses `is` for string comparison

2018-12-06 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: argparse.SUPPRESS is an opaque value to be used by argparse clients. It could be anything, it just happens to be a string. So the code doesn't compare strings but checks whether a supplied object *is* the opaque value. I do not see any problem

[issue35418] python hung or stuck somtimes randomly on windows server 2008R2

2018-12-05 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: How is it possible to use faulthandler if the interpreter hasn't even started yet? -- ___ Python tracker <https://bugs.python.org/issue35

[issue35418] python hung or stuck somtimes randomly on windows server 2008R2

2018-12-05 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: You might try to check the list of DLLs loaded into the stuck python process and find third-party ones (e.g., antivirus). If there are any, disable the third-party software and try again. -- nosy: +izbyshev

[issue10496] Python startup should not require passwd entry

2018-12-05 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Would it make sense to backport this fix in 3.6 and 3.7? I'd like to see it there, given that this bug surfaced in many use cases not involving any modern features or systemd at all. -- ___ Python trac

[issue10496] Python startup should not require passwd entry

2018-12-05 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > I prefer to stick to the initial bug report which hasn't been fixed in 8 years I'm interested in fixing this bug too since it bit me in SCons and I had to use a local patch for it. I welcome the upstream fix and don't object to PR 10919.

[issue10496] Python startup should not require passwd entry

2018-12-05 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: If I understood PR 10919 correctly, sysconfig.get_config_var('userbase') can now return unexpanded paths containing '~'. Is it intended despite the previous discussion starting with msg135047? -- nosy: +izbyshev

[issue35385] time module: why not using tzname from the glibc?

2018-12-03 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: See #28108 and https://sourceware.org/bugzilla/show_bug.cgi?id=23859 (for msg276123). -- nosy: +izbyshev ___ Python tracker <https://bugs.python.org/issue35

[issue35322] test_datetime leaks memory on Windows

2018-11-27 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Correction: the fall-through in "else if (res == -3)" clause doesn't cause a memory leak, but still results in usage of uninitialized 'str'. -- ___ Python tracker <https://bugs.python.o

[issue34482] datetime: Tests for potential crashes due to non-UTF-8-encodable strings

2018-11-27 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: The added test exposed a leak in unicode_encode_locale(). See msg330534. -- ___ Python tracker <https://bugs.python.org/issue34

[issue35322] test_datetime leaks memory on Windows

2018-11-27 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: This is because of a leak of 'wstr' at https://github.com/python/cpython/blob/1005c84535191a72ebb7587d8c5636a065b7ed79/Objects/unicodeobject.c#L3476 . There is another leak and usage of uninitialized 'str' because the following "else if" clau

[issue35081] Move internal headers to Include/internal/

2018-11-15 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Oh, I never saw this warning before. It seems to not be included in -Wall. > Would you mind to open a new issue to discuss it? Victor, I've opened #35258 as you suggested. -- ___ Python tracker

[issue35258] Consider enabling -Wmissing-prototypes

2018-11-15 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : This issue is a follow-up of msg329608 of #35081. GCC and Clang have -Wmissing-prototypes[1] diagnostic that is reported if a global function is defined without a previous declaration containing a prototype. The reasons may be the following: 1

[issue35214] Get the test suite passing with clang Memory Sanitizer enabled

2018-11-15 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- nosy: +izbyshev ___ Python tracker <https://bugs.python.org/issue35214> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35081] Move internal headers to Include/internal/

2018-11-10 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Victor, you moved declarations of some functions to other headers, but didn't include the new headers into files that implement the functions in some cases. For example, _PyGILState_Init was moved into Include/internal/pycore_lifecycle.h

[issue35204] Disable thread and memory sanitizers for address_in_range()

2018-11-09 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I've submitted a PR which implements the change with additional cleanups. GCC introduced TSan together with ASan in 4.8[1], but didn't provide a macro to test for -fsanitize=thread option until 7[2,3]. [1] https://gcc.gnu.org/gcc-4.8/changes.html [2

[issue35204] Disable thread and memory sanitizers for address_in_range()

2018-11-09 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +9714 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35204> ___ ___ Py

[issue35204] Disable thread and memory sanitizers for address_in_range()

2018-11-09 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : address_in_range() in Objects/obmalloc.c may access memory that is mapped but is considered free by the underlying libc allocator. In #18596, address sanitizing was disabled for this function. But thread and memory sanitizers similarly trip

[issue35194] A typo in a constant in cp932 codec

2018-11-09 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: OUTCHAR2 is a wrong example. Other examples are NEXT_IN, NEXT_OUT. -- ___ Python tracker <https://bugs.python.org/issue35

[issue35194] A typo in a constant in cp932 codec

2018-11-09 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I've checked than other macros in Modules/cjkcodecs/cjkcodecs.h don't avoid multiple argument evaluation (e.g. OUTCHAR2, _TRYMAP_ENC), so I've changed 'assert' to a variant of what Serhiy suggested

[issue35194] A typo in a constant in cp932 codec

2018-11-09 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- pull_requests: +9707 ___ Python tracker <https://bugs.python.org/issue35194> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35194] A typo in a constant in cp932 codec

2018-11-09 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Maybe test "Py_CHARMASK(c) == (c)"? This is a good alternative if multiple evaluation of 'c' is acceptable. Though I'd prefer '(unsigned char)c == c' for this style of fixing because it is bit closer to what happens in '((*ou

[issue35194] A typo in a constant in cp932 codec

2018-11-09 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I've added 'assert' to macros. Since 'typeof' seems to be disallowed in Python, I've used 'unsigned int' as the type of an intermediate variable. Another alternative is 'assert(0 <= (c) && (c) <= 255)', but 'c' will be evaluated

[issue35194] A typo in a constant in cp932 codec

2018-11-09 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- pull_requests: +9706 ___ Python tracker <https://bugs.python.org/issue35194> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35194] A typo in a constant in cp932 codec

2018-11-08 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +9700 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35194> ___ ___ Py

[issue35194] A typo in a constant in cp932 codec

2018-11-08 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : UBSan with -fsanitize=implicit-integer-truncation found a suspicious one: /scratch2/izbyshev/cpython/Modules/cjkcodecs/_codecs_jp.c:43:17: runtime error: implicit conversion from type 'unsigned int' of value 4294966013 (32-bit, unsigned) to type 'unsigned

[issue35191] socket.setblocking(x) treats multiples of 2**32 as False

2018-11-08 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +9695 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35191> ___ ___ Py

[issue35191] socket.setblocking(x) treats multiples of 2**32 as False

2018-11-08 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : UBSAN with -fsanitize=implicit-integer-truncation reported a suspicious case: testSetBlocking_overflow (test.test_socket.NonBlockingTCPTests) ... /scratch2/izbyshev/cpython/Modules/socketmodule.c:2688:33: runtime error: implicit conversion from type

[issue35170] 3.7.1 compile failure on CentOS 6.10; _ctypes did not build

2018-11-06 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: The in-tree copy of libffi was removed in #27979 (between 3.6 and 3.7) for all platforms except Windows and macOS. Therefore, you need libffi development package installed in your system to build CPython 3.7. As for PIP, personally, I think that's

[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +9647 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35171> ___ ___ Py

[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : I've got the following on OpenSUSE Tumbleweed (glibc 2.27): == FAIL: test_TimeRE_recreation_timezone (test.test_strptime.CacheTests

[issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid}

2018-11-04 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +9620 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35161> ___ ___ Py

[issue35161] ASAN: stack-use-after-scope in grp.getgr{nam, gid} and pwd.getpw{nam, uid}

2018-11-04 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : ==24122==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fffb1c62550 at pc 0x006ec66c bp 0x7fffb1c62450 sp 0x7fffb1c62448 READ of size 8 at 0x7fffb1c62550 thread T0 #0 0x6ec66b in mkpwent /scratch2/izbyshev/cpython/Modules/pwdmodule.c

[issue35147] _Py_NO_RETURN is always empty on GCC

2018-11-02 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- pull_requests: +9612 ___ Python tracker <https://bugs.python.org/issue35147> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35147] _Py_NO_RETURN is always empty on GCC

2018-11-02 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- pull_requests: +9611 ___ Python tracker <https://bugs.python.org/issue35147> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35147] _Py_NO_RETURN is always empty on GCC

2018-11-02 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +9609 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35147> ___ ___ Py

[issue35147] _Py_NO_RETURN is always empty on GCC

2018-11-02 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : Non-existing __GNUC_MAJOR__ macro is used to check for GCC version at https://github.com/python/cpython/blob/b942707fc23454a998323c17e30be78ff1a4f0e7/Include/pyerrors.h#L97 . __GNUC__ should be used instead. -- components: Interpreter Core

[issue35091] Objects/listobject.c: gallop functions rely on signed integer overflow

2018-10-28 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > This doesn't actually matter - the code can never trigger. Yes, I considered this, and wondered why assert wasn't used in the first place, but the explicit check with a comment suggested that possibility of overflow was deemed real. I've submit

[issue35091] Objects/listobject.c: gallop functions rely on signed integer overflow

2018-10-28 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- pull_requests: +9520 ___ Python tracker <https://bugs.python.org/issue35091> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35091] Objects/listobject.c: gallop functions rely on signed integer overflow

2018-10-28 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- pull_requests: +9507 ___ Python tracker <https://bugs.python.org/issue35091> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35090] Potential division by zero and integer overflow in allocator wrappers

2018-10-28 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Sorry for changing the status, it's browser caching again. -- resolution: -> fixed status: open -> closed versions: -Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/i

[issue35090] Potential division by zero and integer overflow in allocator wrappers

2018-10-28 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Thanks, Victor. Regarding backporting, what about integer overflow? Do you think it's guaranteed that the multiple of items and size always fits in 32-bit types, in case of BZ2_Malloc and PyZlib_Malloc? -- resolution: fixed -> status: clo

[issue35090] Potential division by zero and integer overflow in allocator wrappers

2018-10-28 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- title: bz2: Potential division by zero in BZ2_Malloc() -> Potential division by zero and integer overflow in allocator wrappers ___ Python tracker <https://bugs.python.org/issu

[issue35090] bz2: Potential division by zero in BZ2_Malloc()

2018-10-28 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: May be we should add a new function (_PyMem_RawMallocItems?) that does the same checks as PyMem_RawCalloc, but doesn't zero-initialize memory? -- ___ Python tracker <https://bugs.python.org/issue35

[issue35091] Objects/listobject.c: gallop functions rely on signed integer overflow

2018-10-28 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +9498 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35091> ___ ___ Py

[issue35091] Objects/listobject.c: gallop functions rely on signed integer overflow

2018-10-28 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : gallop_left() and gallop_right() functions explicitly rely on overflowing behavior of Py_ssize_t (https://github.com/python/cpython/blob/6015cc50bc38b9e920ce4986ee10658eaa14f561/Objects/listobject.c#L1361): ofs = (ofs << 1) + 1; if (of

[issue35090] bz2: Potential division by zero in BZ2_Malloc()

2018-10-28 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +9497 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35090> ___ ___ Py

[issue35090] bz2: Potential division by zero in BZ2_Malloc()

2018-10-28 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : BZ2_Malloc() checks for size < 0 at https://github.com/python/cpython/blob/6015cc50bc38b9e920ce4986ee10658eaa14f561/Modules/_bz2module.c#L278 , but doesn't check for size == 0 before dividing by it: if (items < 0 || size < 0) re

[issue33015] Fix function cast warning in thread_pthread.h

2018-10-23 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Such casts will also trigger a CFI violation if somebody tries to build Python (and the libc, in this case) with a signature-based CFI [1, 2]. It checks that the compile-time callee signature matches the signature of the actually called function in runtime

[issue32890] os: Some functions may report bogus errors on Windows

2018-10-22 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Python 2.7 doesn't have the same issue. In os.execve(), posix_error() is used, but it is based on errno, which is correct. (A funny bit is that os.execve('', ['a'], {}) crashes in 2.7, probably because of some checks in CRT). And os.truncate

[issue32256] Make patchcheck.py work for out-of-tree builds

2018-10-20 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Thank you for testing and merging, Victor! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34780] Hang on startup if stdin refers to a pipe with an outstanding concurrent operation on Windows

2018-10-15 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Ping! Thanks to @eryksun for providing feedback here and for the patch review. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34874] Python 3.6.3 command script wrapped in single quotes produces NameError: name 'A' is not defined

2018-10-03 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: @Tim Is it possible that 'python3' in your command refers to some wrapper which forwards its arguments to real Python in a wrong way? -- nosy: +izbyshev ___ Python tracker <https://bugs.python.org/issue34

[issue34780] Hang on startup if stdin refers to a pipe with an outstanding concurrent operation on Windows

2018-09-23 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +8924 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34780> ___ ___ Py

[issue34780] Hang on startup if stdin refers to a pipe with an outstanding concurrent operation on Windows

2018-09-23 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : In the following code inspired by a production issue I had to debug recently subprocess.call() won't return: import os import subprocess import sys import time r, w = os.pipe() p1 = subprocess.Popen([sys.executable, '-c', 'import

[issue34760] Regression in abc in combination with passing a function to issubclass

2018-09-21 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- nosy: +izbyshev ___ Python tracker <https://bugs.python.org/issue34760> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23224] bz2/lzma: Compressor/Decompressor objects are only initialized in __init__

2018-09-18 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: bz2 in 2.7 is also affected. Victor, do we want to fix the crash at all in stable branches? If yes, IMHO taking the slight risk of __init__ -> __new__ change is preferable to taking the trouble to implement the alternative backwards-compatible fix (i

[issue34729] bz2/lzma: Compressor/decompressor crash if __init__ is not called

2018-09-18 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Reclosing (browser cache problem). -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34729] bz2/lzma: Compressor/decompressor crash if __init__ is not called

2018-09-18 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I somehow failed to notice #23224 when I searched the tracker. You're right, it's the same, and, moreover, PR 7822 fixes problem with both compressors and decompressors (though it includes tests only for the latter for some reason). I think

[issue34729] bz2/lzma: Compressor/decompressor crash if __init__ is not called

2018-09-18 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : The compressor/decompressor classes from bz2 and lzma modules rely on __init__() for initialization, but it is not guaranteed to be called. Method calls on an uninitialized object crash: >>> from bz2 import BZ2Compressor as C >>&g

[issue31779] assertion failures and a crash when using an uninitialized struct.Struct object

2018-09-15 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: What are the drawbacks of moving all code from __init__ to __new__, at least in master branch (3.8)? IMO it's much more robust than playing whack-a-mole both with ref/memleaks caused by repeated calls to __init__ and absence of initialization checks in all

[issue34697] ctypes: Crash if manually-created CField instance is used

2018-09-15 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : It is possible to manually create an instance of private CField type which is used by ctypes to represent fields of Structure and Union types. This instance will be uninitialized because it's normally initialized when instances of Structure/Union

[issue30262] Don't expose sqlite3 Cache and Statement

2018-09-15 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Some additional motivation for removing Cache: it may be used to crash the interpreter (#31734). -- nosy: +izbyshev ___ Python tracker <https://bugs.python.org/issue30

[issue34695] sqlite3: Cache.get() crashes if Cache.__init__() was not called

2018-09-15 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +8754 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34695> ___ ___ Py

[issue34695] sqlite3: Cache.get() crashes if Cache.__init__() was not called

2018-09-15 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : sqlite3.Cache allows users to create uninitialized instances because it relies on __init__() instead of __new__() for initialization, which can be skipped. Cache.get() crashes if called on an uninitialized instance: >>> from sqlite3 imp

[issue34649] Modules/_json.c: Missing NULL checks in _encoded_const()

2018-09-12 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +8656 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34649> ___ ___ Py

[issue34649] Modules/_json.c: Missing NULL checks in _encoded_const()

2018-09-12 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : The return value of PyUnicode_InternFromString() is not checked for NULL and then dereferenced at three places in https://github.com/python/cpython/blob/0bd1a2dcfdf36b181385ae61361e7692f4ebb0fd/Modules/_json.c#L1369 Reported by Svace static analyzer

[issue32236] open() shouldn't silently ignore buffering=1 in binary mode

2018-09-11 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Thank you, Gregory. I didn't intend to add the warning to stable branches -- it's just that 3.7 hasn't been released yet when this report was submitted. -- ___ Python tracker <https://bugs.python.org/issue32

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-09-11 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Thank you, Gregory! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34481] Different behavior of C and Python impls of datetime.strftime with non-UTF-8-encodable strings

2018-08-30 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > if we can't make assertions about the behavior of strftime outputs, I think > it makes it hard to prevent regressions. Ironically, some of the changes we may have to make to fix time.strftime() inconsistencies may appear like regressions to some

[issue34481] Different behavior of C and Python impls of datetime.strftime with non-UTF-8-encodable strings

2018-08-29 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: @p-ganssle > I'm finding it very difficult to reconcile these things. Paul, this issue was only about reconciling C and Python implementations of datetime module -- not fixing time.strftime(), which both of them delegate to. While the latter is certai

[issue34482] datetime: Tests for potential crashes due to non-UTF-8-encodable strings

2018-08-28 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Yes, I've referenced the relevant message from #6697 in #34454. The specific test you've referenced should be changed after #34481 is fixed -- it highlights inconsistency between C and Python implementations

[issue34502] Docs of sys.exit() mention utf8_mode for an unclear reason

2018-08-27 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Victor, but sys.flags docs *do* contain the note[1]: Changed in version 3.7: Added dev_mode attribute for the new -X dev flag and utf8_mode attribute for the new -X utf8 flag. I've tried to express that in msg324086, but obviously failed. [1] https

[issue34512] Document platform-specific strftime() behavior for non-ASCII format strings

2018-08-26 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +8424 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34512> ___ ___ Py

[issue34512] Document platform-specific strftime() behavior for non-ASCII format strings

2018-08-26 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : If a format string contains code points outside of ASCII range, time.strftime() can behave in four different ways depending on the platform, the current locale and the code points: * raise a UnicodeEncodeError * return an empty string * for surrogates

[issue34504] PySequence_Check: argument is dereferenced and then checked for NULL

2018-08-25 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +8407 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34504> ___ ___ Py

[issue34504] PySequence_Check: argument is dereferenced and then checked for NULL

2018-08-25 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : The argument of PySequence_Check() is dereferenced at https://github.com/python/cpython/blob/5f79b50763d687aeeed8edcb4efcc7ac9f8fa186/Objects/abstract.c#L1511 and then checked for NULL. Reported by Svace static analyzer. Since other PySomething_Check

[issue34503] Reference leak in PyErr_SetObject()

2018-08-25 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +8406 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34503> ___ ___ Py

[issue34503] Reference leak in PyErr_SetObject()

2018-08-25 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : 'exc_value' reference is leaked at https://github.com/python/cpython/blob/5f79b50763d687aeeed8edcb4efcc7ac9f8fa186/Python/errors.c#L113 -- components: Interpreter Core messages: 324099 nosy: benjamin.peterson, berker.peksag, izbyshev

[issue34501] PyType_FromSpecWithBases: spec->name is dereferenced before checking for NULL

2018-08-25 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: @enedil It seems that all later check either set a message or simply propagate the error set by a called function. Did you mean any specific later check? -- ___ Python tracker <https://bugs.python.org/issue34

[issue34501] PyType_FromSpecWithBases: spec->name is dereferenced before checking for NULL

2018-08-25 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +8402 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34501> ___ ___ Py

[issue34502] Docs of sys.exit() mention utf8_mode for an unclear reason

2018-08-25 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +8400 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34502> ___ ___ Py

[issue34502] Docs of sys.exit() mention utf8_mode for an unclear reason

2018-08-25 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : Docs for sys.exit() contain the following note added in https://github.com/python/cpython/blame/1871a4a35123b278443b960255cb14314ce196f6/Doc/library/sys.rst#L336 Changed in version 3.7: Added utf8_mode attribute for the new -X utf8 flag. Does it belong

[issue34501] PyType_FromSpecWithBases: spec->name is dereferenced before checking for NULL

2018-08-25 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : In the following snippet from PyType_FromSpecWithBases() in Objects/typeobject.c, spec->name is dereferenced by strrchr() but then is checked for NULL: /* Set the type name and qualname */ s = strrchr(spec->name, '.'); if (s =

[issue34492] Python/coreconfig.c: Fix _Py_wstrlist_copy()

2018-08-25 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- title: Python/coreconfig.c: Missing NULL check in _Py_wstrlist_copy() -> Python/coreconfig.c: Fix _Py_wstrlist_copy() ___ Python tracker <https://bugs.python.org/issu

[issue34492] Python/coreconfig.c: Missing NULL check in _Py_wstrlist_copy()

2018-08-25 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- versions: +Python 3.7 ___ Python tracker <https://bugs.python.org/issue34492> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34492] Python/coreconfig.c: Missing NULL check in _Py_wstrlist_copy()

2018-08-25 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- pull_requests: +8395 ___ Python tracker <https://bugs.python.org/issue34492> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34493] Objects/genobject.c: Missing NULL check in compute_cr_origin()

2018-08-24 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +8383 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34493> ___ ___ Py

[issue34493] Objects/genobject.c: Missing NULL check in compute_cr_origin()

2018-08-24 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : The return value of PyTuple_New() is not checked for NULL at https://github.com/python/cpython/blob/ef8861c112ed1dac9351958c121bc24ca4ecdb08/Objects/genobject.c#L1130 and then dereferenced. -- components: Interpreter Core messages: 324022 nosy

[issue34492] Python/coreconfig.c: Missing NULL check in _Py_wstrlist_copy()

2018-08-24 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +8382 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34492> ___ ___ Py

<    1   2   3   4   >