Generating a vector from successive multiplications of another vector from an initial value

2015-10-01 Thread Paulo da Silva
Hi all. What is the fastest way to do the following: I have an initial value V and a vector vec of (financial) indexes. I want to generate a new vector nvec as V, V*vec[0], V*vec[0]*vec[1], V*vec[0]*vec[1]*vec[2], ... A numpy vectorized solution would be better. Thanks --

Re: Generating a vector from successive multiplications of another vector from an initial value

2015-10-01 Thread Ian Kelly
On Thu, Oct 1, 2015 at 2:45 PM, Paulo da Silva wrote: > Hi all. > > What is the fastest way to do the following: > > I have an initial value V and a vector vec of (financial) indexes. > I want to generate a new vector nvec as > > V, V*vec[0], V*vec[0]*vec[1],

[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor
STINNER Victor added the comment: The overflowed flag was introduced 8 years ago (near the release of Python 3.0) by the following changeset: changeset: 42013:cd125fe83051 user:Martin v. Löwis date:Sun Jun 10 09:51:05 2007 + files:

[issue10485] http.server fails when query string contains addition '?' characters

2015-10-01 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> duplicate status: open -> closed superseder: -> CGIRequestHandler behave incorrectly with query component consisting mutliple ? ___ Python tracker

[issue25125] "Edit with IDLE" does not work for shortcuts

2015-10-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: In #23546, I requested a separate 'Edit with IDLE x.y' (I mis-said 'Open') on the context menu for each installed version. I said I would be OK with one 'Edit with IDLE' entry and a submenu, as proposed by someone else. I agree that this will be better in

Re: Only getting the first 6 lines

2015-10-01 Thread Cameron Simpson
On 01Oct2015 23:58, Cecil Westerhof wrote: I want to get the first 6 lines of ps output. For this I use: from subprocess import check_output ps_command = ('ps', '-eo',

[issue25267] Optimize UTF-8 encoder with error handlers

2015-10-01 Thread STINNER Victor
STINNER Victor added the comment: I pushed my optimization. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

Re: Question about regular expression

2015-10-01 Thread Denis McMahon
On Thu, 01 Oct 2015 01:48:03 -0700, gal kauffman wrote: > items = s.replace(' (', '(').replace(', ',',').split() > > items_dict = dict() > for item in items: > if '(' not in item: > item += '(0,0)' > if ',' not in item: > item = item.replace(')', ',0)') > > name,

[issue23546] Windows, 'Edit with IDLE', and multiple installed versions

2015-10-01 Thread Steve Dower
Changes by Steve Dower : -- assignee: -> steve.dower resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue14576] IDLE: inconsistent use of HOMEDRIVE, HOMEPATH, and USERPROFILE on Windows

2015-10-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: John, thank you for the additional information. 2 copies of .idlerc is definitely bad. -- versions: +Python 3.5, Python 3.6 -Python 3.3, Python 3.4 ___ Python tracker

[issue25125] "Edit with IDLE" does not work for shortcuts

2015-10-01 Thread Steve Dower
Steve Dower added the comment: Terry (nosied) made the request for the context menu in issue 23546, so if you want it removed you'll need to convince him. Personally I prefer the context menu, but I typically replace the default file association with one that's better for me anyway so I'm not

[issue25293] Hooking Thread/Process instantiation in concurrent.futures.

2015-10-01 Thread Antony Lee
New submission from Antony Lee: http://bugs.python.org/issue21423 and http://bugs.python.org/issue24980 suggest adding an initializer/on_new_thread argument to {Thread,Process}PoolExecutor. I would like to suggest a more unified API, that would allow not only handling initialization, but

[issue25165] Windows uninstallation should not remove launcher if other versions remain

2015-10-01 Thread Steve Dower
Changes by Steve Dower : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

Re: ConnectionError handling problem

2015-10-01 Thread Cameron Simpson
On 30Sep2015 23:56, Laura Creighton wrote: In a message of Thu, 01 Oct 2015 07:30:59 +1000, Cameron Simpson writes: Most likely the Ctrl-C interrupts whatever system call is hanging, causing it to return (failed, probably with errno EINTR). And the python program resumes

Re: Only getting the first 6 lines

2015-10-01 Thread Ian Kelly
On Thu, Oct 1, 2015 at 3:58 PM, Cecil Westerhof wrote: > I want to get the first 6 lines of ps output. For this I use: > > from subprocess import check_output > > ps_command = ('ps', '-eo',

Re: Check if a given value is out of certain range

2015-10-01 Thread Chris Kaynor
On Thu, Oct 1, 2015 at 3:03 PM, Ian Kelly wrote: > On Thu, Oct 1, 2015 at 3:45 PM, John Gordon wrote: > > In <87r3le1ht3@elektro.pacujo.net> Marko Rauhamaa > > writes: > >> Wouldn't > > > >>x < 0 or 10 < x > > > >> be even more

Re: Check if a given value is out of certain range

2015-10-01 Thread John Gordon
In <87r3le1ht3@elektro.pacujo.net> Marko Rauhamaa writes: > > I wasn't commenting directly to the "ask not..." quote; I was > > referring upthread to the choice between > > > > not 0 <= x <= 10 > > > > and > > > > x < 0 or x > 10 > > > > Both are of course

[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor
STINNER Victor added the comment: sys_setrecursionlimit-4.patch: - enhance documentation and comments - combined with end_rec_check.patch: make the lower-water mark monotonic - add _Py_RecursionLimitLowerWaterMark() macro used by _Py_MakeEndRecCheck() and sys.setrecursionlimit() --

[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor
STINNER Victor added the comment: > _Py_MakeEndRecCheck() was changed in issue5392 (noised Antoine as a > committer). Oh, I didn't know this issue. If I am right, it's a duplicate of this issue, even if it was a little bit different because the lower-water mark was computed differently. >

Only getting the first 6 lines

2015-10-01 Thread Cecil Westerhof
I want to get the first 6 lines of ps output. For this I use: from subprocess import check_output ps_command = ('ps', '-eo', 'user,pid,pcpu,pmem,stat,start,time,cmd', '--sort') message = '\n'.join(check_output(ps_command +

[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor
STINNER Victor added the comment: > An alternative would be to remove completly the overflowed flag with its > fatal error. It was introduced during large refactoring of Python, maybe the > bug cannot occur anymore? By the way, it doesn't exist in Python 2 at all. Try attached

Re: Check if a given value is out of certain range

2015-10-01 Thread Ian Kelly
On Thu, Oct 1, 2015 at 3:45 PM, John Gordon wrote: > In <87r3le1ht3@elektro.pacujo.net> Marko Rauhamaa > writes: >> Wouldn't > >>x < 0 or 10 < x > >> be even more visual? > > [SNIP] > > Another strike is that the code isn't consistent with itself; it

[issue10487] http.server doesn't process Status header from CGI scripts

2015-10-01 Thread Martin Panter
Martin Panter added the comment: Issue 13893 was closed as a duplicate of this issue. There are patches and modified code there that may be worth looking at though. -- nosy: +martin.panter superseder: Make CGIHTTPServer capable of redirects (and status other than 200) ->

Re: Generating a vector from successive multiplications of another vector from an initial value

2015-10-01 Thread Oscar Benjamin
On Thu, 1 Oct 2015 21:51 Paulo da Silva wrote: Hi all. What is the fastest way to do the following: I have an initial value V and a vector vec of (financial) indexes. I want to generate a new vector nvec as V, V*vec[0], V*vec[0]*vec[1], V*vec[0]*vec[1]*vec[2],

Re: Generating a vector from successive multiplications of another vector from an initial value

2015-10-01 Thread duncan smith
On 01/10/15 21:45, Paulo da Silva wrote: > Hi all. > > What is the fastest way to do the following: > > I have an initial value V and a vector vec of (financial) indexes. > I want to generate a new vector nvec as > > V, V*vec[0], V*vec[0]*vec[1], V*vec[0]*vec[1]*vec[2], ... > > A numpy

Re: Question about regular expression

2015-10-01 Thread Denis McMahon
On Thu, 01 Oct 2015 15:53:38 +, Rob Gaddi wrote: > There's a quote for this. 'Some people, when confronted with a problem, > think “I know, I'll use regular expressions.” Now they have two > problems.' I actually used 2 regexes: wordpatt = re.compile('[a-zA-Z]+') numpatt =

Re: Question about regular expression

2015-10-01 Thread gal kauffman
On Oct 2, 2015 12:35 AM, "Denis McMahon" wrote: > > On Thu, 01 Oct 2015 01:48:03 -0700, gal kauffman wrote: > > > items = s.replace(' (', '(').replace(', ',',').split() > > > > items_dict = dict() > > for item in items: > > if '(' not in item: > > item +=

[issue25165] Windows uninstallation should not remove launcher if other versions remain

2015-10-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset a2d30dfa46a7 by Steve Dower in branch '3.5': Issue #25165: Windows uninstallation should not remove launcher if other versions remain https://hg.python.org/cpython/rev/a2d30dfa46a7 -- nosy: +python-dev

[issue25256] Add sys.debug_build public variable to check if Python was compiled in debug mode

2015-10-01 Thread STINNER Victor
STINNER Victor added the comment: FYI the sys module has 5 more symbols when CPython is compiled in debug mode: * getobjects() * gettotalrefcount() * last_traceback, last_type, last_value -- ___ Python tracker

[issue25256] Add sys.debug_build public variable to check if Python was compiled in debug mode

2015-10-01 Thread STINNER Victor
STINNER Victor added the comment: >> You also can check ``'d' in sys.abiflags`` if it looks cleaner to you. > For me, it doesn't look correct to have various ways to check if python was > compiled in debug mode. It doesn't look portable neither. (...) Oops, I didn't notice that sys.abiflags

[issue12238] Readline module loading in interactive mode

2015-10-01 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___

Re: Check if a given value is out of certain range

2015-10-01 Thread Mark Lawrence
On 01/10/2015 19:18, Steven D'Aprano wrote: On Thu, 1 Oct 2015 08:31 am, Mark Lawrence wrote: What is so "yuck" about that? What would you do instead? It seems like the best solution to me. Easy to read, fast to execute. I have to parse those damn brackets and then figure out the

Re: Pandas Left Merge with xlsx with CSV producing null value columns in output

2015-10-01 Thread Mark Lawrence
On 01/10/2015 16:03, kbtyo wrote: I would appreciate any feedback on the following question that I have raised here: http://stackoverflow.com/questions/32889129/pandas-left-merge-with-xlsx-with-csv-producing-null-value-columns-in-output Thank you for your feedback and support. I was going

[issue25272] asyncio tests are getting noisy

2015-10-01 Thread STINNER Victor
STINNER Victor added the comment: > Executing coro= /media/disk/home/proj/python/cpython/Lib/test/test_asyncio/test_pep492.py:146> > result=None created at > /media/disk/home/proj/python/cpython/Lib/asyncio/base_events.py:323>

[issue25171] does not build on OpenBSD with no value defined for PY_GETENTROPY

2015-10-01 Thread STINNER Victor
STINNER Victor added the comment: Thanks Remi for your fix, the compilation succeeded on the buildbot. Sorry for the regression. -- resolution: -> fixed status: open -> closed ___ Python tracker

reg multiple login python

2015-10-01 Thread harirammanohar159
Hi All, Is there anyway i can login to remote servers at once and do the activity, i can do one by one using for loop.. Thanks in advance. -- https://mail.python.org/mailman/listinfo/python-list

Re: reg multiple login python

2015-10-01 Thread Laura Creighton
In a message of Thu, 01 Oct 2015 00:04:16 -0700, harirammanohar...@gmail.com wr ites: >Hi All, > >Is there anyway i can login to remote servers at once and do the activity, i >can do one by one using for loop.. > >Thanks in advance. >-- >https://mail.python.org/mailman/listinfo/python-list I am

Re: Check if a given value is out of certain range

2015-10-01 Thread Ian Kelly
On Wed, Sep 30, 2015 at 2:19 PM, alister wrote: > On Wed, 30 Sep 2015 21:06:02 +0300, Marko Rauhamaa wrote: > >> Grant Edwards : >> >>> not (0 <= x <= 10) (I) >>> [...] >>>(x < 0) or (x > 10) (II) >>> [...] >>> IMO,

[issue25286] views are not sequences

2015-10-01 Thread Martin Panter
Martin Panter added the comment: If changing the glossary heading, make sure it is kept in alphabetical order and incoming links still work (e.g. look for `view` and ). And maybe “dictionary view” (full spelling, and singular) would be a more accurate heading. The text changes look good

[issue25287] test_crypt fails on OpenBSD

2015-10-01 Thread STINNER Victor
New submission from STINNER Victor: It looks like crypt.crypt('', crypt.METHOD_CRYPT) returns None. This method must be excluded from crypt.methods. Attached patch should fix the issue, but I didn't try it on OpenBSD. Python 3.4-3.6 is affect, Python 2.7 is not affect (crypt.methods was

[issue25284] Spec for BaseEventLoop.run_in_executor(executor, callback, *args) is outdated in documentation

2015-10-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: Fixed in 9a10055e12fa d7d18ef3e05c 1465b18ef4fc -- nosy: +asvetlov resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.4, Python 3.6 ___ Python tracker

[issue25287] test_crypt fails on OpenBSD

2015-10-01 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +rpointel ___ Python tracker ___ ___

[issue25274] "./python -m test test_sys": Fatal Python error: Cannot recover from stack overflow

2015-10-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 60c4fd84ef92 by Victor Stinner in branch '3.4': Issue #25274: test_recursionlimit_recovery() of test_sys now checks https://hg.python.org/cpython/rev/60c4fd84ef92 New changeset 898a9a959927 by Victor Stinner in branch '3.5': (Merge 3.4) Issue

Re: execute commands as su on remote server

2015-10-01 Thread harirammanohar159
On Tuesday, 18 August 2015 08:27:33 UTC+5:30, hariramm...@gmail.com wrote: > execute commands as su on remote server > > Postby hariram » Mon Aug 17, 2015 4:02 am > Needed: > I need to execute commands after doing su to other user on remote server(not > sudo which doesn't require password) how

[issue25286] views are not sequences

2015-10-01 Thread Akira Li
Akira Li added the comment: Thank you for `view`, hint. I did look for :term:`view` that was obviously not enough. The new patch contains the renamed entry in the correct place. All `view`, ` occurrences dictionary view are updated now. -- Added file:

[issue14566] run_cgi reverts to using unnormalized path

2015-10-01 Thread Martin Panter
Martin Panter added the comment: This was also reported in Issue 19435. The combination changes for Issue 19435 + Issue 21323 looks essentially like the proposed change here. Issue 14567 remains about the double processing of paths. -- nosy: +martin.panter resolution: -> duplicate

[issue25288] readline.py file in current directory caused unexpected code execution.

2015-10-01 Thread Hiroki Kiyohara
Hiroki Kiyohara added the comment: I see. Thank you very much, guys. -- ___ Python tracker ___ ___

Re: Generating a vector from successive multiplications of another vector from an initial value

2015-10-01 Thread Paulo da Silva
Às 23:36 de 01-10-2015, Oscar Benjamin escreveu: > > On Thu, 1 Oct 2015 21:51 Paulo da Silva > wrote: ... > > V * np.cumprod(vec) > Thank you very much Oscar and Duncan. I googled a lot for such a function.

Re: The Nikola project is deprecating Python 2.7 (+2.x/3.x user survey results)

2015-10-01 Thread Terry Reedy
On 10/1/2015 12:26 PM, Chris Warrick wrote: The Nikola developers decided to deprecate Python 2.7 support. Starting with v7.7.2, Nikola will display a warning if Python 2.7 is used (but it will still be fully supported). In early 2016, Nikola v8.0.0 will come out, and that release will not

[issue25276] test_decimal sometimes crash on PPC64 AIX 3.x

2015-10-01 Thread David Edelsohn
David Edelsohn added the comment: The system has 128GB of memory. The process limits are set to unlimited for data. AIX defaults to 32 bit, although all processors are 64 bit, so the buildbot runs as 32 bit. What does low free memory in the buildbot mean? I'm surprised that Python requires

[issue14565] Allow multilevel subdirectories in cgi_directories

2015-10-01 Thread Martin Panter
Martin Panter added the comment: This smells like a new feature to me, because it is clearly not supported by the existing code. If you wanted to fix the existing released versions of Python, I think it would be better to clarify the documentation. -- nosy: +martin.panter title:

[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread STINNER Victor
STINNER Victor added the comment: sys_setrecursionlimit-2.patch: fix error message, exchange the last 2 PyErr_Format() parameters. -- Added file: http://bugs.python.org/file40642/sys_setrecursionlimit-2.patch ___ Python tracker

[issue14567] http.server query string handling is incorrect and inefficient

2015-10-01 Thread Martin Panter
Martin Panter added the comment: I think the decision on how to parse the “path” attribute has to be left up to each request handler implementation, rather than being done blindly in BaseHTTPRequestHandler.parse_request(). The reason is there are various forms of HTTP request target that

[issue24657] CGIHTTPServer module discard continuous '/' letters from params given by GET method.

2015-10-01 Thread Martin Panter
Martin Panter added the comment: The patch looks like it will fix this particular bug without much negative impact. However there are plenty of other problems with this module’s URL handling, see Issue 14567. I think the translate_path(), _url_collapse_path(), is_cgi(), run_cgi(), etc

Re: reg multiple login python

2015-10-01 Thread harirammanohar159
On Thursday, 1 October 2015 12:35:01 UTC+5:30, hariramm...@gmail.com wrote: > Hi All, > > Is there anyway i can login to remote servers at once and do the activity, i > can do one by one using for loop.. > > Thanks in advance. Hi Laura, I have checked fabric tutorial and examples, it didn't

Re: Check if a given value is out of certain range

2015-10-01 Thread alister
On Wed, 30 Sep 2015 14:46:48 -0600, Ian Kelly wrote: > On Wed, Sep 30, 2015 at 2:19 PM, alister > wrote: >> On Wed, 30 Sep 2015 21:06:02 +0300, Marko Rauhamaa wrote: >> >>> Grant Edwards : >>> not (0 <= x <= 10) (I)

Re: Question about regular expression

2015-10-01 Thread gal kauffman
items = s.replace(' (', '(').replace(', ',',').split() items_dict = dict() for item in items: if '(' not in item: item += '(0,0)' if ',' not in item: item = item.replace(')', ',0)') name, raw_data = item.split('(') data_tuple = tuple((int(v) for v in

Re: Check if a given value is out of certain range

2015-10-01 Thread alister
On Thu, 01 Oct 2015 18:37:50 +1000, Chris Angelico wrote: > On Thu, Oct 1, 2015 at 6:33 PM, alister > wrote: >> The recommended phase is Stay calm >> >> Stay: ok dont change anything, whats next >> Calm ok I am calm that's alright then > > Yes,

[issue25280] Message can be formatted twice in importlib

2015-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Brett for your review. -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

Re: Check if a given value is out of certain range

2015-10-01 Thread Chris Angelico
On Thu, Oct 1, 2015 at 6:33 PM, alister wrote: > The recommended phase is Stay calm > > Stay: ok dont change anything, whats next > Calm > ok I am calm that's alright then Yes, because that always works. Okay. Alright. I'm calm. *throws

[issue25280] Message can be formatted twice in importlib

2015-10-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset da42b38f7470 by Serhiy Storchaka in branch '3.4': Issue #25280: Import trace messages emitted in verbose (-v) mode are no https://hg.python.org/cpython/rev/da42b38f7470 New changeset 10c13441bf8d by Serhiy Storchaka in branch '3.5': Issue #25280:

Re: reg multiple login python

2015-10-01 Thread Laura Creighton
In a message of Thu, 01 Oct 2015 01:25:47 -0700, harirammanohar...@gmail.com wr ites: >On Thursday, 1 October 2015 12:35:01 UTC+5:30, hariramm...@gmail.com wrote: >> Hi All, >> >> Is there anyway i can login to remote servers at once and do the activity, i >> can do one by one using for loop..

[issue25274] sys.setrecursionlimit() must fail if the current recursion depth is higher than the new low-water mark

2015-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > ValueError: cannot set recursion limit to 2: the minimum recursion limit is 1 > at the recursion depth 1 This message looks confusing to me. 2 > 1, isn't? The dependency of min_limit from new_limit is not monotonic: new_limit = 99 => min_limit = 74

Re: reg multiple login python

2015-10-01 Thread Michael Ströder
harirammanohar...@gmail.com wrote: > I have checked fabric tutorial and examples, it didn't sound that using fab > we can do/push the thing at same time in all servers. What does that mean? Since the posting's subject contains "login" are you trying to minimize the number of authentications

[issue25288] readline.py file in current directory caused unexpected code execution.

2015-10-01 Thread Hiroki Kiyohara
New submission from Hiroki Kiyohara: Running `python` interpreter will import `readline.py` file in current directory. It causes unexpected code execution. This problem is reported by 'Japan Vulnerability Notes' as a bug on Windows version Python http://jvn.jp/jp/JVN49503705/ It says that

[issue21995] Idle: pseudofiles have no buffer attribute.

2015-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yet one example of test stream that has no buffer - stdprinter used as sys.stderr on early stage of Python startup. -- ___ Python tracker

<    1   2