[issue33026] Fix jumping out of "with" block

2018-03-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +5789 stage: -> patch review ___ Python tracker ___

[issue33026] Fix jumping out of "with" block

2018-03-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The proposed PR fixes jumping from "with" block. Currently the exit function is left on the stack. This fix is for 3.8 only. 3.7 and older versions are affected by this bug, but since the code was significantly changed in

[issue33019] Review usage of environment variables in the stdlib

2018-03-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: It's useful if you want to hide the fact that a command is implemented in Python and don't want it to malfunction if the user has PYTHONPATH set for some reason. -- ___ Python tracker

[issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders

2018-03-07 Thread Vitaly Kruglikov
New submission from Vitaly Kruglikov : ``` In [9]: from urllib.parse import urlencode, parse_qs In [10]: import ast, ssl In [11]: d = dict(cert_reqs=ssl.CERT_NONE) In [12]: urlencode(d) Out[12]: 'cert_reqs=VerifyMode.CERT_NONE' In [25]:

[issue33024] asyncio.WriteTransport.set_write_buffer_limits orders its args unintuitively and inconsistently with its companion function's return value

2018-03-07 Thread Vitaly Kruglikov
New submission from Vitaly Kruglikov : `asyncio.WriteTransport.set_write_buffer_limits()` uses an unintuitive order of the args (high, low). I would expect `low` to be the first arg, especially since `asyncio.WriteTransport.get_write_buffer_limits()` returns them in the

[issue33023] Unable to copy ssl.SSLContext

2018-03-07 Thread Vitaly Kruglikov
Change by Vitaly Kruglikov : -- assignee: -> christian.heimes components: +SSL nosy: +christian.heimes ___ Python tracker ___

[issue33023] Unable to copy ssl.SSLContext

2018-03-07 Thread Vitaly Kruglikov
New submission from Vitaly Kruglikov : ``` import copy import ssl copy.copy(ssl.create_default_context()) ``` results in `TypeError: can't pickle SSLContext objects` This prevents me from being able to `copy.deepcopy()` an object that references `ssl.SSLContext`. The

[issue33023] Unable to copy ssl.SSLContext

2018-03-07 Thread Vitaly Kruglikov
Change by Vitaly Kruglikov : -- type: -> crash ___ Python tracker ___ ___

[issue33022] Floating Point Arithmetic Inconsistency (internal off-by-one)

2018-03-07 Thread Tim Peters
Tim Peters added the comment: What did you expect? The precision of Python ints is limited only by the amount of memory you have, but Python floats are IEEE-754 double precision numbers, and have only 53 bits of precision. 2**53 + 1 simply can't be represented exactly as a

[issue33022] Floating Point Arithmetic Inconsistency (internal off-by-one)

2018-03-07 Thread Dylan Dmitri Gray
New submission from Dylan Dmitri Gray : ``` >>> for i in (1,2,3,1.0,2.0,3.0): print(i, i+9007199254740991) ... 1 9007199254740992 2 9007199254740993 3 9007199254740994 1.0 9007199254740992.0 2.0 9007199254740992.0 # <-- !!! 3.0 9007199254740994.0 ``` Notably

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-03-07 Thread Eric Appelt
Change by Eric Appelt : -- keywords: +patch pull_requests: +5788 stage: -> patch review ___ Python tracker ___

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-07 Thread pmpp
pmpp added the comment: josh.r. i think you are right, i was worried if a nfs sillyrename is in progress, for eg a lock file ,then server hangs but thread lift the GIL and allow another thread to try to start to fstat the same path. --

[issue18802] ipaddress documentation errors

2018-03-07 Thread Xiang Zhang
Xiang Zhang added the comment: Ahh, I also find some errors here in ipaddress doc and opened https://github.com/python/cpython/pull/6021 to fix them. -- assignee: -> docs@python components: +Documentation -Library (Lib) nosy: +docs@python, xiang.zhang versions:

[issue22822] IPv6Network constructor docs incorrect about valid input

2018-03-07 Thread Xiang Zhang
Change by Xiang Zhang : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> ipaddress documentation errors ___ Python tracker

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: fstat is async signal safe, and I suspect it's thread safe in general, though usage does rely on the file descriptor remaining valid. If the fd in question is closed in another thread after the GIL is released, fstat would fail;

[issue32972] unittest.TestCase coroutine support

2018-03-07 Thread Zachary Ware
Zachary Ware added the comment: Why is a metaclass required? Playing with a modified version of John's PR5938, it doesn't seem necessary. -- ___ Python tracker

[issue33001] Buffer overflow vulnerability in os.symlink on Windows (CVE-2018-1000117)

2018-03-07 Thread Steve Dower
Steve Dower added the comment: Thanks, Victor! -- ___ Python tracker ___ ___

[issue32972] unittest.TestCase coroutine support

2018-03-07 Thread Yury Selivanov
Yury Selivanov added the comment: > I'm really not seeing what a separate class buys you. I already mentioned in my previous comments that adding async support to unittest.TestCase would require us to add a metaclass to it, which is potentially a backwards incompatible

[issue32972] unittest.TestCase coroutine support

2018-03-07 Thread R. David Murray
R. David Murray added the comment: I agree with what Zach said in msg313352. I don't see how having a separate class affects the problem of what to use to run an async def test case. If "an AsyncTestCase should be enough" but "other frameworks will require a different

[issue33018] Improve issubclass() error checking and message

2018-03-07 Thread INADA Naoki
INADA Naoki added the comment: Hmm, normal class doesn't support issubclass(class-like. class). ``` Python 3.8.0a0 (heads/master:fc7df0e664, Mar 8 2018, 09:00:43) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import

[issue33018] Improve issubclass() error checking and message

2018-03-07 Thread INADA Naoki
INADA Naoki added the comment: issubclass(class-like, class-like) is allowed. I don't think raising type error for issubclass(class-like, ABC) is good idea. It should return False. -- ___ Python tracker

[issue33018] Improve issubclass() error checking and message

2018-03-07 Thread INADA Naoki
INADA Naoki added the comment: https://bugs.python.org/msg313396 -- ___ Python tracker ___

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-07 Thread pmpp
pmpp added the comment: is fstat thread safe ? -- nosy: +pmpp ___ Python tracker ___

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-07 Thread Nir Soffer
Change by Nir Soffer : -- pull_requests: +5787 ___ Python tracker ___ ___ Python-bugs-list

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Matt Harvey
Matt Harvey added the comment: @njs your sketch in msg313406 looks good. Probably better to go with OMP_NUM_THREADS than NCPUS. M -- ___ Python tracker

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-07 Thread Nir Soffer
Change by Nir Soffer : -- keywords: +patch pull_requests: +5786 stage: -> patch review ___ Python tracker ___

[issue33021] Some fstat() calls do not release the GIL, possibly hanging all threads

2018-03-07 Thread Nir Soffer
New submission from Nir Soffer : If the file descriptor is on a non-responsive NFS server, calling fstat() can block for long time, hanging all threads. Most of the fstat() calls release the GIL around the call, but some calls seems to be forgotten. In python 3, the calls are

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Nathaniel Smith
Nathaniel Smith added the comment: > You mean duplicating "nproc"'s logic in Python? Yeah. > If someone wants to do the grunt work of implementing/testing it... Well, that's true of any bug fix / improvement :-). The logic isn't terribly complicated though, something roughly

