[issue32776] asyncio SIGCHLD scalability problems

2019-04-04 Thread twisteroid ambassador
twisteroid ambassador added the comment: The child watchers are documented now, see here: https://docs.python.org/3/library/asyncio-policy.html#process-watchers Sounds like FastChildWatcher https://docs.python.org/3/library/asyncio-policy.html#asyncio.FastChildWatcher is exactly what you

[issue36532] Example of logging.formatter with new str.format style

2019-04-04 Thread Fred L. Drake, Jr.
Change by Fred L. Drake, Jr. : -- nosy: +fdrake ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: From parsing a class to code object to class to mappingproxy to object (oh my!)

2019-04-04 Thread adam . preble
On Thursday, April 4, 2019 at 1:17:02 PM UTC-5, adam@gmail.com wrote: > Thanks for the response. I was meaning to write back earlier, but I've been > spending my free Python time in the evenings reimplementing what I'm doing to > work more correctly. I'm guessing before the code object

[issue32776] asyncio SIGCHLD scalability problems

2019-04-04 Thread Roman Evstifeev
Change by Roman Evstifeev : -- nosy: +Roman.Evstifeev ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36532] Example of logging.formatter with new str.format style

2019-04-04 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +12618 stage: -> patch review ___ Python tracker ___ ___

[issue36532] Example of logging.formatter with new str.format style

2019-04-04 Thread spaceman_spiff
Change by spaceman_spiff : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36532] Example of logging.formatter with new str.format style

2019-04-04 Thread spaceman_spiff
New submission from spaceman_spiff : It was not quite clear how to use the logging library with the new str.format style so I added an example in the logging cookbook -- assignee: docs@python components: Documentation messages: 339470 nosy: docs@python, spaceman_spiff priority: normal

[issue30588] Missing documentation for codecs.escape_decode

2019-04-04 Thread Gregory P. Smith
Change by Gregory P. Smith : -- stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30588] Missing documentation for codecs.escape_decode

2019-04-04 Thread Gregory P. Smith
Gregory P. Smith added the comment: We can't change it or remove it, it is public by virtue of its name. We should document it. Removing or renaming it to be _private requires a PendingDeprecationWarning -> DeprecationWarning -> removal cycle. it is well known and used.

[issue36530] Document codecs decode_encode() and encode_decode() APIs

2019-04-04 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue36530] Document codecs decode_encode() and encode_decode() APIs

2019-04-04 Thread Gregory P. Smith
Change by Gregory P. Smith : -- superseder: -> Missing documentation for codecs.escape_decode ___ Python tracker ___ ___

[issue36524] identity operator

2019-04-04 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: I want understand how this word wrap program playing on input

2019-04-04 Thread MRAB
On 2019-04-04 20:48, David Raymond wrote: Yep, spotted that too! :-) BTW, your fix also a bug: the last word on a line won't be followed by a space (off-by-one). The easiest fix for that is to add 1 to line_length initially, another little trick. Or, equivalently, to reset current_line_length

[issue36531] PyType_FromSpec wrong behavior with multiple Py_tp_members

2019-04-04 Thread Eddie Elizondo
Change by Eddie Elizondo : -- keywords: +patch pull_requests: +12617 stage: -> patch review ___ Python tracker ___ ___

[issue36531] PyType_FromSpec wrong behavior with multiple Py_tp_members

2019-04-04 Thread Eddie Elizondo
New submission from Eddie Elizondo : If a user accidentally defined more than one Py_tp_members in the spec, PyType_FromSpec will ignore all but the last use case. However, the number of members count will cause the type to allocate more memory than needed. This leads to weird behavior and

[issue36530] Document codecs decode_encode() and encode_decode() APIs

2019-04-04 Thread Gregory P. Smith
New submission from Gregory P. Smith : The codecs module has public decode_encode() and encode_decode() functions. They have never been documented, but are recommended for some uses such as:

[issue36524] identity operator

