[issue36544] cannot import hashlib when openssl is missing

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: Xavier de Gaye: Oops! I also saw such errors but I didn't understand them. Thanks for the fix! I wrote PR 12750 to fix another minor issue which isn't directly related to your fix (nor to my previous refactoring). -- ___

[issue36577] setup doesn't report missing _ssl and _hashlib

2019-04-09 Thread miss-islington
miss-islington added the comment: New changeset 8abc3f4f91e6b523c761c7a6fa2e3405019803a1 by Miss Islington (bot) (Christian Heimes) in branch 'master': bpo-36577: setup.py reports missing OpenSSL again (GH-12746) https://github.com/python/cpython/commit/8abc3f4f91e6b523c761c7a6fa2e3405019803a

[issue36146] Refactor setup.py

2019-04-09 Thread miss-islington
miss-islington added the comment: New changeset 8abc3f4f91e6b523c761c7a6fa2e3405019803a1 by Miss Islington (bot) (Christian Heimes) in branch 'master': bpo-36577: setup.py reports missing OpenSSL again (GH-12746) https://github.com/python/cpython/commit/8abc3f4f91e6b523c761c7a6fa2e3405019803a

[issue36146] Refactor setup.py

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: For the record, I introduced a regression which has been fixed in bpo-36544. -- ___ Python tracker ___ __

[issue36560] test_functools leaks randomly 1 memory block

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: > _abc was written for optimization. Your PR makes it using slower Python code. > Could you please test how much this hits the performance of abc? I mostly wrote PR 12743 to debug this issue. Please see the discussion directly on the PR ;-) --

[issue36577] setup doesn't report missing _ssl and _hashlib

2019-04-09 Thread Christian Heimes
Change by Christian Heimes : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker ___ _

[issue36579] test_venv: test_with_pip() hangs on PPC64 AIX 3.x

2019-04-09 Thread STINNER Victor
New submission from STINNER Victor : https://buildbot.python.org/all/#/builders/10/builds/2389 0:45:36 [412/420/1] test_venv crashed (Exit code 1) Timeout (0:15:00)! Thread 0x0001 (most recent call first): File "/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/subprocess.p