[issue33019] Review usage of environment variables in the stdlib

2018-03-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: I may be mistaken, what's the use of -E if not for security? -- ___ Python tracker ___

[issue33019] Review usage of environment variables in the stdlib

2018-03-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: I don't think -E is a security feature. Even if the stdlib was fixed, there's tons of 3rdparty Python code that consumes os.environ. It seems like if you really cared about not letting the environment influence a Python application,

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Nathaniel Smith
Nathaniel Smith added the comment: I can't find any evidence that NPROCS is used by other batch schedulers (I looked at SLURM, Torque, and SGE). @M J Harvey, do you have any other examples of systems that use it? -- ___ Python

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > So this seems like a reasonable heuristic approach to me. You mean duplicating "nproc"'s logic in Python? If someone wants to do the grunt work of implementing/testing it... There's also the question of how that affects non-scientific

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Nathaniel Smith
Nathaniel Smith added the comment: That stackoverflow thread points to the GNU coreutils 'nproc', which is an interesting compendium of knowledge about this problem. It looks like their algorithm is roughly: 1. Determine how many CPUs *could* this program access, by going

[issue32972] unittest.TestCase coroutine support

2018-03-07 Thread Andrew Svetlov
Andrew Svetlov added the comment: I'm with Yuri: subclassing is under better control. The need for a new subclass is relative rare, for the whole asyncio world AsyncioTestCase should be enough. Another async framework most likely require a different test tool with

