[issue38757] mocking an exception, arguments do not seem to be passed to the mock

2019-11-09 Thread Chris Withers
Chris Withers added the comment: Not sure this is correct, if an effect is an exception and requires args, then it should be passed as an instance, not a class: Mock(side_effect=MyException(‘foo’)) > On 10 Nov 2019, at 04:49, Karthikeyan Singaravelan > wrote: > > > Karthikeyan

[issue26353] IDLE: Saving Shell should not add \n

2019-11-09 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +16609 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/17103 ___ Python tracker

[issue38673] REPL shows continuation prompt (...) when comment or space entered

2019-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: Regarding the IDLE mystery, *if* there's a difference between how it treats " # a" and "# a", this must be due to some part of the code that's invoked before _maybe_compile() is called, right? But that's immaterial to this bug -- I'm only complaining

[issue38756] Add generic versions of weakref types to typing module

2019-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: Well, in typeshed, weakref.WeakSet and the others are generic, so you should be able to write from __future__ import annotations from weakref import WeakSet users: WeakSet[User] Or if you need to support Python versions < 3.7, you could write

[issue38753] AsyncMock not cited as new in 3.8

2019-11-09 Thread John Belmonte
Change by John Belmonte : -- keywords: +patch pull_requests: +16608 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/17102 ___ Python tracker

[issue38760] Document for urllib.error.HTTPError.headers Should Specify What Version

2019-11-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the report. But this is a common convention across the docs to add versionadded and versionchanged directive that are rendered as new in version and changed in version with version being Python's version since docs is for CPython. I am

[issue38753] AsyncMock not cited as new in 3.8

2019-11-09 Thread John Belmonte
John Belmonte added the comment: yes, will do -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38753] AsyncMock not cited as new in 3.8

2019-11-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: John, would you like to raise a PR for this? The fix would be to add versionadded sphinx directive to https://github.com/python/cpython/blob/master/Doc/library/unittest.mock.rst . I am marking it as easy. -- keywords: +easy, newcomer

[issue38757] mocking an exception, arguments do not seem to be passed to the mock

2019-11-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Currently, the exception is not instantiated. Maybe we can check if it's callable and pass args, kwargs to the exception constructor to be raised. diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index a48132c5b1..f5bcb911f5 100644 ---

[issue38757] mocking an exception, arguments do not seem to be passed to the mock

2019-11-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38758] @dataclass defaults

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

[issue38756] Add generic versions of weakref types to typing module

2019-11-09 Thread Nils Kattenbeck
Nils Kattenbeck added the comment: A possible use case would be having multiple users and some groups said users can belong to. When using a WeakSet a user won't be part of a groups after he deleted his account without having to iterate over all groups. class User: pass class Group:

[issue38760] Document for urllib.error.HTTPError.headers Should Specify What Version

2019-11-09 Thread Han You
New submission from Han You : It says "New in version 3.4." so I put `urllib3>=3.4` in my requirements.txt. Turned out it is referring to the Python version. https://docs.python.org/3.7/library/urllib.error.html#urllib.error.HTTPError.headers -- assignee: docs@python components:

[issue38756] Add generic versions of weakref types to typing module

2019-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: OK, can you give some example use cases? Can you provide a list of types that you want to see added? -- ___ Python tracker ___

[issue38728] Update PC/pyconfig.h to support disabling auto linking

2019-11-09 Thread Steve Dower
Steve Dower added the comment: I'm not totally averse to just removing the link pragmas completely, but since that's got significant compatibility impact, I'm happy with this approach. Let's shorten the name though. "PY_NO_LINK_LIB" might be better? --

[issue38734] Python 3.7 and 3.8 in Windows Store do not start under git bash

2019-11-09 Thread Steve Dower
Steve Dower added the comment: The problem is that Cygwin (on which MinGW and Git Bash are based) tries to read the contents of the executable file, rather than just executing it. The type of link used by Windows here cannot be read as a normal file. The provided workaround is the best we

[issue38759] Python 2.7.9 x64 for Windows version is 2.7.13

2019-11-09 Thread Steve Dower
Steve Dower added the comment: That's a shame. If someone has the actual file (I don't), they can publish it elsewhere. Or if one of our team is prepared to validate it (I'm not) we can overwrite what's there. Otherwise, the fix is to use the latest version of Python, which is neither of

[issue38759] Python 2.7.9 x64 for Windows version is 2.7.13

2019-11-09 Thread Ned Deily
Change by Ned Deily : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___ ___

[issue38759] Python 2.7.9 x64 for Windows version is 2.7.13

2019-11-09 Thread Ben Barbour
New submission from Ben Barbour : When downloading Python 2.7.9 x64, the actual python executable is Python 2.7.13. The 32-bit version has the correct executable. -- messages: 356307 nosy: Ben Barbour priority: normal severity: normal status: open title: Python 2.7.9 x64 for Windows

[issue38758] @dataclass defaults

2019-11-09 Thread Anthony
New submission from Anthony : Given one of the motivations of @dataclass is to reduce boilerplate code then, in the context of @dataclass, x: list = [] should be equal to x: list = field(default_factory=lambda: []) The example in PEP 557 is not reasonable. It should be: class D: def

[issue38757] mocking an exception, arguments do not seem to be passed to the mock

2019-11-09 Thread Troulet-lambert Odile
New submission from Troulet-lambert Odile : When patching an Exception with a side_effect to another exception, it seems like the exceiption arguments are not passed to the mock. -- components: Tests files: essai mock_exception.py messages: 356305 nosy: piscvau priority: normal

[issue38756] Add generic versions of weakref types to typing module

2019-11-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +gvanrossum, levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue38756] Add generic versions of weakref types to typing module