2019-04-04 Thread Rocco Santoro
Rocco Santoro added the comment: You are right. The documentation, that I know, is clear. Anyway in this case "is" and "==" provides the same outcome and this is my remark, that I called bug, wrongly. The reason is the nature of print(), as function, that always remains always NoneType with

[issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop

2019-04-04 Thread Eryk Sun
Eryk Sun added the comment: There's still a potential problem when Reg2Py calls wcslen(str[index]). This could be addressed by having fixupMultiSZ take an int array to store the length of each string. For example: static void fixupMultiSZ(wchar_t **strings, int *lengths, wchar_t

[issue35866] concurrent.futures deadlock

2019-04-04 Thread cagney
cagney added the comment: Here's the children; yes there are somehow 4 children sitting around. Hopefully this is enough to figure out where things deadlock. 29970 8752 8752 29970 pts/6 8752 Sl+ 1000 1:00 | | \_ ./v3.7.3/bin/python3 cf-deadlock.py 8752 8975 8752 29970

[issue36529] Python from WindowsStore: can't install package using "-m pip"

2019-04-04 Thread SilentGhost
Change by SilentGhost : -- components: +Demos and Tools -Installation nosy: +Marcus.Smith, dstufft, ncoghlan, paul.moore ___ Python tracker ___

[issue36524] identity operator

2019-04-04 Thread SilentGhost
SilentGhost added the comment: Rocco, == is an equality operator, "is" is used for identity testing. If you have an example of documentation that states that == is an identity operator, do report it and we'd be glad to fix it. The print function does not change the object, it's the print

[issue36525] Deprecate instancemethod

2019-04-04 Thread Josh Rosenberg
Josh Rosenberg added the comment: Actually, there is a use case, and it's one I've been intermittently trying to replicate ever since the functionality vanished in the Python 2 to 3 transition (or so I thought). The use case is taking an existing built-in function (as in a CPython function

[issue36524] identity operator

2019-04-04 Thread Rocco Santoro
Rocco Santoro added the comment: Thanks you very much for the explanations. I am sorry for bothering you, actually my question concerned the use of identity operator. I suggest that '==' means equal not identity. Therefore, it concerns the instance not the ontology and makes a comparison

Logging cf Reporting = Friday Filosofical Finking

2019-04-04 Thread DL Neil
Is the logging module an ideal means to provide (printed) user reports, or is it a 'bad fit' and not designed/fit for such a purpose? PSL's logging module (per discussion 'here' earlier this week) is often quietly avoided by 'the average Python programmer'. It is unwieldy, yet that is,

Re: I want understand how this word wrap program playing on input

2019-04-04 Thread DL Neil
Arup, On 5/04/19 7:33 AM, Arup Rakshit wrote: I am reading a Python book, where the author used a simple word wrap program to explain another concept. But I am not understanding some parts of the program. ... A technique for solving this sort of comprehension-problem is to simulate the

[issue36529] Python from WindowsStore: can't install package using "-m pip"

2019-04-04 Thread Ilya Kazakevich
New submission from Ilya Kazakevich : No packages could be installed with "-m pip" because of "Access Denied". It seems that it tries to install package to "site-packages' instead of "local-packages". However, "pip.exe" works. Does it mean "pip.exe" is patched somehow, but not python itself?

RE: I want understand how this word wrap program playing on input

2019-04-04 Thread David Raymond
> Yep, spotted that too! :-) BTW, your fix also a bug: the last word on a > line won't be followed by a space (off-by-one). The easiest fix for that > is to add 1 to line_length initially, another little trick. > Or, equivalently, to reset current_line_length to -1, which is an elegant > hack.

Re: I want understand how this word wrap program playing on input

2019-04-04 Thread Chris Angelico
On Fri, Apr 5, 2019 at 6:16 AM MRAB wrote: > > On 2019-04-04 19:53, David Raymond wrote: > > The function is constructing a list of the lines, which it will combine at > > the end. Answering the questions in reverse order: > > > > 3. Also why that `if` test is required there. > > The if

Re: I want understand how this word wrap program playing on input

2019-04-04 Thread MRAB
On 2019-04-04 19:53, David Raymond wrote: The function is constructing a list of the lines, which it will combine at the end. Answering the questions in reverse order: 3. Also why that `if` test is required there. The if statement is saying "I don't have room on my current line for the next

RE: I want understand how this word wrap program playing on input

2019-04-04 Thread David Raymond
The function is constructing a list of the lines, which it will combine at the end. Answering the questions in reverse order: 3. Also why that `if` test is required there. The if statement is saying "I don't have room on my current line for the next word, so time to start a new line" 2. In the

Re: I want understand how this word wrap program playing on input

2019-04-04 Thread Chris Angelico
On Fri, Apr 5, 2019 at 5:34 AM Arup Rakshit wrote: > lines_of_words = [] > current_line_length = line_length > for word in words: > if current_line_length + len(word) > line_length: > lines_of_words.append([]) # new line >

[issue36528] Remove duplicate tests in Lib/tests/re_tests.py

2019-04-04 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- keywords: +patch pull_requests: +12616 stage: -> patch review ___ Python tracker ___ ___

I want understand how this word wrap program playing on input

2019-04-04 Thread Arup Rakshit
I am reading a Python book, where the author used a simple word wrap program to explain another concept. But I am not understanding some parts of the program. def wrap(text, line_length): """Wrap a string to a specified line length""" words = text.split()

[issue35512] patch.dict resolves in_dict eagerly (should be late resolved)

2019-04-04 Thread Jason R. Coombs
Jason R. Coombs added the comment: Confirmed the fix. Thank you very much! -- ___ Python tracker ___ ___ Python-bugs-list mailing

Re: From parsing a class to code object to class to mappingproxy to object (oh my!)

2019-04-04 Thread adam . preble
On Monday, April 1, 2019 at 1:23:42 AM UTC-5, Gregory Ewing wrote: > adam.pre...@gmail.com wrote: > https://eli.thegreenplace.net/2012/06/15/under-the-hood-of-python-class-definitions > > Briefly, it creates a dict to serve as the class's namespace dict, > then executes the class body function

[issue6721] Locks in the standard library should be sanitized on fork

2019-04-04 Thread A. Jesse Jiryu Davis
Change by A. Jesse Jiryu Davis : -- nosy: -emptysquare ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6721] Locks in the standard library should be sanitized on fork