[issue33020] Tkinter old style classes

2018-03-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not surprising that some classes in Python 2 are old style classes. This is not a bug. If you need new style classes, the solution is upgrading to Python 3. -- ___ Python

[issue33019] Review usage of environment variables in the stdlib

2018-03-07 Thread Antoine Pitrou
Change by Antoine Pitrou : -- nosy: +benjamin.peterson ___ Python tracker ___ ___

[issue33020] Tkinter old style classes

2018-03-07 Thread Ned Deily
Change by Ned Deily : -- nosy: +gpolo, serhiy.storchaka ___ Python tracker ___ ___

[issue33001] Buffer overflow vulnerability in os.symlink on Windows (CVE-2018-1000117)

2018-03-07 Thread STINNER Victor
STINNER Victor added the comment: FYI I added this vulnerability to: http://python-security.readthedocs.io/vuln/cve-2018-1000117_buffer_overflow_vulnerability_in_os.symlink_on_windows.html

[issue33020] Tkinter old style classes

2018-03-07 Thread Ben Kirshenbaum
New submission from Ben Kirshenbaum : Tkinter objects cannot handle the super() function, and probably other functions (I only found a problem with super()) -- components: Tkinter messages: 313397 nosy: benkir07 priority: normal severity: normal status: open title:

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-07 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Serhiy, for example `issubclass(typing.MutableMapping, typing.Mapping)` returns `True` while neither of those two are actual class objects. These relationships are kept mostly so that `typing.*` can be used as a drop-in replacement for

[issue33019] Review usage of environment variables in the stdlib

2018-03-07 Thread Christian Heimes
Christian Heimes added the comment: External libraries like sqlite may also use env vars. I know for sure OpenSSL uses SSL_CERT_FILE and SSL_CERT_DIR to override default verify locations. -- ___ Python tracker

[issue33000] IDLE Doc: Text consumes unlimited RAM, consoles likely not

2018-03-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: I don't know whether memory difference between us is due to IDLEX or Windows version or something else, but I don't really care. The IDLE doc has a section "IDLE-console differences". It should gain a paragraph explain the difference

[issue33019] Review usage of environment variables in the stdlib

2018-03-07 Thread Antoine Pitrou
New submission from Antoine Pitrou : Python supports a mode where the interpreter ignores environment variables such as PYTHONPATH, etc. However, there are places in the stdlib where environment-sensitive decisions are made, without regard for the ignore-environment flag.

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Note that to avoid any kind of environment variable-driven Denial of Service, we should probably ignore NCPUS when sys.flags.ignore_environment is set. -- ___ Python tracker

[issue29708] support reproducible Python builds

2018-03-07 Thread Alexandru Ardelean
Alexandru Ardelean added the comment: PYTHONHASHSEED does help on 3.6.4 I'll use it during build. Thanks for help -- ___ Python tracker

