[issue9870] compile and nested scopes

2010-09-16 Thread Sergey
New submission from Sergey : See attached tmp1.py It is very simple but it doesn't work It raises NameError NameError: global name 'arg' is not defined -- components: None files: tmp1.py messages: 116515 nosy: webcubator priority: normal severity: normal status: open tit

[issue32632] Mock does not create deepcopy of mutable args

2018-01-22 Thread Sergey
New submission from Sergey : MagicMock allows to check parameters of calls by using "assert_has_calls". However it fails if argument has a mutable type and was changed in-place before the second call. The example is provided in attached file. In "func1" value in &qu

[issue18305] [patch] Fast sum() for non-numbers

2013-06-25 Thread Sergey
New submission from Sergey: Problem === Code: sum([[1,2,3]]*100, []) takes forever to complete. Suggestion == Patch sum() function so that it did not created 100 copies of result, but created just one. Attached patch does that. Before patch: $ ./python -mtimeit --setup

[issue18305] [patch] Fast sum() for non-numbers

2013-06-28 Thread Sergey
Sergey added the comment: > The issue of quadratic performance of sum(sequences, null_seq) is known I hope it's never too late to fix some bugs... :) > sum([[1,2,3]]*n, []) == [1,2,3]*n == list(chain.from_iterable([[1,2,3]]*n)) But if you already have a list of lists, and you need

[issue18305] [patch] Fast sum() for non-numbers

2013-07-02 Thread Sergey
Sergey added the comment: > I don't know about IronPython, but Jython and PyPy have same behavior as > CPython. Right. I was wrong, at least Jython and PyPy suffer from this bug too. > I think that it is worthwhile to discuss the idea at first in the > Python-Ideas mail

[issue18305] [patch] Fast sum() for non-numbers

2013-07-04 Thread Sergey
Sergey added the comment: This patch implements another solution to the same bug. But instead of changing default code it adds a special case optimization for lists, tuples and strings, similar to those two special cases for numbers, that are already there. === Lists === No patch

[issue18305] [patch] Fast sum() for non-numbers

2013-07-11 Thread Sergey
Sergey added the comment: Steven D'Aprano noticed that there's an obscure case of: >>> class A(list): ... def __add__(self, other): ... return A(super(A,self).__add__(other)) ... def __radd__(self, other): ... return A(other) + self ... Where: &

[issue18305] [patch] Fast sum() for non-numbers

2013-07-12 Thread Sergey
Sergey added the comment: > This "optimisation" is a semantic change. It breaks backward > compatibility in cases where a = a + b and a += b do not result > in the name a having the same value. In particular this breaks > backward compatibility for numpy users. I didn

[issue18305] [patch] Fast sum() for non-numbers

