[issue33262] Deprecate shlex.split(None) to read from stdin.

2018-04-11 Thread Christian Heimes
New submission from Christian Heimes : The shlex module implements simple tokenize for a shell-like mini language. The shlex.split() function splits a string into subcomponents just like a typical Unix shell. However function has a surprising feature. When None is passed into

Re: Compression of random binary data

2018-04-11 Thread Steven D'Aprano
On Tue, 10 Apr 2018 23:36:27 -0700, cuddlycaveman wrote: [snip a number of carefully chosen, non-random numbers shown in binary] > Don’t know if that helps Helps what? With no context, we don't know who you are replying to, what they asked, or why you think this is helpful. According to my

[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-04-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka versions: +Python 3.6, Python 3.7, Python 3.8 ___ Python tracker

[issue33260] Update token.py etc for ASYNC and AWAIT

2018-04-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6143 stage: -> patch review ___ Python tracker ___

[issue33261] inspect.isgeneratorfunction fails on hand-created methods

2018-04-11 Thread Jeroen Demeyer
New submission from Jeroen Demeyer : The inspect functions isgeneratorfunction, iscoroutinefunction, isasyncgenfunction can fail on methods that do not have a __code__ attribute: >>> from types import MethodType >>> class Callable: ... def __call__(self, *args): ...

[issue33261] inspect.isgeneratorfunction fails on hand-created methods

2018-04-11 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- keywords: +patch pull_requests: +6144 stage: -> patch review ___ Python tracker ___

[issue11122] bdist_rpm should use rpmbuild, not rpm

2018-04-11 Thread Charalampos Stratakis
Charalampos Stratakis added the comment: I could make a PR out of the patch but I wonder if anyone is actually using this functionality. Wearing my Fedora's python maintainer hat, we have a lot of tooling around rpm that handles those things, so I don't think there is a

[issue20784] 'collections.abc' is no longer defined when collections is imported

2018-04-11 Thread Paweł
Paweł added the comment: I had similar issue and it helped when as a workaround I use 'pip install .' as opposed to 'python setup.py develop' in my project. I hope this will give you a hint. -- components: +Library (Lib) nosy: +pawciobiel versions: +Python 2.7

Re: ANN: PyDDF Python Spring Sprint 2018

2018-04-11 Thread Karsten Hilbert
> * mxDateTime Portierung auf Python 3.6 +1 !! Karsten Hilbert -- -- https://mail.python.org/mailman/listinfo/python-list

[issue33260] Update token.py etc for ASYNC and AWAIT

2018-04-11 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : After making 'async' and 'await' proper keywords (issue30406), token.py was not regenerated. The proposed patch updates token.py, tokenize.py and the documentation. -- components: Library (Lib) messages: 315184 nosy:

Re: Levenberg-Marquardt Algorithm

2018-04-11 Thread Christian Gollwitzer
Am 11.04.18 um 08:38 schrieb Priya Singh: I have two 2D arrays one R and another T (which is also a 2D array). Do you know how can I fit T with R in order to find central coordinate x0,y0 for T relative to R??? So the main question is do you know in python how can I fit two 2D arrays to find

[issue33260] Update token.py etc for ASYNC and AWAIT

2018-04-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: ASYNC and AWAIT are kept in the lib2to3 grammar. -- ___ Python tracker ___

[issue33240] shutil.rmtree fails when the inner floder is opened in Explorer on Windows

2018-04-11 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > For convenience, a handler that retries unlink() and rmdir() could be > distributed with shutil. For ease of use, it could be enabled by default on > Windows. +1 on that. I bumped into this many times over the years as occasional and

[issue33252] Clarify ResourceWarning documentation

2018-04-11 Thread Nick Coghlan
Nick Coghlan added the comment: +1 from me for further ResourceWarning docs improvements - my focus when working on PEP 565 was the actual change in how DeprecationWarning was being handled, and the other warnings doc improvements were just a necessary prerequisite for

[issue31087] asyncio.create_subprocess_* do not honor `encoding`

2018-04-11 Thread Adam
Adam added the comment: It occurs both on Python 3.6 and 3.7 RC, so maybe it should be fixed in the 3.7 release. -- nosy: +adampl type: -> behavior versions: +Python 3.7 Added file: https://bugs.python.org/file47531/asyncio_encoding_test.py

beacons and geofences

2018-04-11 Thread Rafal Sikora
Hi! I want users’ devices to be able to monitor the maximum amount of POIs at once (geo-fences/beacons) and I need to prepare an algorithm solution for monitoring the POIs. How should it be implemented in Python? -- https://mail.python.org/mailman/listinfo/python-list

[issue25433] whitespace in strip()/lstrip()/rstrip()

2018-04-11 Thread Oliver Urs Lenz
Oliver Urs Lenz added the comment: Slightly tangential, but it would be great if the documentation of lstrip() and rstrip() could include an equivalent definition in terms of re.sub(), e.g.: lstrip(foo) == re.sub(r'(?u)\A\s*', '', foo) rstrip(foo) ==

[issue33260] Update token.py etc for ASYNC and AWAIT

2018-04-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset d08972fdb92cad6b813d22205752c97ea18df060 by Serhiy Storchaka in branch 'master': bpo-33260: Regenerate token.py after removing ASYNC and AWAIT. (GH-6447)

[issue33260] Update token.py etc for ASYNC and AWAIT

2018-04-11 Thread miss-islington
Change by miss-islington : -- pull_requests: +6145 ___ Python tracker ___

Re: Filtering computer.lang.python

2018-04-11 Thread C W Rose via Python-list
Thomas Jollans wrote: > > Welcome to python-list/comp.lang.python! > > This isn't originally a Google group. Google just mirrors the old USENET > group, which is awash with spam. > > There is also a mailing list version of this group (posts are mirrored > both ways) at

Levenberg-Marquardt Algorithm

2018-04-11 Thread Priya Singh
Good morning. I need some suggestion from you if you have encountered this problem ever. I have two 2D arrays one R and another T (which is also a 2D array). Do you know how can I fit T with R in order to find central coordinate x0,y0 for T relative to R??? So the main question is do you know

Re: Levenberg-Marquardt Algorithm

2018-04-11 Thread tejaswi prakash
I am sorry, but I thought Levenberg marquardt was used quite bit in Image registration. Computing/refining homographies between two related views for instance. On Wed, Apr 11, 2018 at 12:49 PM, Christian Gollwitzer wrote: > Am 11.04.18 um 08:38 schrieb Priya Singh: > >> I have

[issue11122] bdist_rpm should use rpmbuild, not rpm

2018-04-11 Thread Stanislav P
Stanislav P added the comment: i am using this on redhat enterprise and mac. both running python 3.5 both running latest rpm. if you can make a pr it would great. -- ___ Python tracker

[issue11122] bdist_rpm should use rpmbuild, not rpm

2018-04-11 Thread Charalampos Stratakis
Charalampos Stratakis added the comment: The bug exists indeed but I would like to know what is the actual use case here. -- ___ Python tracker

Pandas, create new column if previous column(s) are not in [None, '', np.nan]

2018-04-11 Thread zljubisic
I have a dataframe: import pandas as pd import numpy as np df = pd.DataFrame( { 'A' : ['a', 'b', '', None, np.nan], 'B' : [None, np.nan, 'a', 'b', '']}) A B 0 a None 1 b NaN 2 a 3 None b 4 NaN I would like to create column C in

[issue33263] Asyncio server enters an invalid state after a request with SO_LINGER

2018-04-11 Thread Vlad Starostin
New submission from Vlad Starostin : Long story short, if you have a TCP asyncio-server (implementing asyncio.Protocol) that sends something to socket in connection_made callback, it will leak fds and won't be able to handle some consequent requests, if you will send to it

[issue1634034] Show "expected" token on syntax error

2018-04-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Similar enhancement has been implemented in PyPy just now. https://morepypy.blogspot.de/2018/04/improving-syntaxerror-in-pypy.html -- versions: +Python 3.8 -Python 3.4 ___ Python

[issue33260] Update token.py etc for ASYNC and AWAIT

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

[issue1634034] Show "expected" token on syntax error

2018-04-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +6147 stage: needs patch -> patch review ___ Python tracker ___

[issue33260] Update token.py etc for ASYNC and AWAIT

2018-04-11 Thread miss-islington
miss-islington added the comment: New changeset 4dc3c8ff14572032e63d9938a12813392bcbe982 by Miss Islington (bot) in branch '3.7': bpo-33260: Regenerate token.py after removing ASYNC and AWAIT. (GH-6447)

[issue33263] Asyncio server enters an invalid state after a request with SO_LINGER

2018-04-11 Thread Vlad Starostin
Change by Vlad Starostin : -- keywords: +patch pull_requests: +6146 stage: -> patch review ___ Python tracker ___

Re: [OT] multicore/cpu history

2018-04-11 Thread Grant Edwards
On 2018-03-25, Steven D'Aprano wrote: > Not really. With multiple CPUs, you have the option of running two > distinct OSes in isolation, not merely virtual machines but actual > distinct machines in the same box. Not on any of the multi-CPU motherboards I

[issue33065] IDLE debugger: problem importing user created module

2018-04-11 Thread om364@
om364@ added the comment: Traceback (most recent call last): File "...\PositionalList.py", line 1, in from _DoublyLinkedBase import _DoublyLinkedBase File "", line 968, in _find_and_load File "", line 148, in __enter__ File "", line 174, in _get_module_lock

[issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO

2018-04-11 Thread Andrés Delfino
New submission from Andrés Delfino : Documentation says urllib.request.urlretrieve "might become deprecated at some point in the future". IMHO, it's better to provide examples that do not make users rely on API that has this label. I propose the example in the pull

Re: Pandas, create new column if previous column(s) are not in [None, '', np.nan]

2018-04-11 Thread Albert-Jan Roskam
On Apr 11, 2018 20:52, zljubi...@gmail.com wrote: > > I have a dataframe: > > import pandas as pd > import numpy as np > > df = pd.DataFrame( { 'A' : ['a', 'b', '', None, np.nan], > 'B' : [None, np.nan, 'a', 'b', '']}) > > A B > 0 a None > 1 b NaN > 2

[issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO

2018-04-11 Thread Andrés Delfino
Change by Andrés Delfino : -- keywords: +patch pull_requests: +6148 stage: -> patch review ___ Python tracker ___

[issue31087] asyncio.create_subprocess_* do not honor `encoding`

2018-04-11 Thread Nathaniel Smith
Nathaniel Smith added the comment: @adampl: The first step is for someone (possibly you :-)) to write a patch and submit it as a PR against the Python master branch. Then once the actual change is figured out, we can have the discussion about which releases to backport it to.

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-04-11 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: An alternative fix is here: https://github.com/izbyshev/cpython/commit/b89b52f28490b69142d5c061604b3a3989cec66c Feel free to use the test if you don't like the approach :) -- ___ Python

Re: beacons and geofences

2018-04-11 Thread ElChino
Rafal Sikora wrote: Hi! I want users’ devices to be able to monitor the maximum amount of POIs at once (geo-fences/beacons) and I need to prepare an algorithm solution for > monitoring the POIs. How should it be implemented in Python? What? You'll have to describe the problem in more

Re: Filtering computer.lang.python

2018-04-11 Thread Mark Lawrence
On 10/04/18 21:06, C W Rose via Python-list wrote: Thomas Jollans wrote: Welcome to python-list/comp.lang.python! This isn't originally a Google group. Google just mirrors the old USENET group, which is awash with spam. There is also a mailing list version of this group (posts

[issue11122] bdist_rpm should use rpmbuild, not rpm

2018-04-11 Thread Stanislav P
Stanislav P added the comment: the use case is being able to publish python package as rpm using setup.py on mac. -- ___ Python tracker

[issue13585] Add contextlib.ExitStack

2018-04-11 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: Why this? _exit_wrapper.__self__ = cm It seems that you are trying to create something which is exactly like a method except that it's not a method. Is there any reason to not use an actual method? It would actually simplify the code. I

Re: Pandas, create new column if previous column(s) are not in [None, '', np.nan]

2018-04-11 Thread codewizard
On Wednesday, April 11, 2018 at 2:49:01 PM UTC-4, zlju...@gmail.com wrote: > I have a dataframe: > > import pandas as pd > import numpy as np > > df = pd.DataFrame( { 'A' : ['a', 'b', '', None, np.nan], > 'B' : [None, np.nan, 'a', 'b', '']}) > > A B > 0 a

Re: Pandas, create new column if previous column(s) are not in [None, '', np.nan]

2018-04-11 Thread José María Mateos
On Wed, Apr 11, 2018, at 14:48, zljubi...@gmail.com wrote: > I have a dataframe: > [...] This seems to work: df1 = pd.DataFrame( { 'A' : ['a', 'b', '', None, np.nan], 'B' : [None, np.nan, 'a', 'b', '']}) df1['C'] = df1[['A', 'B']].apply(lambda

Re: [OT] multicore/cpu history

2018-04-11 Thread Peter J. Holzer
On 2018-03-25 22:52:59 +, Steven D'Aprano wrote: > On Sun, 25 Mar 2018 23:29:07 +0200, Peter J. Holzer wrote: > >> >> By the way, multiple CPU machines are different from CPUs with > >> >> multiple cores: > >> >> > >> >> http://smallbusiness.chron.com/multiple-cpu-vs-multicore-33195.html > >>

[issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO

2018-04-11 Thread Ned Deily
Change by Ned Deily : -- nosy: +orsenthil ___ Python tracker ___ ___ Python-bugs-list

[issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO

2018-04-11 Thread Senthil Kumaran
Senthil Kumaran added the comment: Andrés, your pull request looks good to me. Please go ahead and sign the CLA and I can merge this to cpython HEAD. Thank you for your contribution. -- ___ Python tracker

[issue33217] x in enum.Flag member is True when x is not a Flag

2018-04-11 Thread Ethan Furman
Ethan Furman added the comment: New changeset 3715176557cf87925c8f89b98939c7daf9bf48e2 by Ethan Furman in branch '3.7': [3.7] bpo-33217: deprecate non-Enum lookups in Enums (GH-6392) https://github.com/python/cpython/commit/3715176557cf87925c8f89b98939c7daf9bf48e2

[issue33262] Deprecate shlex.split(None) to read from stdin.

2018-04-11 Thread Eric V. Smith
Eric V. Smith added the comment: I agree that it should be deprecated. That's crazy behavior. I'd also recommend that shlex.shlex with instream=None be deprecated, but maybe that's too radical. It seems way too easy to accidentally pass in None. -- nosy:

Re: Compression of random binary data

2018-04-11 Thread cuddlycaveman
I’m replying to your post on January 28th Nice carefully chosen non random numbers Steven D'Aprano. Was just doing what you asked, but you don’t remember  -- https://mail.python.org/mailman/listinfo/python-list

Re: Filtering computer.lang.python

2018-04-11 Thread Skip Montanaro
> I fetch comp.lang.python from eternal.september with leafnode, and after > 30 years of Usenet I recently had to install a news filter to remove the > garbage. After the initial flurry the filter doesn't need much updating, > but here's why it's necessary: ... > for totals of 2168 fetched and

[issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO

2018-04-11 Thread Andrés Delfino
Andrés Delfino added the comment: Hi Senthil! I signed the CLA several days ago. Got the "Python Contributor Agreement Form between Python Software Foundation and Andrés Delfino is Signed and Filed!" mail on April 1st (perhaps I chose a bad date to fill the request ;) )

[issue33065] IDLE debugger: problem importing user created module

2018-04-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: We use 'crash' for, on Window, a process stopping either with no explanation or a 'Your process has stopped box' from Windows. In any case, PositionalList.py will not run without _DoublyLinkedBase.py, which you did not upload. The

[issue33264] Remove to-be-deprecated urllib.request.urlretrieve function reference from HOWTO

2018-04-11 Thread Andrés Delfino
Andrés Delfino added the comment: The agreement can be found at: https://secure.na1.echosign.com/public/viewAgreement?tsid=CBFCIBAA3AAABLblqZhC0bOfZxqQ_bUGhwUqnYiqqxAj3N7_dOts1qHsH9YdsbakL5qJ6FbSU9NHkecXglBLZ29gXbHeNdUErGzW7QkUs; --

[issue33082] multiprocessing docs bury very important 'callback=' args

2018-04-11 Thread Chad
Change by Chad : -- pull_requests: +6150 ___ Python tracker ___ ___ Python-bugs-list

Re: Compression of random binary data

2018-04-11 Thread cuddlycaveman
387420479 00110011 00111000 00110111 00110100 00110010 0011 00110100 00110111 00111001 72 bits Equal to (9^9)-10 00101000 00111001 0100 00111001 00101001 00101101 00110001 0011 64 bits 387420499 00110011 00111000 00110111 00110100 00110010 0011 00110100 00111001 00111001 72

How to write partial of a buffer which was returned from a C function to a file?

2018-04-11 Thread jfong
This C function returns a buffer which I declared it as a ctypes.c_char_p. The buffer has size 0x1 bytes long and the valid data may vary from a few bytes to the whole size. In every call I know how much the valid data size is, but I suppose I can't use slice to get it because there may be

[issue13585] Add contextlib.ExitStack

2018-04-11 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: Follow-up: https://bugs.python.org/issue33265 -- ___ Python tracker ___

[issue33265] contextlib.ExitStack abuses __self__

2018-04-11 Thread Jeroen Demeyer
New submission from Jeroen Demeyer : In contextlib, there is code which roughly looks like def _exit_wrapper(exc_type, exc, tb): return cm_exit(cm, exc_type, exc, tb) _exit_wrapper.__self__ = cm This creates a new function _exit_wrapper from a

[issue33265] contextlib.ExitStack abuses __self__

2018-04-11 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- keywords: +patch pull_requests: +6151 stage: -> patch review ___ Python tracker ___

Re: How to write partial of a buffer which was returned from a C function to a file?

2018-04-11 Thread Chris Angelico
On Thu, Apr 12, 2018 at 2:16 PM, wrote: > This C function returns a buffer which I declared it as a ctypes.c_char_p. > The buffer has size 0x1 bytes long and the valid data may vary from a few > bytes to the whole size. > > In every call I know how much the valid data