2019-04-04 Thread cagney
cagney added the comment: Below is a backtrace from the deadlock. It happens because the logging code is trying to acquire two per-logger locks; and in an order different to the random order used by the fork() handler. The code in question has a custom class DebugHandler(logging.Handler).

[issue36528] Remove duplicate tests in Lib/tests/re_tests.py

2019-04-04 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett ___ Python tracker ___ ___

[issue36528] Remove duplicate tests in Lib/tests/re_tests.py

2019-04-04 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : Currently Lib/tests/re_tests.py has duplicate elements in the tests list variable. This is a followup on https://github.com/python/cpython/pull/12662 where there seems to be around 100 elements that are duplicates in the list. This seems to have

[issue36524] identity operator

2019-04-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Rocco, please ask questions about Python on python-list or places like stackoverflow.com. 1. If python behavior puzzles you, the chance that it is a python bug is well less than 1 in 1000. 2. The answer you get will be much more visible to others who have

[issue34028] Python 3.7.0 wont compile with SSL Support 1.1.0 > alledged missing X509_VERIFY_PARAM_set1_host() support

2019-04-04 Thread David Chin
David Chin added the comment: OS: RHEL 6.8 I installed OpenSSL 1.1.1b from source into /usr/local. Because it's RHEL, the libs are in /usr/local/lib64 (as set up by default with the OpenSSL "make install") which the configure script does not seem to know about. My workaround: before

[issue6721] Locks in the standard library should be sanitized on fork

2019-04-04 Thread cagney
cagney added the comment: > acquiring locks before fork in the thread doing the forking and releasing > them afterwards is always the safe thing to do. It's also an easy way to cause a deadlock: - register_at_fork() et.al. will cause per-logger locks to be acquired before the global lock