[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-07 Thread Antoine Pietri
Antoine Pietri added the comment: I updated Vajrasky's patch to rebase it onto master, use the clinic argument parser and improve the docs. I made a PR on GitHub so the review can be easier than a patch. I left a Co-Authored-By field so I'm not stealing the

[issue22674] RFE: Add signal.strsignal(): string describing a signal

2018-03-07 Thread Antoine Pietri
Change by Antoine Pietri : -- pull_requests: +5784 stage: -> patch review ___ Python tracker ___

[issue32642] add support for path-like objects in sys.path

2018-03-07 Thread Jay Yin
Jay Yin added the comment: I've been stuck on "test_poplib" for over 149661 sec now, that's about 41 hours... I don't think this is working correctly, although I'm unsure what test_poplib is doing that has been affected by what I've changed here. --

[issue27683] ipaddress subnet slicing iterator malfunction

2018-03-07 Thread Xiang Zhang
Change by Xiang Zhang : -- pull_requests: +5783 ___ Python tracker ___ ___

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Matt Harvey
Matt Harvey added the comment: Hi, No, using the affinity's not useful to us as, in the general case, the batch system (PBS Pro in our case) isn't using cgroups or cpusets (it does control ave cpu use by monitoring rusage of the process group). Several other batch

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't think we want to hardcode special cases for each resource-limiting framework out there: some people care about Docker, others about cgroups, CPU affinity settings, etc. NCPUS has the nice property that each of those frameworks can

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Matthew Rocklin
Matthew Rocklin added the comment: I agree that this is a common issue. We see it both when people use batch schedulers as well as when people use Docker containers. I don't have enough experience with batch schedulers to verify that NCPUS is commonly set. I would

[issue29708] support reproducible Python builds

2018-03-07 Thread INADA Naoki
INADA Naoki added the comment: 3e 02 00 00 00 is frozenset(size=2) 72 b6/b5 00 00 00 is reference to b5 or b6 So it seems set order changed. (or items in the set is appearance order is changed.) Did you set PYTHONHASHSEED? Anyway, I think Python 3.7 can't guarantee

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Antoine Pitrou
Change by Antoine Pitrou : -- type: behavior -> enhancement versions: -Python 3.6, Python 3.7 ___ Python tracker ___

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Nathaniel Smith
Nathaniel Smith added the comment: This is a duplicate of bpo-26692 and bpo-23530, and possibly others. My impression is that len(os.sched_getaffinity(os.getpid())) is the Right Guess. Currently sched_getaffinity isn't implemented on Windows, but bpo-23530 has some example

[issue32986] multiprocessing, default assumption of Pool size unhelpful

2018-03-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Matt, what do you think about this proposal? Is NCPUS the right thing to look at? -- nosy: +Matthew Rocklin type: -> behavior versions: +Python 3.7, Python 3.8 ___ Python tracker

[issue33006] docstring of filter function is incorrect

2018-03-07 Thread Anthony Flury
Change by Anthony Flury : -- keywords: +patch pull_requests: +5782 stage: -> patch review ___ Python tracker ___

[issue33018] Improve issubclass() error checking and message

2018-03-07 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: ABC.register() has an explicit check, and it is mentioned in PEP 3119. The point here is not to change issubclass(), but to change ABC.__subclasscheck__(). It may conceivably have stricter requirements than issubclass() has. But

[issue33018] Improve issubclass() error checking and message

2018-03-07 Thread INADA Naoki
INADA Naoki added the comment: Why `issubclass()` doesn't check it? Maybe, non-type class is supported by Python. But I'm not sure. I'm not meta programming expert. But we use "duck typing". In this case, if the object (a) supports weakref and (2) has __mro__ and

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-07 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Sorry for status update, this was due to a concurrent modification. -- nosy: +jab resolution: -> fixed status: open -> closed ___ Python tracker

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-07 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: @inada.naoki: I don't question your change. My point is the same as in #33018 (I've discovered that PR only after I commented). The error message is misleading, and it's just a coincidence that a TypeError and not some other error is

[issue33014] Clarify doc string for str.isidentifier()

2018-03-07 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +easy ___ Python tracker ___ ___