[issue32153] mock.create_autospec fails if an attribute is a partial function

2018-12-02 Thread Chris Withers
Chris Withers added the comment: New changeset c667b094ae37799a7e42ba5cd2ad501cc7920888 by Chris Withers (Xtreak) in branch 'master': bpo-32153: Add unit test for create_autospec with partial function returned in getattr (#10398)

Re: Unrecognised Arguments

2018-12-02 Thread brunnre8
> I have been running twitterscraper yesterday with no real problems > encountered. I came home and tried to run a twitterscraper command in cmd – > without success. Are you running it on the same system as where it was working when you get the error? > It said the following for these

AW: Unrecognised Arguments

2018-12-02 Thread Lutz Horn
Hi, you use the `--lang` option wrongly. Fails: $ twitterscraper -bd 2015-01-01 -ed 2016-01-01 –lang en usage: twitterscraper [-h] [-o OUTPUT] [-l LIMIT] [-a] [-c] [-u] [--lang LANG] [-d] [-bd] [-ed] [-p] query twitterscraper: error: unrecognized

dealing with infinite generators

2018-12-02 Thread Avi Gross
[SPECULATION ALERT] I found it interesting as people discussed how one gets the length of something set up to follow the iterator protocol and especially anything that is effectively infinite. It is possible in python to set a value of "inf" using methods like this: >>> x = float("inf") >>> x

Re: Unrecognised Arguments

2018-12-02 Thread dieter
fergalbell Bell writes: > I have been running twitterscraper yesterday with no real problems > encountered. I came home and tried to run a twitterscraper command in cmd > $(G!9(B without success. > > It said the following for these arguments: -bd 2015-01-01 -ed 2016-01-01 > $(G!9(Blang en

[issue35381] Heap-allocated posixmodule types

2018-12-02 Thread Eddie Elizondo
Change by Eddie Elizondo : -- keywords: +patch pull_requests: +10089 stage: -> patch review ___ Python tracker ___ ___

[issue35381] Heap-allocated posixmodule types

2018-12-02 Thread Eddie Elizondo
Change by Eddie Elizondo : -- title: Heap-allocated Posixmodule types -> Heap-allocated posixmodule types ___ Python tracker ___

[issue35381] Heap-allocated Posixmodule types

2018-12-02 Thread Eddie Elizondo
Change by Eddie Elizondo : -- title: Heap-allocated Posixmodule -> Heap-allocated Posixmodule types ___ Python tracker ___ ___

[issue35381] Heap-allocated Posixmodule

2018-12-02 Thread Eddie Elizondo
New submission from Eddie Elizondo : After bpo34784, there are still two more cases of statically allocated types (DirEntryType & ScandirIteratorType). These should also be heap allocated to make posixmodule fully compatible with PEP384. -- components: Library (Lib) messages: 330906

[issue10320] printf %qd is nonstandard

2018-12-02 Thread Zackery Spytz
Zackery Spytz added the comment: I've created a PR for this issue. -- nosy: +ZackerySpytz versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.4, Python 3.5 ___ Python tracker

[issue10320] printf %qd is nonstandard

2018-12-02 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +10088 stage: test needed -> patch review ___ Python tracker ___ ___

Re: Injecting methods into instance / class

2018-12-02 Thread duncan smith
On 02/12/2018 18:36, Peter Otten wrote: > duncan smith wrote: > >> Hello, >> I have a lot of functions that take an instance of a particular >> class as the first argument. I want to create corresponding methods in >> the class. I have tried the following, which (when called from __init__)

[issue35377] urlsplit scheme argument broken

2018-12-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't think this is broken, but I do think it could be documented better. You have to read the documentation for `urlparse` to see this: [Quote] Following the syntax specifications in RFC 1808, urlparse recognizes a netloc only if it is properly

Re: Injecting methods into instance / class

2018-12-02 Thread Thomas Jollans
On 02/12/2018 18:56, duncan smith wrote: > Hello, > I have a lot of functions that take an instance of a particular > class as the first argument. I want to create corresponding methods in > the class. I have tried the following, which (when called from __init__) > creates the relevant

[issue35380] Enable TCP_NODELAY for proactor event loop

2018-12-02 Thread Andrew Svetlov
Change by Andrew Svetlov : -- assignee: -> asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35380] Enable TCP_NODELAY for proactor event loop

2018-12-02 Thread Andrew Svetlov
New submission from Andrew Svetlov : We do it for selector based loops already, let's be consistent. I think the feature should be backported to 3.7 too. -- components: asyncio messages: 330903 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Enable

Re: Unrecognised Arguments

2018-12-02 Thread fergalbell Bell
Dear Sir/Madam, I have been running twitterscraper yesterday with no real problems encountered. I came home and tried to run a twitterscraper command in cmd – without success. It said the following for these arguments: -bd 2015-01-01 -ed 2016-01-01 –lang en unrecognised. Regards, Fergal Bell

[issue22021] shutil.make_archive() root_dir do not work

2018-12-02 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: Ping. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30410] Documentation for sys.stdout encoding does not reflect the new Windows behavior in Python 3.6+

2018-12-02 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: I updated the PR with the new wording by Paul, since I found it easier to understand as well. -- ___ Python tracker ___

[issue35366] Monkey Patching class derived from ctypes.Union doesn't work

2018-12-02 Thread Vijay
Vijay added the comment: Wanted to post a possible workaround until this is fixed. One can simply wrap a union anonymously inside a structure. Like so: struct my_struct_s { union my_union_u { }; }; This temporarily solved the problem in my case. --

Re: What Python books to you recommend to beginners?

2018-12-02 Thread boB Stepp
On Sun, Dec 2, 2018 at 1:51 PM songbird wrote: > my goal in learning python was to use it as a way of > picking up OOP concepts in a more concrete way (theory > alone doesn't give me enough hands on the bits i need so > i tend to just do other things instead). > > now that i've used python

[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +10087 stage: -> patch review ___ Python tracker ___ ___

[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I think the code is almost ok (I also prefer to also use the cache as an excuse to maintain the pool alive) but the test needs to be done a bit more carefully to avoid hanging the test suite in case of failure and to avoid leaking threads or

Re: Injecting methods into instance / class

2018-12-02 Thread duncan smith
On 02/12/2018 18:26, Stefan Ram wrote: > duncan smith writes: >> I have tried to find examples of injecting methods into classes without > > Wouldn't the normal approach be to just define a > class with your functions as instance methods? > > main.py > > class C(): > def __init__(

Re: What Python books to you recommend to beginners?

2018-12-02 Thread songbird
Dennis Lee Bieber wrote: > On Sun, 2 Dec 2018 12:40:44 -0500, songbird > declaimed the following: > >> as references those are useful, but howabout >>something a bit more conceptual or design oriented? >> > > At that level, you are not looking for "Python" books but rather > software

[issue34238] When BROWSER is set on Mac webbrowser.register_standard_browsers doesn't work

2018-12-02 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > However, I think there might be a bug with the implementation that doesn't > correctly respect the BROWSER preference. Notice how the webbrowser._tryorder > has two 'lynx' items and both of them are last. If you look at the comment in the code,

[issue35335] msgfmt should be able to merge more than one po file

2018-12-02 Thread s-ball
s-ball added the comment: After some more thinking about it, my opinion is that the proposed path for issue 9741 does not address at all my requirements. So I will try to propose a pull request addressing both issues here. -- ___ Python tracker

[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread tzickel
tzickel added the comment: I dont mind, I think my code is ready for review, but I'm not versed in this, so if you think you have something better, feel free to open a PR or tell me if I should submit mine, and you can comment on it:

Re: Injecting methods into instance / class

2018-12-02 Thread Peter Otten
duncan smith wrote: > Hello, > I have a lot of functions that take an instance of a particular > class as the first argument. I want to create corresponding methods in > the class. I have tried the following, which (when called from __init__) > creates the relevant methods in an instance

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-12-02 Thread Morten W. Petersen
On Sun, Dec 2, 2018 at 1:20 PM Chris Angelico wrote: > On Sun, Dec 2, 2018 at 11:08 PM Morten W. Petersen > wrote: > > > > On Sun, Dec 2, 2018 at 12:49 PM Chris Angelico wrote: > >> To my knowledge, len(x) == len(list(x)) for any core data type that > >> has a length. > > > > >>>

[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I was working already on a PR. Do you prefer to wait for yours instead? -- ___ Python tracker ___

[issue35379] IDLE's close fails when io.filename set to None

2018-12-02 Thread Raymond Hettinger
New submission from Raymond Hettinger : I'm not sure that sequence of events that causes this, but more than once I've gotten the following traceback. Exception in Tkinter callback Traceback (most recent call last): File

Re: Injecting methods into instance / class

2018-12-02 Thread Morten W. Petersen
Hi Duncan. On Sun, Dec 2, 2018 at 7:02 PM duncan smith wrote: > Hello, > I have a lot of functions that take an instance of a particular > class as the first argument. I want to create corresponding methods in > the class. I have tried the following, which (when called from __init__) >

Re: What Python books to you recommend to beginners?

2018-12-02 Thread songbird
Stefan Ram wrote: ... thank you. :) as references those are useful, but howabout something a bit more conceptual or design oriented? i have a pretty good idea about various language features or things to try, but i need a little more higher level view of how to go about building a

[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread Eric N. Vander Weele
Change by Eric N. Vander Weele : -- nosy: +ericvw ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Injecting methods into instance / class

2018-12-02 Thread duncan smith
Hello, I have a lot of functions that take an instance of a particular class as the first argument. I want to create corresponding methods in the class. I have tried the following, which (when called from __init__) creates the relevant methods in an instance (Python 3.6). def

[issue35369] List sorting makes duplicate comparisons

2018-12-02 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread tzickel
tzickel added the comment: It's important to note that before those PR, that code would leak the Pool instance until the process ends (once per call). https://github.com/python/cpython/compare/master...tzickel:fix34172 Is my proposed fix (till I get it to a PR). --

[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-12-02 Thread Prabakaran Kumaresshan
Prabakaran Kumaresshan added the comment: It's a side effect of a date arithmetic operation performed while setting timezone. while passing tz info to datetime invokes tz.fromutc() -> https://github.com/python/cpython/blob/3df85404d4bf420db3362eeae1345f2cad948a71/Lib/datetime.py#L1593

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

2018-12-02 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: As this issue was somehow still present previous to this commit, I am going to track this problem in a new issue: issue35378 -- status: open -> closed ___ Python tracker

[issue35378] multiprocessing.Pool.imaps iterators do not maintain alive the multiprocessing.Pool objects

2018-12-02 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : After applying the PRs in issue34172, multiprocessing.Pool.imap hangs on MacOs and Linux. This is a simple reproducer: import multiprocessing def the_test(): print("Begin") for x in multiprocessing.Pool().imap(int, ["4", "3"]):

[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread miss-islington
miss-islington added the comment: New changeset 6cb0486ce861903448bd6ba1095685b6cd48e3bd by Miss Islington (bot) in branch '3.7': bpo-35341: Add generic version of OrderedDict to typing (GH-10850) https://github.com/python/cpython/commit/6cb0486ce861903448bd6ba1095685b6cd48e3bd --

[issue35377] urlsplit scheme argument broken

2018-12-02 Thread devkral
devkral added the comment: first a correction; there is one protocol where it make sense: file I would change: ... elif scheme: ... to ... elif scheme and scheme != "file": ... Second: no it is not a correct behaviour. Urlunsplit is supposed to create a valid url from a tuple created by

[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread miss-islington
Change by miss-islington : -- pull_requests: +10086 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 68b56d02ef20479b87c65e523cf3dec1b7b77d40 by Ivan Levkivskyi (Ismo Toijala) in branch 'master': bpo-35341: Add generic version of OrderedDict to typing (GH-10850) https://github.com/python/cpython/commit/68b56d02ef20479b87c65e523cf3dec1b7b77d40

[issue35376] modulefinder skips nested modules with same name as top-level bad module

2018-12-02 Thread SilentGhost
Change by SilentGhost : -- nosy: +brett.cannon, eric.snow, ncoghlan stage: -> patch review versions: -Python 3.4, Python 3.5 ___ Python tracker ___

[issue35377] urlsplit scheme argument broken

2018-12-02 Thread SilentGhost
SilentGhost added the comment: While it might seem broken, it behaves according to documentation, it seems to me. -- nosy: +SilentGhost, orsenthil type: -> behavior ___ Python tracker

[issue34238] When BROWSER is set on Mac webbrowser.register_standard_browsers doesn't work

2018-12-02 Thread Farhaan Bukhsh
Farhaan Bukhsh added the comment: Hey I would like to take this bug and work on it, can you please anyone guide me how do I proceed? -- nosy: +fhackdroid ___ Python tracker

[issue35377] urlsplit scheme argument broken

2018-12-02 Thread devkral
New submission from devkral : the scheme argument of urlsplit/urlparse is completely broken. here two examples: urlunsplit(urlsplit("httpbin.org", scheme="https://;)) 'https://:httpbin.org' urlunsplit(urlsplit("httpbin.org", scheme="https")) 'https:///httpbin.org' Fix: change urlsplit logic

[issue35376] modulefinder skips nested modules with same name as top-level bad module

2018-12-02 Thread rdb
New submission from rdb : If modulefinder finds a nested module import (eg. 'import a.b.c') while there is a top-level module with the same name (eg. 'c') that failed to import and got added to the badmodules list, it will skip it entirely without even trying to import it. This has a

[issue35226] mock.call equality surprisingly broken

2018-12-02 Thread Daniel Fortunov
Change by Daniel Fortunov : -- nosy: +dfortunov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35375] name shadowing while a module tries to import another

2018-12-02 Thread Sriram Krishna
Sriram Krishna added the comment: Already covered in issue29929: https://bugs.python.org/issue29929. Thanks xtreak for the link to the message thread. PEP 432 seems to have methods to resolve this. Currently if the code doesn't access to .local, one can use the -I commandline option and

[issue35374] Windows doc build does not find autodetected hhc.exe

2018-12-02 Thread Eryk Sun
Change by Eryk Sun : -- nosy: +eryksun ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-12-02 Thread Chris Angelico
On Sun, Dec 2, 2018 at 11:08 PM Morten W. Petersen wrote: > > On Sun, Dec 2, 2018 at 12:49 PM Chris Angelico wrote: >> To my knowledge, len(x) == len(list(x)) for any core data type that >> has a length. > > >>> len(range(0,100,3)) > 34 > >>> range(0,100,3).__len__ > > >>>

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-12-02 Thread Morten W. Petersen
On Sun, Dec 2, 2018 at 12:49 PM Chris Angelico wrote: > On Sun, Dec 2, 2018 at 10:36 PM Morten W. Petersen > wrote: > > While we're on the subject, I did a test in my Python interpreter: > > > > Python 3.6.7 (default, Oct 22 2018, 11:32:17) > > [GCC 8.2.0] on linux > > Type "help", "copyright",

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-12-02 Thread Martin Panter
Martin Panter added the comment: Yeah, the TarFile class would fix up the header when the user calls “close”. I think this is how it was done for ZipFile (implemented in Issue 26039). Yes currently you would have to build the tarinfo object by hand. I think a helper function would be nice,

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-12-02 Thread Chris Angelico
On Sun, Dec 2, 2018 at 10:36 PM Morten W. Petersen wrote: > While we're on the subject, I did a test in my Python interpreter: > > Python 3.6.7 (default, Oct 22 2018, 11:32:17) > [GCC 8.2.0] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> range(0,3,100) >

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-12-02 Thread Morten W. Petersen
On Sun, Dec 2, 2018 at 2:23 AM Chris Angelico wrote: > On Sun, Dec 2, 2018 at 11:55 AM Morten W. Petersen > wrote: > > > > On Sat, Dec 1, 2018 at 1:11 AM Chris Angelico wrote: > >> > >> On Sat, Dec 1, 2018 at 10:55 AM Morten W. Petersen > wrote: > >> > But this raises the question of how to

[issue35375] name shadowing while a module tries to import another

2018-12-02 Thread Sriram Krishna
Sriram Krishna added the comment: My contention is that this behaviour breaks the Principle of Least Astonishment. In the particular example I gave, the user doesn't know (and can't be expected to know) the existence of a module called profile in the standard library. Here the user is not

[issue29541] Python3 error while building on Alt-F

2018-12-02 Thread Martin Panter
Martin Panter added the comment: The missing “crypt” symbol is probably this function: . It is defined by the OS or a separate library, not by Python. You may need to link the “_crypt” Python module to the library that

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-12-02 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Thanks, this looks interesting. How will the file writer know the whole file has been read? The override of the Tar header is done on `close`? Are `download_tarinfo` and `svgz_tarinfo` built by hand if we don't make changes in `gettarinfo`? --

[issue35375] name shadowing while a module tries to import another

2018-12-02 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > A python user can't be expected to know the name of every possible file in > the Python standard library. Maybe the current working directory should be > removed from sys.path when importing from within another module not in the > same

[issue35374] Windows doc build does not find autodetected hhc.exe

2018-12-02 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___

[issue35375] name shadowing while a module tries to import another

2018-12-02 Thread pmpp
pmpp added the comment: hi you are obsverving that because current working directory is set *first* in sys.path as a commodity you can avoid that with import sys,os sys.path.remove( os.getcwd() ) at the start of your program. otherwise usually it is wise to put user module in a package

[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > Shall I open a new issue for this? @itoijala Please see https://bugs.python.org/issue33462. It's on master. -- nosy: +xtreak ___ Python tracker

[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ismo Toijala
Change by Ismo Toijala : -- keywords: +patch pull_requests: +10085 stage: -> patch review ___ Python tracker ___ ___

[issue35375] name shadowing while a module tries to import another

2018-12-02 Thread Sriram Krishna
New submission from Sriram Krishna : Suppose I have a file profile.py in the same directory as the file I am running (say test.py) Let the contents of the files be: profile.py: raise Exception test.py: import cProfile now if I run test.py $ python test.py Traceback (most recent call

[issue35341] Add generic version of OrderedDict to typing module

2018-12-02 Thread Ismo Toijala
Ismo Toijala added the comment: My reason for using OrderedDict was that the normal dict is not reversible. I needed to get the last element added, so I ended up doing something like next(reversed(ordered_dict)). Perhaps this would be something to add to the normal dict (for 3.8?). Then I

[issue35374] Windows doc build does not find autodetected hhc.exe

2018-12-02 Thread Christian Ullrich
Change by Christian Ullrich : -- keywords: +patch pull_requests: +10084 stage: -> patch review ___ Python tracker ___ ___

[issue35374] Windows doc build does not find autodetected hhc.exe

2018-12-02 Thread Christian Ullrich
New submission from Christian Ullrich : If hhc.exe is on the PATH when HTML Help is being built, the build fails because make.bat does not correctly remember the fact. The set command is very finicky with trailing spaces, leading to this: '"hhc "' is not recognized as an internal or external

[issue35228] Index search in CHM help crashes viewer

2018-12-02 Thread Christian Ullrich
Christian Ullrich added the comment: Ma Lin, thanks for the suggestion! Yes, it looks like this option fixes the problem. I can reproduce the crash at will with a .chm built without this option, and not at all with one that has it on. If the .chm's directory is not writable, the .chw will

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-12-02 Thread Martin Panter
Martin Panter added the comment: If something like your “addbuffer” method existed, then you won’t need to get the size first, right? We don’t need the changes in “gettarinfo” for “addbuffer” to be useful. BTW have you considered returning a file writer rather than accepting a file reader?