RE: scalable bottleneck

2019-04-04 Thread Schachner, Joseph
If you are using Python 3, range does not create at list, it is a generator. If you're using Python 2.x, use xrange instead of range. xrange is a generator. In Python 3 there is no xrange, they just made range the generator. --- Joseph S. -Original Message- From: Sayth Renshaw

[issue36527] unused parameter warnings in Include/object.h (affecting building third party code)

2019-04-04 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +12615 stage: -> patch review ___ Python tracker ___ ___

[issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty

2019-04-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > But what's the use case of making somedict.__getitem__(x) fast? One should > just write somedict[x] instead. Using them in itertools functions. somedict.__getitem__ is faster that lambda: somedict[x]. As for map() and filter(), comprehensions are

[issue36527] unused parameter warnings in Include/object.h (affecting building third party code)

2019-04-04 Thread Dmitry Marakasov
New submission from Dmitry Marakasov : Python 3.8 and nightly introduces unused (in some cases) parameters in object.h header. This makes compilation of third party code which includes the header fail if it's built with -Werror. Build log excerpt: --- g++ -Wno-unused-result -Wsign-compare

[issue35866] concurrent.futures deadlock

2019-04-04 Thread cagney
cagney added the comment: More info from adding a faulthandler ... 15 def f(): 16 import ctypes 17 18 for i in range(0,50): 19 sys.stdout.write("\r%d" % i) 20 sys.stdout.flush() 21 signal.alarm(60*2) 22 for j in range(0,1000):

[issue36526] python crash when loading some .pyc file

2019-04-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Using random binary data instead of a .pyc file is an undefined behavior. .pyc file is a cache of the .py file. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty

2019-04-04 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty

2019-04-04 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > Amusingly, this is because of an old hack to make directly calling > somedict.__getitem__ fast: > https://github.com/python/cpython/commit/8f5cdaa784f555149adf5e94fd2e989f99d6b1db But what's the use case of making somedict.__getitem__(x) fast? One should

[issue36526] python crash when loading some .pyc file

2019-04-04 Thread SilentGhost
Change by SilentGhost : -- components: +Interpreter Core nosy: +serhiy.storchaka type: -> crash ___ Python tracker ___ ___

[issue36526] python crash when loading some .pyc file

2019-04-04 Thread Ahmed Soliman
New submission from Ahmed Soliman : I was fuzzing python pyc and I got this segmentation fault ``` ==25016==ERROR: AddressSanitizer: SEGV on unknown address 0x (pc 0x007d147f bp 0x7ffc6875cfc0 sp 0x7ffc6875c7e0 T0) ==25016==The signal is caused by a WRITE memory access.

[issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop

2019-04-04 Thread Zackery Spytz
Zackery Spytz added the comment: I've created a PR for this issue. -- nosy: +ZackerySpytz, eryksun versions: +Python 3.7, Python 3.8 -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker

[issue9194] winreg:fixupMultiSZ should check that P < Q in the inner loop

2019-04-04 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +12614 stage: test needed -> patch review ___ Python tracker ___ ___

[issue29883] asyncio: Windows Proactor Event Loop UDP Support

2019-04-04 Thread Alex Chandel
Alex Chandel added the comment: Could this be merged? UDP and pipes are critical for non-trivial asyncio programs on Windows, and this should be merged before the 3.8 feature window closes. -- nosy: +Alex Chandel ___ Python tracker

[issue36525] Deprecate instancemethod

2019-04-04 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- keywords: +patch pull_requests: +12613 stage: -> patch review ___ Python tracker ___ ___

[issue36525] Deprecate instancemethod

2019-04-04 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- title: Deprecate instance method -> Deprecate instancemethod ___ Python tracker ___ ___

[issue1587] instancemethod wrapper for PyCFunctions

2019-04-04 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > I'm tempted to call YAGNI on this. Indeed. See https://bugs.python.org/issue36525 -- nosy: +jdemeyer ___ Python tracker ___

[issue36525] Deprecate instance method

2019-04-04 Thread Jeroen Demeyer
New submission from Jeroen Demeyer : The "instance method" class is not used anywhere and there are no obvious use cases. We should just deprecate it to simplify Python. See discussion at https://mail.python.org/pipermail/python-dev/2019-April/156975.html -- messages: 339444 nosy:

[issue36524] identity operator

2019-04-04 Thread SilentGhost
SilentGhost added the comment: You seem to be confused by the fact that print function returns None and therefore all the comparisons you're making return False. There is not type vs "outcome" difference in your code sample. -- assignee: terry.reedy -> nosy: +SilentGhost

[issue36524] identity operator

2019-04-04 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure what you're asking here. You're comparing the result of the print function to a value. Print returns None, so it doesn't compare equal to any of the values you're comparing it to. To see what's happening, try: >>> print(None) == None None True

[issue36524] identity operator

2019-04-04 Thread Rocco Santoro
New submission from Rocco Santoro : Hi all Why the identity operator and '==' are both applied to the type (see above)? Is it not convenient to distinguish them? I mean the identity operator applied to the type and '==' applied to the outcome. Thanks for the attention Best regards Rocco

Re: requests

2019-04-04 Thread Rhodri James
On 04/04/2019 12:57, Jack Dangler wrote: Hi, all. Just getting started but already have an idea for something to save me some grief we have lists of files that reside on a sharepoint site at work that we pick from. These have a variety of data items in them and we need to start the process

[issue26415] Excessive peak memory consumption by the Python parser

2019-04-04 Thread Inada Naoki
Change by Inada Naoki : -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

requests

2019-04-04 Thread Jack Dangler
Hi, all. Just getting started but already have an idea for something to save me some grief we have lists of files that reside on a sharepoint site at work that we pick from. These have a variety of data items in them and we need to start the process by copying the entire contents into a local

[issue36347] Renaming the constants for the .flags of PyMemberDef

2019-04-04 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: For that, where did you see the macro was not used? maybe by an external library. -- ___ Python tracker ___

[issue36347] Renaming the constants for the .flags of PyMemberDef

2019-04-04 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- pull_requests: +12612 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16954] Add docstrings for ElementTree module

2019-04-04 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- stage: patch review -> needs patch versions: +Python 3.7, Python 3.8 -Python 3.4 ___ Python tracker ___

[issue36054] Way to detect CPU count inside docker container

2019-04-04 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: >Yes, not only but also support get real memory limit. > >look at >https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits Yep, but in this case, you have to create an other issue for the memory limit. --

[issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error

2019-04-04 Thread Petter S
Petter S added the comment: The pull request solves this problem, but the discussion over there is really slow. -- ___ Python tracker ___

[issue36521] Consider removing docstrings from co_consts in code objects

2019-04-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is for historical reasons. Currently statements consisting of a constant expression are not compiled to a bytecode and do not add a value to co_consts. But when this optimization was not yet added, the first element of co_consts with a

[issue36522] http/client.py does not print duplicate header values in debug

2019-04-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 3.6 take only security bugs fixes now. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 ___ Python tracker

[issue36522] http/client.py does not print duplicate header values in debug

2019-04-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6f9cd142a20d0d2a5825a9db376ce0ddf1933694 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.7': bpo-36522: Print all values for headers with multiple values. (GH-12681) (GH-12682)

[issue36523] missing docs for IOBase writelines

2019-04-04 Thread Marcin Niemira
Change by Marcin Niemira : -- keywords: +patch pull_requests: +12611 stage: -> patch review ___ Python tracker ___ ___

[issue36523] missing docs for IOBase writelines

2019-04-04 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +martin.panter ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36523] missing docs for IOBase writelines

2019-04-04 Thread Marcin Niemira
New submission from Marcin Niemira : Hey, There is a missing function doc in `io.IOBase` ```python import os help(io.IOBase.writelines) ``` produces output like: ``` Help on method_descriptor: writelines(self, lines, /) ``` I'll be happy to provide PR for this issue. Cheers, Marcin