2013-07-14 Thread Sergey
Sergey added the comment: Attached fasttuple.py is a Proof-of-Concept implementation of tuple, that reuses same data storage when possible. Its possible usage looks similar to built-in tuples: from fasttuple import ft a = ft([1,2]) b = a + ft([3,4]) c = b + ft([5,6]) d = b + ft([7,8

[issue18305] [patch] Fast sum() for non-numbers

2013-07-14 Thread Sergey
Sergey added the comment: > I guess such implementation of tuple will increase memory usage > and creation time which are critical important for tuples. On the contrary, it will reduce memory usage and creation time compared to regular tuples, because in cases like: c = a + b you do no

[issue18305] [patch] Fast sum() for non-numbers

2013-07-15 Thread Sergey
Sergey added the comment: > This is not a common case. A common case is creating short tuples and keeping > a lot of tuples in memory. > For fast += you need keep not only a size of tuple, but also a size of > allocated memory. It's a cause of sys.getsizeof([1, 2]) > sy

[issue19496] Website link

2013-11-04 Thread Sergey
New submission from Sergey: Wrong ling following to Windows help file on the Python 2.7.6 RC 1 Web page. It is the following: http://www.python.org/ftp/python/2.7.6/python275.chm And should be: http://www.python.org/ftp/python/2.7.6/python276rc1.chm -- components: Build messages

[issue29678] email.Message.get_params decodes only first one header value

2017-02-28 Thread Sergey
New submission from Sergey: email.Message class has method get_params() that can decode(unquote) header values in compliance with RFC2231 and RFC2047. But if in email message exists multiple headers with the same key it can't be used to decode other headers than first. In my applicat

[issue29678] email.Message.get_params decodes only first one header value

2017-02-28 Thread Sergey
Changes by Sergey : -- type: behavior -> enhancement ___ Python tracker <http://bugs.python.org/issue29678> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue13688] ast.literal_eval fails on octal numbers

2011-12-31 Thread Sergey Dorofeev
New submission from Sergey Dorofeev : Python 3.2.2 (default, Nov 16 2011, 10:58:44) [C] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> import ast >>> ast.literal_eval('10') 10 >>> a

[issue13688] ast.literal_eval fails on octal numbers

2011-12-31 Thread Sergey Dorofeev
Sergey Dorofeev added the comment: python 3 feature - should use 0o10 need to rebuild data file :( -- resolution: -> rejected status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue11269] cgi.FieldStorage forgets to unquote field names when parsing multipart/form-data

2011-02-25 Thread Sergey Schetinin
Sergey Schetinin added the comment: It does work (Python 2.7.1 here): >>> import cgi >>> cgi.parse_header('Content-Disposition: form-data; name=""%22"') ('Content-Disposition: form-data', {'name': '"%22'}) &

[issue11269] cgi.FieldStorage forgets to unquote field names when parsing multipart/form-data

2011-02-25 Thread Sergey Schetinin
Sergey Schetinin added the comment: I wanted to add that the fact that browsers encode the field names in the page encoding does not change that they should escape the header according to RFC 2047. The percent-encoding used in the field name has nothing to do with multipart/form-data or

[issue11269] cgi.FieldStorage forgets to unquote field names when parsing multipart/form-data

2011-02-25 Thread Sergey Schetinin
Sergey Schetinin added the comment: I don't think that's a security issue, just something that would break with certain filenames. And I said that it's a browsers' problem in the sense that it can only be fixed /

[issue12098] Child process running as debug

2011-05-17 Thread Sergey Mezentsev
New submission from Sergey Mezentsev : I run this code: """ from multiprocessing import Pool def myfunc(x): assert False #if __debug__: print 'debug' return x - 1 if __name__ == '__main__': pool = Pool(processes=1) it = pool.imap(myfunc,

[issue12098] Child process running as debug

2011-05-17 Thread Sergey Mezentsev
Sergey Mezentsev added the comment: In my system (Windows 7 (64) SP1, Python 2.6.6 32-bit) I have: """ d:\temp>python -O pool.py ('parent optimize?', 1) ('child', 4712, 'optimize?', 0) (Traceback (most recent call last): ' File "new.p

[issue12098] Child process running as debug on Windows

2011-05-18 Thread Sergey Mezentsev
Sergey Mezentsev added the comment: I create patch for Popen.get_command_line() ('2.6' and 'default' branches). I don't know how to write the test. The sys.flags structure are read only. -- keywords: +patch Added file: http://bugs.python.org/file22021/Is

[issue12098] Child process running as debug on Windows

2011-05-18 Thread Sergey Mezentsev
Changes by Sergey Mezentsev : Added file: http://bugs.python.org/file22022/Issue12098.branch-default.patch ___ Python tracker <http://bugs.python.org/issue12098> ___ ___

[issue12098] Child process running as debug on Windows

2011-05-20 Thread Sergey Mezentsev
Changes by Sergey Mezentsev : Removed file: http://bugs.python.org/file22021/Issue12098.branch-2.6.patch ___ Python tracker <http://bugs.python.org/issue12098> ___ ___

[issue12098] Child process running as debug on Windows

2011-05-20 Thread Sergey Mezentsev
Changes by Sergey Mezentsev : Removed file: http://bugs.python.org/file22022/Issue12098.branch-default.patch ___ Python tracker <http://bugs.python.org/issue12

[issue12098] Child process running as debug on Windows

2011-05-20 Thread Sergey Mezentsev
Changes by Sergey Mezentsev : Added file: http://bugs.python.org/file22041/Issue12098.branch-2.6.patch ___ Python tracker <http://bugs.python.org/issue12098> ___ ___ Pytho

[issue12098] Child process running as debug on Windows

2011-05-20 Thread Sergey Mezentsev
Changes by Sergey Mezentsev : Added file: http://bugs.python.org/file22042/Issue12098.branch-default.patch ___ Python tracker <http://bugs.python.org/issue12098> ___ ___

[issue12098] Child process running as debug on Windows

2011-05-20 Thread Sergey Mezentsev
Sergey Mezentsev added the comment: I updated the patch. Added a test and remove arguments for frozen interpreter. -- ___ Python tracker <http://bugs.python.org/issue12

[issue10880] do_mkvalue and 'boolean'

2011-01-11 Thread Sergey Shepelev
Sergey Shepelev added the comment: Here's patch against 2.6 --- a/Python/modsupport.c Tue Aug 24 18:19:58 2010 +0200 +++ b/Python/modsupport.c Tue Jan 11 23:50:40 2011 +0300 @@ -459,6 +459,16 @@ return v; } +case '?': +{ +

[issue11269] cgi.FieldStorage forgets to unquote field names when parsing multipart/form-data

2011-02-21 Thread Sergey Schetinin
New submission from Sergey Schetinin : Tested on Python 2.7, but probably affects all versions. Test case is attached. The reason this went unnoticed until now is that browsers are very conservative when quoting field names, so most field names are the same after their quoting. Related bug in

[issue11269] cgi.FieldStorage forgets to unquote field names when parsing multipart/form-data

2011-02-21 Thread Sergey Schetinin
Sergey Schetinin added the comment: And here's a patch. -- keywords: +patch Added file: http://bugs.python.org/file20820/cgi-patch.patch ___ Python tracker <http://bugs.python.org/is

[issue11269] cgi.FieldStorage forgets to unquote field names when parsing multipart/form-data

2011-02-21 Thread Sergey Schetinin
Sergey Schetinin added the comment: I've dug into the RFCs and tested various browsers. RFC 2388 (the one defining multipart/form-data) says: Field names originally in non-ASCII character sets may be encoded within the value of the "name" parameter using the standard method d

[issue3909] Building PDF documentation from tex files

2008-10-15 Thread Sergey Lipnevich
Sergey Lipnevich <[EMAIL PROTECTED]> added the comment: I don't know what the proper procedure is (reopening or filing a new ticket), but I see this problem with Sphinx 0.5dev-20081015 and Python 2.6 on Windows XP. The change recommended by Winfried in msg73874 seems to fix it (pat

[issue47240] Python 3.x built for ppc+ppc64 errs on: No module named 'msvcrt', '_posixsubprocess'

2022-04-06 Thread Sergey Fedorov
New submission from Sergey Fedorov : While adding definitions for additional universal binary option (ppc+ppc64) is rather straightforward (following already existing examples in the source code), and Python 3.x after patching do build as universal for named two arch, trying to install any

[issue37837] add internal _PyLong_FromUnsignedChar() function

2019-08-13 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : When compiled with default NSMALLPOSINTS, _PyLong_FromUnsignedChar() is significantly faster than other PyLong_From*(): $ python -m perf timeit -s "from collections import deque; consume = deque(maxlen=0).extend; b = bytes(2**20)" "consume

[issue37837] add internal _PyLong_FromUnsignedChar() function

2019-08-13 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +14971 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15251 ___ Python tracker <https://bugs.python.org/issu

[issue37840] bytearray_getitem() handles negative index incorrectly

2019-08-13 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : bytearray_getitem() adjusts negative index, though that's already done by PySequence_GetItem(). This makes PySequence_GetItem(bytearray(1), -2) to return 0 instead of raise IndexError. -- components: Interpreter Core messages: 349545 nosy

[issue37840] bytearray_getitem() handles negative index incorrectly

2019-08-13 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +14972 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15250 ___ Python tracker <https://bugs.python.org/issu

[issue37842] Initialize Py_buffer variables more efficiently

2019-08-13 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : Argument Clinic generates `{NULL, NULL}` initializer for Py_buffer variables. Such initializer zeroes all Py_buffer members, but as I understand only `obj` and `buf` members are really had to be initialized. Avoiding unneeded initialization provides tiny

[issue37842] Initialize Py_buffer variables more efficiently

2019-08-13 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +14975 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15254 ___ Python tracker <https://bugs.python.org/issu

[issue37907] speed-up PyLong_As*() for large longs

2019-08-21 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : PyLong_As*() functions computes result for large longs like this: size_t x, prev; x = 0; while (--i >= 0) { prev = x; x = (x << PyLong_SHIFT) | v->ob_digit[i]; if ((x >> PyLong_SHIFT) != prev) { *overflow = sign;

[issue37907] speed-up PyLong_As*() for large longs

2019-08-21 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +15074 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15363 ___ Python tracker <https://bugs.python.org/issu

[issue27961] remove support for platforms without "long long"

2019-08-22 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- pull_requests: +15094 pull_request: https://github.com/python/cpython/pull/15385 ___ Python tracker <https://bugs.python.org/issue27

[issue27961] remove support for platforms without "long long"

2019-08-22 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- pull_requests: +15095 pull_request: https://github.com/python/cpython/pull/15386 ___ Python tracker <https://bugs.python.org/issue27

[issue27961] remove support for platforms without "long long"

2019-08-22 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- pull_requests: +15098 pull_request: https://github.com/python/cpython/pull/15388 ___ Python tracker <https://bugs.python.org/issue27

[issue37938] refactor PyLong_As*() functions

2019-08-24 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +15152 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15457 ___ Python tracker <https://bugs.python.org/issu

[issue37938] refactor PyLong_As*() functions

2019-08-24 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : PyLong_As*() functions have a lot of duplicated code, creating draft PR with attempt to deduplicate them. -- components: Interpreter Core messages: 350367 nosy: sir-sigurd priority: normal severity: normal status: open title: refactor PyLong_As

[issue37837] add internal _PyLong_FromUnsignedChar() function

2019-08-24 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: $ gcc -v 2>&1 | grep 'gcc version' gcc version 8.3.0 (Debian 8.3.0-19) using ./configure --enable-optimizations --with-lto $ python -m perf timeit -s "from collections import deque; consume = deque(maxlen=0).extend; b = bytes(2**20)&qu

[issue37802] micro-optimization of PyLong_FromSize_t()

2019-08-25 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: Previous benchmarks results were obtained with non-LTO build. Here are results for LTO build: $ python -m perf timeit -s "from itertools import repeat; _len = repeat(None, 0).__length_hint__" "_len()" --compare-to=../cpython-ma

[issue37837] add internal _PyLong_FromUnsignedChar() function

2019-08-25 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: These last results are invalid :-) I thought that I was checking _PyLong_FromUnsignedChar() on top of GH-15192, but that wasn't true. So the correct results for LTO build are: $ python -m perf timeit -s "from collections import deque; consum

[issue37973] improve docstrings of sys.float_info

2019-08-28 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : In [8]: help(sys.float_info) ... | | dig | DBL_DIG -- digits | This is not very helpful, https://docs.python.org/3/library/sys.html#sys.float_info is more verbose, so probably docstrings should be updated from where. -- assignee

[issue37974] zip() docstring should say 'iterator' instead of 'object with __next__()'

2019-08-28 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : In [3]: help(zip) class zip(object) | zip(*iterables) --> zip object | | Return a zip object whose .__next__() method returns a tuple where | the i-th element comes from the i-th iterable argument. The .__next__() | method continues until

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : zip() shadows TypeError raised in __iter__() of source iterable: In [21]: class Iterable: ...: def __init__(self, n): ...: self.n = n ...: def __iter__(self): ...: return iter(range(self.n)) ...: In [22

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +15268 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15592 ___ Python tracker <https://bugs.python.org/issu

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: Maybe it's not clear from description, but traceback only show the line with zip(), so it doesn't help at localizing the source of exception at all. You only see that 'argument #N must support iteration', but that argument has __iter_

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: Also using this example class: In [5]: iter(Iterable('one')) --- TypeError Traceback (most recent call last) in () > 1 iter(Iterable

[issue37976] zip() shadows TypeError raised in __iter__() of source iterable

2019-08-29 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: > map() does not have anything special. Just for the reference, in Python 2.7 map() has the same behavior and it caused many problems for me and other people working with/developing Django. -- ___ Python trac

[issue37986] Improve perfomance of PyLong_FromDouble()

2019-08-30 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : This patch simplifies fast path for floats that fit into C long and moves it from float.__trunc__ to PyLong_FromDouble(). +-+-+--+ | Benchmark | long-from-float-ref | long-from

[issue38015] inline function generates slightly inefficient machine code

2019-09-06 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- pull_requests: +15372 pull_request: https://github.com/python/cpython/pull/15718 ___ Python tracker <https://bugs.python.org/issue38

[issue38015] inline function generates slightly inefficient machine code

2019-09-06 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: I added similar patch that replaces get_small_int() with macro version, since it also induces unnecessary casts and makes machine code less efficient. Example assembly can be checked at https://godbolt.org/z/1SjG3E. This change produces tiny, but

[issue38015] inline function generates slightly inefficient machine code

2019-09-07 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: I use GCC 9.2. -- ___ Python tracker <https://bugs.python.org/issue38015> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38079] _PyObject_VAR_SIZE should avoid arithmetic overflow

2019-09-09 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +15471 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14838 ___ Python tracker <https://bugs.python.org/issu

[issue38094] unneeded assignment to wb.len in PyBytes_Concat using buffer protocol

2019-09-10 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +15517 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15274 ___ Python tracker <https://bugs.python.org/issu

[issue38147] add macro for __builtin_unreachable

2019-09-12 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : GCC (along with Clang and ICC) has __builtin_unreachable() and MSVC has __assume() builtins, that can be used to optimize out unreachable conditions. So we could add macro like this: #ifdef Py_DEBUG # define Py_ASSUME(cond) (assert(cond)) #else # if

[issue38205] Python no longer compiles without small integer singletons

2019-09-17 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: I believe that the problem is caused by the change in Py_UNREACHABLE() (https://github.com/python/cpython/commit/3ab61473ba7f3dca32d779ec2766a4faa0657923). Before the mentioned commit Py_UNREACHABLE() was an expression, now it's a block. Py_UNREAC

[issue38205] Python no longer compiles without small integer singletons

2019-09-17 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: Also quote from Py_UNREACHABLE() doc: > Use this in places where you might be tempted to put an assert(0) or abort() > call. https://github.com/python/cpython/commit/6b519985d23bd0f0bd072b5d5d5f2c60a81a19f2 does exactly that, it replaces assert(0

[issue38211] clean up type_init()

2019-09-18 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : I wrote patch that cleans up type_init(): 1. Removes conditions already checked by assert() 2. Removes object_init() call that effectively creates an empty tuple and checks that this tuple is empty -- messages: 352710 nosy: sir-sigurd priority

[issue38211] clean up type_init()

2019-09-18 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +15852 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16257 ___ Python tracker <https://bugs.python.org/issu

[issue38205] Py_UNREACHABLE() no longer behaves as a function call

2019-09-19 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: FWIW I proposed to add Py_ASSUME() macro that uses __builtin_unreachable() in bpo-38147. -- ___ Python tracker <https://bugs.python.org/issue38

[issue38147] add macro for __builtin_unreachable

2019-09-19 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: > If you care of _PyLong_Copy() performance, you should somehow manually inline > _PyLong_New() inside _PyLong_Copy(). It doesn't solve this: > We could add a function that bypass that check, but in LTO build > PyObject_MALLOC(

[issue35696] remove unnecessary operation in long_compare()

2019-09-20 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: These warnings are caused by https://github.com/python/cpython/commit/c6734ee7c55add5fdc2c821729ed5f67e237a096. I'd fix them, but I'm not sure if we are going to restore CHECK_SMALL_INT() ¯\_(ツ)_/¯ -- nosy: +

[issue38517] functools.cached_property should support partial functions and partialmethod's

2019-10-22 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: issue38524 is related. -- nosy: +sir-sigurd ___ Python tracker <https://bugs.python.org/issue38517> ___ ___ Python-bugs-list m

[issue38524] functools.cached_property is not supported for setattr

2019-10-22 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- nosy: +sir-sigurd ___ Python tracker <https://bugs.python.org/issue38524> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15907] move doctest test-data files into a subdirectory of Lib/test

2021-05-06 Thread Sergey Polischouck
Change by Sergey Polischouck : -- nosy: +polischouckserg ___ Python tracker <https://bugs.python.org/issue15907> ___ ___ Python-bugs-list mailing list Unsub

[issue44071] Syntax error in Python3 documentation

2021-05-07 Thread Sergey Maslyakov
New submission from Sergey Maslyakov : https://docs.python.org/3/library/subprocess.html#subprocess.check_output The code sample seems to have a misplaced closing round bracket. It should go after "stdout" ``` run(..., check=True, stdout=PIPE).stdout ``` -- assignee: d

[issue44071] Syntax error in Python3 documentation

2021-05-07 Thread Sergey Maslyakov
Sergey Maslyakov added the comment: Thank you, Dennis! I was wrong. Closing the ticket. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39759] os.getenv documentation is misleading

2021-07-02 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- nosy: +sir-sigurd ___ Python tracker <https://bugs.python.org/issue39759> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44022] urllib http client possible infinite loop on a 100 Continue response

2021-07-05 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- nosy: +sir-sigurd nosy_count: 8.0 -> 9.0 pull_requests: +25593 pull_request: https://github.com/python/cpython/pull/27033 ___ Python tracker <https://bugs.python.org/issu

[issue45818] socketserver.BaseRequestHandler inherited class

2021-11-16 Thread Sergey M.
New submission from Sergey M. : Due to ```python try: self.handle() finally: self.finish() ``` construct in `socketserver.BaseRequestHandler.__init__()` method inherited classes with `overrided __init__()` method may suffer from incomplete initialization. For example, in the

[issue37347] Reference-counting problem in sqlite

2019-11-28 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- pull_requests: +16894 pull_request: https://github.com/python/cpython/pull/17413 ___ Python tracker <https://bugs.python.org/issue37

[issue27961] remove support for platforms without "long long"

2019-12-09 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- pull_requests: +17021 pull_request: https://github.com/python/cpython/pull/17539 ___ Python tracker <https://bugs.python.org/issue27

[issue40302] Add pycore_byteswap.h internal header file with _Py_bswap32() function

2020-05-10 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- nosy: +sir-sigurd nosy_count: 3.0 -> 4.0 pull_requests: +19338 pull_request: https://github.com/python/cpython/pull/15659 ___ Python tracker <https://bugs.python.org/issu

[issue41141] remove unneeded handling of '.' and '..' from patlib.Path.iterdir()

2020-06-27 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : Currently patlib.Path.iterdir() filters out '.' and '..'. It's unneeded since patlib.Path.iterdir() uses os.listdir() under the hood, which returns neither '.' nor '..'. https://docs.python.org/3/library/os.ht

[issue41141] remove unneeded handling of '.' and '..' from patlib.Path.iterdir()

2020-06-27 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +20336 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21179 ___ Python tracker <https://bugs.python.org/issu

[issue41415] duplicated signature of dataclass in help()

2020-07-27 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : In [191]: import dataclasses, pydoc In [192]: @dataclass ...: class C: ...: pass ...: In [193]: print(pydoc.render_doc(C)) Python Library Documentation: class C in module __main__ class C(builtins.object) | C() -> None | |

[issue41415] duplicated signature of dataclass in help()

2020-07-27 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +20793 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21652 ___ Python tracker <https://bugs.python.org/issu

[issue26834] Add truncated SHA512/224 and SHA512/256

2020-08-07 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- nosy: +sir-sigurd ___ Python tracker <https://bugs.python.org/issue26834> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35276] Document thread safety

2020-08-24 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- nosy: +sir-sigurd ___ Python tracker <https://bugs.python.org/issue35276> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33239] tempfile module: functions with the 'buffering' option are incorrectly documented

2020-09-13 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- nosy: +sir-sigurd nosy_count: 4.0 -> 5.0 pull_requests: +21279 pull_request: https://github.com/python/cpython/pull/21763 ___ Python tracker <https://bugs.python.org/issu

[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2020-10-08 Thread Sergey Nudnou
Sergey Nudnou added the comment: Hello, I've just run into a related issue. I have a python script, which starts an another python script using subprocess.Popen(). The parent script gets pid of the child and monitors up its activity through a database by this pid. The child script up

[issue14313] zipfile does not unpack files from archive (files extracted have zero length)

2012-03-14 Thread Sergey Dorofeev
New submission from Sergey Dorofeev : unzip does extract files but zipfile no works fine with python2.7 but fails with python 3.2.2 tested on solaris 11 express and windows xp >>> import zipfile >>> zipfile.ZipFile("test.zip") >>> z=_ >>>

[issue31862] Port the standard library to PEP 489 multiphase initialization

2019-05-22 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- pull_requests: +13420 ___ Python tracker <https://bugs.python.org/issue31862> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34488] improve performance of BytesIO.writelines() by avoiding creation of unused PyLongs

2019-08-02 Thread Sergey Fedoseev
Sergey Fedoseev added the comment: `BytesIO.write()` and `BytesIO.writelines()` are independent of each other. -- ___ Python tracker <https://bugs.python.org/issue34

[issue37802] micro-optimization of PyLong_FromSize_t()

2019-08-09 Thread Sergey Fedoseev
New submission from Sergey Fedoseev : Currently PyLong_FromSize_t() uses PyLong_FromLong() for values < PyLong_BASE. It's suboptimal because PyLong_FromLong() needs to handle the sign. Removing PyLong_FromLong() call and handling small ints directly in PyLong_FromSize_t() makes i

[issue37802] micro-optimization of PyLong_FromSize_t()

2019-08-09 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- keywords: +patch pull_requests: +14924 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15192 ___ Python tracker <https://bugs.python.org/issu

[issue30856] unittest.TestResult.addSubTest should be called immediately after subtest finishes

2017-07-05 Thread Sergey Fedoseev
New submission from Sergey Fedoseev: Currently TestResult.addSubTest() is called just before TestResult.stopTest(), but docs says that addSubTest is "Called when a subtest finishes". IMO that means that it will be called immediately after subtest finishes, but not after indefinite t

[issue30856] unittest.TestResult.addSubTest should be called immediately after subtest finishes

2017-07-05 Thread Sergey Fedoseev
Changes by Sergey Fedoseev : -- components: +Library (Lib) ___ Python tracker <http://bugs.python.org/issue30856> ___ ___ Python-bugs-list mailing list Unsub

[issue31059] asyncio.StreamReader.read hangs if n<0

2017-07-27 Thread Sergey Kostyuk
New submission from Sergey Kostyuk: Good day Maybe I misunderstood something, but I'm failed to fetch any data by calling asyncio.StreamReader.read if `n` is less than zero (or left default). It just hangs in the loop forever (see line number 614 of asyncio/streams.py: https://githu

[issue31108] add __contains__ for list_iterator (and others) for better performance

2017-08-02 Thread Sergey Fedoseev
Changes by Sergey Fedoseev : -- pull_requests: +3025 ___ Python tracker <http://bugs.python.org/issue31108> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31108] add __contains__ for list_iterator (and others) for better performance

2017-08-02 Thread Sergey Fedoseev
New submission from Sergey Fedoseev: > python -mtimeit -s "l = list(range(10))" "l[-1] in l" 1000 loops, best of 3: 1.34 msec per loop > python -mtimeit -s "l = list(range(10))" "l[-1] in iter(l)" >

  1   2   3   >