2019-11-09 Thread Nils Kattenbeck
New submission from Nils Kattenbeck : I would like to request the addition of generic variants of some of the types in weakref to the typing module. This would for example include weakref.WeakKeyDictionary among others. Doing so would allow one to add type annotations to code using such data

[issue32309] Implement asyncio.run_in_executor shortcut

2019-11-09 Thread Kyle Stanley
Kyle Stanley added the comment: > (a) design the API correctly; (b) ship something that definitely works with a proven ThreadPoolExecutor; (c) write lots of tests; (d) write docs; (e) if (a-d) are OK, refine the implementation later by replacing ThreadPoolExecutor with a proper (eager

[issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag)

2019-11-09 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +16607 pull_request: https://github.com/python/cpython/pull/17099 ___ Python tracker ___

[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2019-11-09 Thread Ralf Gommers
Change by Ralf Gommers : -- nosy: +ralf.gommers ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38688] Python 3.8 regression: endless loop in shutil.copytree

2019-11-09 Thread Bruno P. Kinoshita
Bruno P. Kinoshita added the comment: Hi, I did a quick `git bisect` using the example provided, and looks like this regression was added in the fix for bpo-33695, commit 19c46a4c96553b2a8390bf8a0e138f2b23e28ed6. It looks to me that the iterator returned by with os.scandir(...) is

[issue38688] Python 3.8 regression: endless loop in shutil.copytree

2019-11-09 Thread Bruno P. Kinoshita
Change by Bruno P. Kinoshita : -- keywords: +patch pull_requests: +16604 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/17098 ___ Python tracker

[issue33695] Have shutil.copytree(), copy() and copystat() use cached scandir() stat()s

2019-11-09 Thread Bruno P. Kinoshita
Change by Bruno P. Kinoshita : -- pull_requests: +16605 pull_request: https://github.com/python/cpython/pull/17098 ___ Python tracker ___

[issue36852] Python3.7.2 fails to cross-compile (yocto / openembedded) when target is mips softfloat

2019-11-09 Thread Matthias Klose
Matthias Klose added the comment: The idea with the extension names is to have different names for different ABIs. See https://wiki.debian.org/Multiarch/Tuples for the list of ABIs that are "known", or documented. mips-linux-gnu is documented as MIPS32r2+FPXX, which is a different ABI than

[issue35278] [security] directory traversal in tempfile prefix

2019-11-09 Thread Martijn Pieters
Martijn Pieters added the comment: I found this issue after helping someone solve a Stack Overflow question at https://stackoverflow.com/q/58767241/100297; they eventually figured out that their prefix was a path, not a path element. I'd be all in favour of making tempfile._sanitize_params

[issue38740] Line count mismatch between open() vs sys.stdin api calls

2019-11-09 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

2019-11-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38755] Long unicode string causes SyntaxError: Non-UTF-8 code starting with '\xe2' in file ..., but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

2019-11-09 Thread Andrew Ushakov
New submission from Andrew Ushakov : Not very long unicode comment #, space and then 170 or more repetitions of the utf8 symbol ░ (b'\xe2\x96\x91'.decode()) #

[issue38635] Simplify decoding the ZIP64 extra field and make it tolerant to extra data

2019-11-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue38635] Simplify decoding the ZIP64 extra field and make it tolerant to extra data

2019-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset e27449da92b13730a5e11182f329d5da98a5e05b by Serhiy Storchaka in branch 'master': bpo-38635: Simplify decoding the ZIP64 extra field and make it tolerant to extra data. (GH-16988)

[issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag)

2019-11-09 Thread miss-islington
miss-islington added the comment: New changeset 85e415108226cc5f3f70196fc4c2a1d0f7f4 by Miss Islington (bot) in branch '3.8': bpo-22367: Add tests for fcntl.lockf(). (GH-17010) https://github.com/python/cpython/commit/85e415108226cc5f3f70196fc4c2a1d0f7f4 -- nosy:

[issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag)

2019-11-09 Thread miss-islington
miss-islington added the comment: New changeset 917dbe350a762ed6d75b7d074f3fb87975ba717b by Miss Islington (bot) in branch '3.7': bpo-22367: Add tests for fcntl.lockf(). (GH-17010) https://github.com/python/cpython/commit/917dbe350a762ed6d75b7d074f3fb87975ba717b --

[issue38754] Python3.7 site-packages

2019-11-09 Thread nerd
nerd added the comment: Everytime I do anything related to updating arch or installing anything python3.7 for some reason really breaks. I've waited over 6 months for a single fix for this and have yet to find a solution to it. I am not a python nerd so idk whats going on here but overall

[issue38754] Python3.7 site-packages

2019-11-09 Thread nerd
New submission from nerd : Everytime I do anything related to updating arch or installing anything python3.7 for some reason really breaks. I've waited over 6 months for a single fix for this and have yet to find a solution to it. I am not a python nerd so idk whats going on here but overall

[issue38692] add a pidfd child process watcher

2019-11-09 Thread Chih-Hsuan Yen
Chih-Hsuan Yen added the comment: Benjamin Peterson, Kyle Stanley: Thank you both very much for intensive testing and helpful information! Yes on my Arch Linux box tests are also fine without systemd-nspawn. However, as I have to use systemd-nspawn for some reasons, and investigating how it

[issue16576] ctypes: structure with bitfields as argument

2019-11-09 Thread Vinay Sajip
Change by Vinay Sajip : -- pull_requests: +16603 pull_request: https://github.com/python/cpython/pull/17097 ___ Python tracker ___

[issue38678] TypeError for Tutorial 10.3 Example 2

2019-11-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll replace this example with more representative one that works. -- assignee: docs@python -> rhettinger nosy: +rhettinger ___ Python tracker