[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: The change broke multiple buildbots, please fix buildbots or the change will be reverted: https://github.com/python/cpython/pull/11784#issuecomment-481036369 Revert on fail: https://pythondev.readthedocs.io/ci.html#revert-on-fail -- nosy: +pablogsal,

[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: AMD64 Ubuntu Shared 3.x: https://buildbot.python.org/all/#/builders/141/builds/1498 FAIL: test_wait_socket (test.test_multiprocessing_fork.TestWait) -- Traceback (most recent call last): Fi

[issue36560] test_functools leaks randomly 1 memory block

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: New changeset 86f0354fcb815312295b923c55e39364d85d0388 by Victor Stinner in branch '3.7': [3.7] bpo-36560: regrtest: don't collect the GC twice (GH-12747) (GH-12749) https://github.com/python/cpython/commit/86f0354fcb815312295b923c55e39364d85d0388 -

[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: AMD64 FreeBSD CURRENT Shared 3.x: https://buildbot.python.org/all/#/builders/168/builds/885 test_wait (test.test_multiprocessing_spawn.TestWait) ... ok test_wait_integer (test.test_multiprocessing_spawn.TestWait) ... ok test_wait_slow (test.test_multiprocessi

[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: s390x SLES 3.x: https://buildbot.python.org/all/#/builders/16/builds/2625 FAIL: test_wait_socket (test.test_multiprocessing_fork.TestWait) FAIL: test_wait_socket (test.test_multiprocessing_spawn.TestWait) Re-running failed tests in verbose mode Re-running test

[issue35934] Add socket.create_server() utility function

2019-04-09 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Those are old failures (+/- 17 hours ago). I committed: https://github.com/python/cpython/pull/12735 ...which fixed them. -- ___ Python tracker __

[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: Oh, the test failed on Python 2.7 on macOS: x86-64 High Sierra 2.7 https://buildbot.python.org/all/#/builders/140/builds/211 == FAIL: test_customize_compiler (distutils.tests.test_sysconfig.S

[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-04-09 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +12678 stage: resolved -> patch review ___ Python tracker ___ ___ Python-bugs-list mail

[issue34373] test_time errors on AIX

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: New changeset 8709490f48fc27b3dd1a16acb33bea2299c6a575 by Victor Stinner in branch 'master': bpo-34373: Fix time.mktime() on AIX (GH-12726) https://github.com/python/cpython/commit/8709490f48fc27b3dd1a16acb33bea2299c6a575 -- nosy: +vstinner ___

[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: > Those are old failures (+/- 17 hours ago). I committed: > https://github.com/python/cpython/pull/12735 Oh, you wrote "BPO-" rather than "bpo-" and so your commit wasn't mentioned here: commit 8702b67dad62a9084f6c1823dce10653743667c8 Author: Giampaolo Rodol

[issue35934] Add socket.create_server() utility function

2019-04-09 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: No problem. My bad that I mistyped the "BPO" thing. -- ___ Python tracker ___ ___ Python-bugs-

[issue36414] Multiple test failures in GCC and Clang optional builds on Travis CI

2019-04-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: FWIW PR 12708 has been merged. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue36544] cannot import hashlib when openssl is missing

2019-04-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: Thanks Victor for the refactoring of setup.py. That was badly needed indeed. -- ___ Python tracker ___ __

[issue36559] "import random" should import hashlib on demand (nor load OpenSSL)

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: Note: *Technically*, you can disable the compilation of the _sha512 module using "*disabled*" in Modules/Setup, but I'm not sure if it's a common use case. At least, it makes sense to me when we are sure that OpenSSL and _hashlib are available ;-) I didn't w

[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2019-04-09 Thread Vy Nguyen
Change by Vy Nguyen : -- nosy: +Vy Nguyen ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue35934] Add socket.create_server() utility function

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: I was sure that I already reported the issue... In fact, I commented bpo-17561 :-) -- ___ Python tracker ___ __

[issue36574] Error with self in python

2019-04-09 Thread Tommy
Joan Tomas (Tommy) Pujol Muñoz added the comment: The python file. It works in Linux (Ubuntu) but not in Windows; at least for me. The output error is : Traceback (most recent call last): File "pySelf.py", line 8, in print(Person.__init__("Some","One",21,"American")) TypeError: __init__(

[issue17561] Add socket.bind_socket() convenience function

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: """ Fixed. There's a remaining failing BB: https://buildbot.python.org/all/#/builders/176/builds/185/steps/4/logs/stdio ...but the failure appears unrelated and it has been red for a while. """ That's known and unrelated issue: https://bugs.python.org/issue314

[issue36235] distutils.sysconfig.customize_compiler() overrides CFLAGS var with OPT var if CFLAGS env var is set

2019-04-09 Thread STINNER Victor
STINNER Victor added the comment: New changeset 22de4ce498b656063e236350e8404981c13e1cd8 by Victor Stinner in branch '2.7': bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12751) https://github.com/python/cpython/commit/22de4ce498b656063e236350e8404981c13e1cd8 -- __

[issue36541] Make lib2to3 grammar more closely match Python

2019-04-09 Thread Tim Hatch
Tim Hatch added the comment: Here's approximately what it would look like to do the big change now: https://github.com/python/cpython/compare/master...thatch:lib2to3-update-grammar (one test failing, and some helpers may need more test coverage) -- __

[issue36574] Error with self in python

2019-04-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: The error message is correct. The bug is in your code. Also, the code you tell us that you are running is not the same as the code you are actually running. You should not call __init__ directly as you do: # this is wrong Person.__init__("Some","One

[issue34160] ElementTree not preserving attribute order

2019-04-09 Thread Stefan Behnel
Stefan Behnel added the comment: This is done now. Thanks everyone who helped in discussing and implementing this change. I will leave Serhiy's last PR (adding the "sort_attrs" flag option) open for a while until I'm sure we have a better solution for comparing XML in 3.8, at which point I

[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > Back in 2007 the only POSIX-compliant type allowed for that was sig_atomic_t, > anything else was undefined. Fair enough, but having a non-atomic type is still much better than a completely wrong type. In other words, the requirement of fitting a file des

[issue31512] Add non-elevated symlink support for dev mode Windows 10

2019-04-09 Thread Steve Dower
Steve Dower added the comment: New changeset 0e10766574f4e287cd6b5e5860a1ca75488f4119 by Steve Dower (Vidar Tonaas Fauske) in branch 'master': bpo-31512: Add non-elevated symlink support for Windows (GH-3652) https://github.com/python/cpython/commit/0e10766574f4e287cd6b5e5860a1ca75488f4119

[issue31512] Add non-elevated symlink support for dev mode Windows 10

2019-04-09 Thread Steve Dower
Steve Dower added the comment: Done -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Adam Olsen
Adam Olsen added the comment: Disagree; if you're writing signal-handling code you should be very careful to do it properly, even if that's only proper for your current platform. If you can't do it properly you should find an alternative that doesn't involve signals. The fact that sig_atom

[issue32884] Adding the ability for getpass to print asterisks when passowrd is typed

2019-04-09 Thread Steven Vascellaro
Steven Vascellaro added the comment: @matanya.stroh: Don't forget to erase the asterisks if the user hits backspace. ``` def win_getpass(prompt='Password: ', stream=None, show_asterisks=False): """Prompt for password with echo off, using Windows getch().""" if sys.stdin is not sys.__st

[issue36549] str.capitalize should titlecase the first character not uppercase

2019-04-09 Thread Kingsley McDonald
Kingsley McDonald added the comment: Hello there, I'm an absolute beginner here and this whole thing is a little overwhelming, so please bear with me. I think this would be a suitable first task for me to take on because it appears to be a simple one-line change (correct me if I'm mistaken,

[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: I'm not sure with what you disagree. At least, you have to admit that using sig_atomic_t is buggy for different reasons than signal safety, namely that there is no guarantee that one can safely convert back and forth to an "int". --

[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > unpack the int into an array of sig_atomic_t. What do you mean with this? You can't write a complete array atomically, so I don't see how this would help. -- ___ Python tracker

[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Adam Olsen
Adam Olsen added the comment: Converting to/from sig_atomic_t could have a compile time check on currently supported platforms and isn't buggy for them. For platforms with a different size you could do a runtime check, only allowing a fd in the range of 0-254 (with 255 reserved); that could

[issue36580] unittest.mock does not understand dataclasses

2019-04-09 Thread John Parejko
New submission from John Parejko : The new dataclasses.dataclass is very useful for describing the properties of a class, but it appears that Mocks of such decorated classes do not catch the members that are defined in the dataclass. I believe the root cause of this is the fact that unittest.

[issue20074] open() of read-write non-seekable streams broken

2019-04-09 Thread cagney
cagney added the comment: Another example is PTY: Python 2.7.15 (default, Oct 15 2018, 15:24:06) [GCC 8.1.1 20180712 (Red Hat 8.1.1-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> pty, tty = os.openpty() >>> print(pty, tty) (3, 4) >>> imp

[issue36569] @staticmethod seems to work with setUpClass, but docs say it shouldn't

2019-04-09 Thread Brett Cannon
Brett Cannon added the comment: It's more of a "can't be an instance method" than a strict "only classmethod". Can I ask why you want it to be a strictmethod instead of a classmethod? I personally don't want to change the docs as I think that encourages a potentially bad situation where some

[issue36580] unittest.mock does not understand dataclasses

2019-04-09 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure why dataclasses would be different here: >>> import dataclasses >>> import unittest.mock >>> @dataclasses.dataclass ... class Foo: ... name: str ... baz: float ... bar: int = 12 ... >>> import inspect >>> inspect.signature(Foo) None> >

[issue36580] unittest.mock does not understand dataclasses

2019-04-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: mock.Mock doesn't do signature validation by default for constructor and methods. This is expected. create_autospec [0] should be used to make sure the signature is validated.' import dataclasses import unittest.mock @dataclasses.dataclass class Fo

[issue36581] __dir__ on unittest.mock not safe for all spec types

2019-04-09 Thread Dylan Semler
New submission from Dylan Semler : If a MagicMock is created with a spec or spec_set that is a non-list iterable of strings (like a tuple), calling dir() on said mock produces a Traceback. Here's a minimum example: 🡒 cat poc.py from unittest.mock import MagicMock mock = MagicMock(spec=('a',

[issue35181] Doc: Namespace Packages: Inconsistent documentation of __loader__ being None

2019-04-09 Thread Cheryl Sabella
Cheryl Sabella added the comment: @barry, you started a review of PR10016 and I believe all your requested changes have been made, so please review again when you get a chance. Please also take a look at PR10376. Thanks! -- nosy: +cheryl.sabella type: -> enhancement versions: +Pyt

[issue36581] __dir__ on unittest.mock not safe for all spec types

2019-04-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock > spec: This can be either a list of strings or an existing object (a class or > instance) that acts as the specification for the mock object. If you pass in > an object then a

[issue36580] unittest.mock does not understand dataclasses

2019-04-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: To add to this mock.Mock also copies dir(spec) but creating an instance from mock doesn't copy it where it's not a problem with create_autospec. Mock with spec does only attribute validation whereas create_autospec does signature validation. There

[issue36541] Make lib2to3 grammar more closely match Python

2019-04-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue36581] __dir__ on unittest.mock not safe for all spec types

2019-04-09 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +12679 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-l

[issue33387] Simplify bytecodes for try-finally, try-except and with blocks.

2019-04-09 Thread Cheryl Sabella
Cheryl Sabella added the comment: What would be the best way to resolve the discussion between this and issue 32949? Would it be good to try to get one of them into 3.8? -- nosy: +cheryl.sabella ___ Python tracker

[issue36582] collections.UserString encode method returns a string

2019-04-09 Thread Trey Hunner
New submission from Trey Hunner : It looks like the encode method for UserString incorrectly wraps its return value in a str call. ``` >>> from collections import UserString >>> UserString("hello").encode('utf-8') == b'hello' False >>> UserString("hello").encode('utf-8') "b'hello'" >>> type(Us

[issue36582] collections.UserString encode method returns a string

2019-04-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue36581] __dir__ on unittest.mock not safe for all spec types

2019-04-09 Thread Dylan Semler
Dylan Semler added the comment: I agree docs only say "list of strings" and so this isn't a case where there's behavior that contrasts with the documentation. I merely ran into this issue in my project and found it difficult to get to the root of so wanted to fix it upstream. I made a patch

[issue29858] inspect.signature includes bound argument for wrappers around decorated bound methods

2019-04-09 Thread Cheryl Sabella
Change by Cheryl Sabella : -- versions: +Python 3.8 -Python 3.5, Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue12910] urllib.quote quotes too many chars, e.g., '()'

2019-04-09 Thread miss-islington
Change by miss-islington : -- keywords: +patch pull_requests: +12681 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue12910] urllib.quote quotes too many chars, e.g., '()'

2019-04-09 Thread Senthil Kumaran
Senthil Kumaran added the comment: New changeset 750d74fac5c510e39958b3f79641fe54096ee54f by Senthil Kumaran (Jörn Hees) in branch 'master': bpo-12910: update and correct quote docstring (#2568) https://github.com/python/cpython/commit/750d74fac5c510e39958b3f79641fe54096ee54f -- ___

[issue36276] [CVE-2019-9740] Python urllib CRLF injection vulnerability

2019-04-09 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +12683 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue14826] urlopen URL with unescaped space

2019-04-09 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +12682 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue12910] urllib.quote quotes too many chars, e.g., '()'

2019-04-09 Thread miss-islington
miss-islington added the comment: New changeset 796698adf558f2255474945082856538b1effb0b by Miss Islington (bot) in branch '3.7': bpo-12910: update and correct quote docstring (GH-2568) https://github.com/python/cpython/commit/796698adf558f2255474945082856538b1effb0b -- nosy: +miss-

[issue12910] urllib.quote quotes too many chars, e.g., '()'

2019-04-09 Thread Senthil Kumaran
Change by Senthil Kumaran : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue36559] "import random" should import hashlib on demand (nor load OpenSSL)

2019-04-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: > You could also use the internal _sha512 module. > It's always present, small, lean and provides a SHA512 > implementation with sufficient performance. I suppose we could do this but it borders on telling folks that we're worried about using our own publ

[issue36582] collections.UserString encode method returns a string

2019-04-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Trey, would you like to submit a PR to fix this? (Be sure to add a test case). -- assignee: -> rhettinger type: -> behavior versions: +Python 3.8 ___ Python tracker __

[issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential)

2019-04-09 Thread Gregory P. Smith
Gregory P. Smith added the comment: > """ Since the documentation seems to be silent the guarantee (or expectation) is implied - logging systems emit records atomically - if this isn't true across fork() then the exception should be documented. """ We can add a note to the docs. As a genera

[issue1583] Patch for signal.set_wakeup_fd

2019-04-09 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > Unpacking the int would mean having one sig_atomic_t for 'invalid', using > that instead of INVALID_FD, plus an array of sig_atomic_t for the fd itself. > Every time you want to change the fd you first set the 'invalid' flag, then > the individual bytes,

<    1   2