Re: The Most Diabolical Python Antipattern

2015-01-30 Thread Ian Kelly
On Fri, Jan 30, 2015 at 3:00 AM, Marko Rauhamaa ma...@pacujo.net wrote: Marko Rauhamaa ma...@pacujo.net: Surprisingly this variant could raise an unexpected exception: == try: do_interesting_stuff() except ValueError: try:

[issue2292] Missing *-unpacking generalizations

2015-01-30 Thread Neil Girdhar
Neil Girdhar added the comment: Another bug, another test. -- Added file: http://bugs.python.org/file37926/starunpack29.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292 ___

Re: parsing tree from excel sheet

2015-01-30 Thread Peter Otten
alb wrote: Hi Peter, I'll try to comment the code below to verify if I understood it correctly or missing some major parts. Comments are just below code with the intent to let you read the code first and my understanding afterwards. Let's start with the simplest: Peter Otten

Re: parsing tree from excel sheet

2015-01-30 Thread Peter Otten
Peter Otten wrote: [A, A1, A21, A22] Finally the append_nodes(A3, nodes) will append A3 and then return because it has no children, and we end up with nodes = [A, A1, A21, A22, A3] Yay, proofreading! Both lists should contain A2: [A, A1, A2, A21, A22] nodes = [A, A1, A2, A21, A22, A3]

[issue23348] distutils.LooseVersion fails to compare two valid versions

2015-01-30 Thread Guillaume
Guillaume added the comment: Do you mean http://bugs.python.org/issue14894 ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23348 ___ ___

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Rustom Mody
On Friday, January 30, 2015 at 1:03:03 PM UTC+5:30, Christian Gollwitzer wrote: Am 30.01.15 um 02:40 schrieb Rustom Mody: FORTRAN use dictionary type(dictionary), pointer :: d d=dict_new() call set(d//'toto',1) v = d//'toto' call dict_free(d) The corresponding python

[issue23284] Improve termcap detection in setup.py

2015-01-30 Thread Stefan Krah
Stefan Krah added the comment: FWIW, even http://www.linuxfromscratch.org/lfs/view/stable/chapter06/readline.html enforces -ncurses linking of readline. [They should be compiling ncurses with tinfo split out though and use -tinfo instead.] -- ___

Python tracker manual password reset

2015-01-30 Thread Ian Kelly
I just tried to use the password recovery tool for the Python tracker. I entered my personal email. It sent me the confirmation email with the password reset link, which I followed. It then reset my password and sent an email to a different address, an old work address that I no longer have, so I

how to parse sys.argv as dynamic parameters to another function?

2015-01-30 Thread Robert Chen
how to parse sys.argv as dynamic parameters to another function? fun(sys.argv) in perl, this is very easy. please help. -- https://mail.python.org/mailman/listinfo/python-list

[issue23351] socket.settimeout(5.0) does not have any effect

2015-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: The test script works on Ubuntu 14.10 as well. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23351 ___ ___

Re: The Most Diabolical Python Antipattern

2015-01-30 Thread Ian Kelly
On Fri, Jan 30, 2015 at 8:30 AM, Marko Rauhamaa ma...@pacujo.net wrote: Ian Kelly ian.g.ke...@gmail.com: The bare raise re-raises the most recent exception that is being handled. The raise e raises that exception specifically, which is not the most recent in the case of a secondary exception.

Re: The Most Diabolical Python Antipattern

2015-01-30 Thread Marko Rauhamaa
Ian Kelly ian.g.ke...@gmail.com: Like I suggested earlier, just don't catch the inner exception at all. The result will be both exceptions propagated, chained in the proper order. Depends on the situation. Marko -- https://mail.python.org/mailman/listinfo/python-list

[issue2292] Missing *-unpacking generalizations

2015-01-30 Thread Neil Girdhar
Neil Girdhar added the comment: Fixed a bug in ceval.c; added a test to test_unpack_ex. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292 ___

[issue2292] Missing *-unpacking generalizations

2015-01-30 Thread Neil Girdhar
Changes by Neil Girdhar mistersh...@gmail.com: Added file: http://bugs.python.org/file37924/starunpack28.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292 ___

[issue2292] Missing *-unpacking generalizations

2015-01-30 Thread Neil Girdhar
Changes by Neil Girdhar mistersh...@gmail.com: Added file: http://bugs.python.org/file37925/starunpack28.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292 ___

Re: Installling ADODB on an offline computer

2015-01-30 Thread Alan Meyer
On 01/30/2015 09:45 AM, bkl...@rksystems.com wrote: On Thursday, January 29, 2015 at 8:35:50 PM UTC-5, Alan Meyer wrote: I work on an application that uses the ActivePython compilation of Python from ActiveState. It uses three Microsoft COM libraries that are needed for talking to SQL Server.

Re: The Most Diabolical Python Antipattern

2015-01-30 Thread Ian Kelly
On Fri, Jan 30, 2015 at 8:56 AM, Marko Rauhamaa ma...@pacujo.net wrote: Ian Kelly ian.g.ke...@gmail.com: Like I suggested earlier, just don't catch the inner exception at all. The result will be both exceptions propagated, chained in the proper order. Depends on the situation. Like what?

[issue23353] gnerator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: I simplified the script even more: 287 lines (6 functions/generators, 7 classes/exceptions) = 28 lines (1 generator)! -- Added file: http://bugs.python.org/file37923/excinfo_bug6.py ___ Python tracker

Re: The Most Diabolical Python Antipattern

2015-01-30 Thread Chris Angelico
On Sat, Jan 31, 2015 at 2:42 AM, Ian Kelly ian.g.ke...@gmail.com wrote: Like I suggested earlier, just don't catch the inner exception at all. The result will be both exceptions propagated, chained in the proper order. So many MANY times, the best thing to do with unrecognized exceptions is

[issue23348] distutils.LooseVersion fails to compare two valid versions

2015-01-30 Thread Éric Araujo
Éric Araujo added the comment: Thanks for the report. I think there’s already a long discussion in another ticket but don’t have time to search right now. -- resolution: - duplicate ___ Python tracker rep...@bugs.python.org

[issue2292] Missing *-unpacking generalizations

2015-01-30 Thread Guido van Rossum
Guido van Rossum added the comment: For the PEP update, please check out the PEP repo at hg.python.org and send a patch to p...@python.org. On Jan 30, 2015 3:54 AM, Neil Girdhar rep...@bugs.python.org wrote: Neil Girdhar added the comment: Is it possible to edit the PEP to reflect the

Re: how to parse sys.argv as dynamic parameters to another function?

2015-01-30 Thread Ian Kelly
On Fri, Jan 30, 2015 at 9:09 AM, Robert Chen robertchen...@gmail.com wrote: how to parse sys.argv as dynamic parameters to another function? fun(sys.argv) in perl, this is very easy. please help. Do you mean that you want each item of sys.argv to be passed as a separate parameter to the

[issue2292] Missing *-unpacking generalizations

2015-01-30 Thread Neil Girdhar
Changes by Neil Girdhar mistersh...@gmail.com: Removed file: http://bugs.python.org/file37924/starunpack28.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292 ___

Re: how to parse sys.argv as dynamic parameters to another function?

2015-01-30 Thread Skip Montanaro
On Fri, Jan 30, 2015 at 10:09 AM, Robert Chen robertchen...@gmail.com wrote: how to parse sys.argv as dynamic parameters to another function? fun(sys.argv) Not sure what you mean by dynamic, but I think you already have it, assuming fun is a function which accepts a single list of strings

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 09:27 AM, Rustom Mody wrote: ... if I restate that in other words it says that sufficiently complex data structures will be beyond the reach of the standard RAII infrastructure. Of course this only brings up one side of memory-mgmt problems viz. unreclaimable memory. What

[issue23349] PyBuffer_ToContiguous() off-by-one error for non-contiguous buffers

2015-01-30 Thread Stefan Krah
Stefan Krah added the comment: Looks good, here's a patch with tests. -- Added file: http://bugs.python.org/file37927/issue23349-2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23349

Re: The Most Diabolical Python Antipattern

2015-01-30 Thread Marko Rauhamaa
Ian Kelly ian.g.ke...@gmail.com: The bare raise re-raises the most recent exception that is being handled. The raise e raises that exception specifically, which is not the most recent in the case of a secondary exception. Scary. That affects all finally clauses. Must remember that. The

[issue14894] distutils.LooseVersion fails to compare number and a word

2015-01-30 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- assignee: eric.araujo - versions: +Python 3.5 -Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14894 ___

Re: RAII vs gc (was fortran lib which provide python like data type)

2015-01-30 Thread Sturla Molden
Rustom Mody rustompm...@gmail.com wrote: The case of RAII vs gc is hardly conclusive: http://stackoverflow.com/questions/228620/garbage-collection-in-c-why The purpose of RAII is not to be an alternative to garbage collection (which the those answers imply), but to ensure deterministc

[issue23055] PyUnicode_FromFormatV crasher

2015-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Backported tests exposed off-by-one error in PyUnicode_FromFormatV. This error was fixed in 3.x in changeset ac768c8e13ac (issue7228). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23055

Re: Python is DOOMED! Again!

2015-01-30 Thread Ian Kelly
On Fri, Jan 30, 2015 at 11:42 AM, Mario Figueiredo mar...@gmail.com wrote: To be clear, type declarations in Julia, Scala, C have the potential to produce side-effects, can result in optimized code and can result in compile time errors or warnings. They also affect runtime evaluation as you

[issue23348] distutils.LooseVersion fails to compare two valid versions

2015-01-30 Thread Éric Araujo
Éric Araujo added the comment: Yes, thanks. Please weigh in on the other ticket. -- status: open - closed superseder: - distutils.LooseVersion fails to compare number and a word ___ Python tracker rep...@bugs.python.org

[issue2292] Missing *-unpacking generalizations

2015-01-30 Thread Joshua Landau
Joshua Landau added the comment: Special-cased `(*i for i in x)` to use YIELD_FROM instead of looping. Speed improved, albeit still only half as fast as chain.from_iterable. Fixed error message check in test_syntax and removed semicolons. -- Added file:

[issue23055] PyUnicode_FromFormatV crasher

2015-01-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 245c9f372a34 by Serhiy Storchaka in branch '2.7': Issue #23055: Fixed read-past-the-end error in PyUnicode_FromFormatV. https://hg.python.org/cpython/rev/245c9f372a34 New changeset 9fe1d861f486 by Serhiy Storchaka in branch '3.2': Issue #23055:

Re: Python is DOOMED! Again!

2015-01-30 Thread Mario Figueiredo
In article 54ca5bbf$0$12992$c3e8da3$54964...@news.astraweb.com, steve+comp.lang.pyt...@pearwood.info says... Why should I feel guilty? You wrote: Static analysis cannot and should not clutter executable code. But what are type declarations in statically typed languages like C,

[issue20416] Marshal: special case int and float, don't use references

2015-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here are results of the benchmark which measures dump and load time for all pyc files in the stdlib (including tests). https://bitbucket.org/storchaka/cpython-stuff/src/default/marshal/marshalbench.py $ find * -name __pycache__ -exec rm -rf '{}' + $

[issue23055] PyUnicode_FromFormatV crasher

2015-01-30 Thread Stefan Krah
Stefan Krah added the comment: I think in 2.7 there's a slight problem since e6b9e277fbf4: [1/1] test_unicode Debug memory block at address p=0x7f4ebba3fae0: API 'o' 100 bytes originally requested The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected. The 8 pad bytes at

[issue23352] PyBuffer_IsContiguous() sometimes returns wrong result if suboffsets != NULL

2015-01-30 Thread Richard Hansen
Richard Hansen added the comment: People might rely on the fact that contiguous implies suboffsets==NULL. Cython (currently) relies on all-negatives being acceptable and equivalent to suboffsets==NULL. See: https://github.com/cython/cython/pull/367

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-30 Thread Sturla Molden
Skip Montanaro skip.montan...@gmail.com wrote: Can you explain what you see as the difference between spawn and fork in this context? Are you using Windows perhaps? I don't know anything obviously different between the two terms on Unix systems. spawn is fork + exec. Only a handful of POSIX

[issue23055] PyUnicode_FromFormatV crasher

2015-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, I think following patch will help. -- Added file: http://bugs.python.org/file37929/issue23055_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23055

[issue23055] PyUnicode_FromFormatV crasher

2015-01-30 Thread Stefan Krah
Stefan Krah added the comment: issue23055_2.patch looks good. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23055 ___ ___ Python-bugs-list

[issue11578] Increase test coverage for timeit.py

2015-01-30 Thread koobs
Changes by koobs koobs.free...@gmail.com: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11578 ___ ___ Python-bugs-list

[issue23055] PyUnicode_FromFormatV crasher

2015-01-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset e5d79e6deeb5 by Serhiy Storchaka in branch '2.7': Issue #23055: Fixed off-by-one error in PyUnicode_FromFormatV. https://hg.python.org/cpython/rev/e5d79e6deeb5 -- ___ Python tracker

[issue2292] Missing *-unpacking generalizations

2015-01-30 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: -eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292 ___ ___ Python-bugs-list

[issue11578] Increase test coverage for timeit.py

2015-01-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11578 ___ ___

[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2015-01-30 Thread Matt Frank
Matt Frank added the comment: Apologies. That last patch includes diffs to generated files (configure and pyconfig.h.in). This version just patches Modules/pwdmodule.c and configure.ac. After applying the patch please run autoheader and autoconf to correctly regenerate configure and

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Sturla Molden
Michael Torrie torr...@gmail.com wrote: Yes I can tell you haven't used C++. Compared to C, I've always found memory management in C++ to be quite a lot easier. The main reason is that C++ guarantees objects will be destroyed when going out of scope. So when designing a class, you put any

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-30 Thread Sturla Molden
Andres Riancho andres.rian...@gmail.com wrote: Spawn, and I took that from the multiprocessing 3 documentation, will create a new process without using fork(). This means that no memory is shared between the MainProcess and the spawn'ed sub-process created by multiprocessing. If you

[issue23055] PyUnicode_FromFormatV crasher

2015-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Stefan for pointing on tests failure. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23055 ___ ___

[issue23055] PyUnicode_FromFormatV crasher

2015-01-30 Thread Stefan Krah
Stefan Krah added the comment: I think I still get a problem in 2.7: [1/1] test_unicode ==23430== Invalid read of size 1 ==23430==at 0x484541: PyUnicodeUCS2_FromFormatV (unicodeobject.c:736) ==23430==by 0x485C75: PyUnicodeUCS2_FromFormat (unicodeobject.c:1083) 736 for (f =

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-30 Thread Marko Rauhamaa
Sturla Molden sturla.mol...@gmail.com: Only a handful of POSIX functions are required to be fork safe, i.e. callable on each side of a fork without an exec. That is a pretty surprising statement. Forking without an exec is a routine way to do multiprocessing. I understand there are things to

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Gregory Ewing
Michael Torrie wrote: On 01/30/2015 10:31 AM, Rustom Mody wrote: And what about the grey area between lightweight and heavyweight? That's what the smart pointers are for. I'd say it's what higher-level languages are for. :-) I'm completely convinced nowadays that there is *no* use case

[issue22986] Improved handling of __class__ assignment

2015-01-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset c0d25de5919e by Benjamin Peterson in branch 'default': allow changing __class__ between a heaptype and non-heaptype in some cases (closes #22986) https://hg.python.org/cpython/rev/c0d25de5919e -- resolution: - fixed stage: patch review -

Re: Python is DOOMED! Again!

2015-01-30 Thread Mario Figueiredo
In article mailman.18277.1422557674.18130.python-l...@python.org, breamore...@yahoo.co.uk says... No, they're not always weakly typed. The aim of the spreadsheet put up by Skip was to sort out (roughly) which languages belong in which camp. I do not regard myself as suitably qualified

[issue23349] PyBuffer_ToContiguous() off-by-one error for non-contiguous buffers

2015-01-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset a9305102c892 by Stefan Krah in branch '2.7': Issue #23349: Fix off-by-one error in PyBuffer_ToContiguous(). Initial patch https://hg.python.org/cpython/rev/a9305102c892 -- nosy: +python-dev ___ Python

[issue16318] FTP_TLS in ftplib not supporting prot_p storlines in FTP7.5

2015-01-30 Thread Lukasz Szybalski
Lukasz Szybalski added the comment: Hello, We are having issues usign ftplib for implicit TLS over port 990 I'm referencing a solution that states For the implicit FTP TLS/SSL(defualt port 990), our client program must build a TLS/SSL connection right after the socket is created. But

Multiplexing 2 streams with asyncio

2015-01-30 Thread Paul Moore
I'm trying to get to grips with asyncio. I *think* it's a reasonable fit for my problem, but I'm not really sure - so if the answer is you shouldn't be doing that, then that's fair enough :-) What I am trying to do is, given 2 files (the stdout and stderr from a subprocess.Popen object, as it

[issue8534] multiprocessing not working from egg

2015-01-30 Thread Davin Potts
Davin Potts added the comment: The example demonstrating the issue is reproducible on Windows (tested on Windows 7 64-bit, specifically) with 2.7.9. Complications arising from how multiprocessing creates new processes on Windows combined with conventions in the import system in 2.7.9 result

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Rustom Mody
On Friday, January 30, 2015 at 10:39:12 PM UTC+5:30, Michael Torrie wrote: On 01/30/2015 09:27 AM, Rustom Mody wrote: ... if I restate that in other words it says that sufficiently complex data structures will be beyond the reach of the standard RAII infrastructure. Of course this only

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 10:31 AM, Rustom Mody wrote: And what about the grey area between lightweight and heavyweight? That's what the smart pointers are for. You say just use copy constructors and no pointers. Can you (ie C++) guarantee that no pointer is ever copied out of scope of these

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Paul Rubin
Michael Torrie torr...@gmail.com writes: Follow basic [C++] rules and 99% of segfaults will never happen and the majority of leaks will not happen either. That is a safe and simple approach, but it works by copying data all over the place instead of passing pointers, resulting in performance

Re: Python is DOOMED! Again!

2015-01-30 Thread Mario Figueiredo
In article 54ca5bbf$0$12992$c3e8da3$54964...@news.astraweb.com, steve+comp.lang.pyt...@pearwood.info says... Why should I feel guilty? You wrote: Static analysis cannot and should not clutter executable code. But what are type declarations in statically typed languages like C,

Re: how to parse sys.argv as dynamic parameters to another function?

2015-01-30 Thread Ned Batchelder
On 1/30/15 11:28 AM, Ian Kelly wrote: On Fri, Jan 30, 2015 at 9:09 AM, Robert Chen robertchen...@gmail.com wrote: how to parse sys.argv as dynamic parameters to another function? fun(sys.argv) in perl, this is very easy. please help. Do you mean that you want each item of sys.argv to be

Re: Python is DOOMED! Again!

2015-01-30 Thread Skip Montanaro
On Fri, Jan 30, 2015 at 12:50 PM, Mario Figueiredo mar...@gmail.com wrote: It would help that if instead of weakly typed or strongly typed box, they could be classified comparatively to each other. The terms are better suited to describe two languages as they stand to each other. Weakly

[issue11578] Increase test coverage for timeit.py

2015-01-30 Thread Stefan Krah
Stefan Krah added the comment: I think all 2.7 bots are broken. :) -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11578 ___ ___

[issue23352] PyBuffer_IsContiguous() sometimes returns wrong result if suboffsets != NULL

2015-01-30 Thread Sebastian Berg
Sebastian Berg added the comment: Numpy does not understand suboffsets. The buffers we create will always have them NULL. The other way around To be honest, think it is probably ignoring the whole fact that they might exist at all :/, really needs to be fixed if it is the case.

RAII vs gc (was fortran lib which provide python like data type)

2015-01-30 Thread Rustom Mody
On Friday, January 30, 2015 at 11:01:50 PM UTC+5:30, Rustom Mody wrote: On Friday, January 30, 2015 at 10:39:12 PM UTC+5:30, Michael Torrie wrote: On 01/30/2015 09:27 AM, Rustom Mody wrote: ... if I restate that in other words it says that sufficiently complex data structures will be

Re: Multiplexing 2 streams with asyncio

2015-01-30 Thread Ian Kelly
On Fri, Jan 30, 2015 at 11:45 AM, Paul Moore p.f.mo...@gmail.com wrote: 2. Because on Windows I'd have to use threads, whereas asyncio uses IO completion ports behind the scenes (I think) which are probably a lot more lightweight. I have no idea whether that's true, but note that

[issue23055] PyUnicode_FromFormatV crasher

2015-01-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23055 ___ ___

[issue23350] Content-length is incorrect when request body is a list or tuple

2015-01-30 Thread Demian Brecht
Demian Brecht added the comment: On 2015-01-29 9:51 PM, Martin Panter wrote: The documentation currently says “Content-Length header should be explicitly provided when the body is an iterable”. See Lib/urllib/request.py:1133 for how it is done for urlopen(), using memoryview(), which is

[issue14613] time.time can return NaN

2015-01-30 Thread matham
matham added the comment: Ok, first, I was able to make it happen outside of kivy using only my code. However, I'm not sure it's of much help because it's using my ffmpeg based code (https://github.com/matham/ffpyplayer) which is not a simple script :) The issue happens when ffmpeg emits logs

Create dictionary based of x items per key from two lists

2015-01-30 Thread rajanbond
I have two lists l1 = [a,b,c,d,e,f,g,h,i,j] l2 = [aR,bR,cR] l2 will always be smaller or equal to l1 numL1PerL2 = len(l1)/len(l2) I want to create a dictionary that has key from l1 and value from l2 based on numL1PerL2 So { a:aR, b:aR, c:aR, d:bR, e:bR, f:bR, g:cR, h:cR, i:cR, j:cR } So

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Steven D'Aprano
Michael Torrie wrote: If that happened, then it's because you the programmer wanted it to happen.  It's not just going to happen all by itself.  Yes anytime pointers are allowed, things are potentially unsafe in the hands of a programmer.  I'm just saying it's not nearly so bad as you make it

Re: Python tracker manual password reset

2015-01-30 Thread Steven D'Aprano
Ian Kelly wrote: I just tried to use the password recovery tool for the Python tracker. I entered my personal email. It sent me the confirmation email with the password reset link, which I followed. It then reset my password and sent an email to a different address, an old work address that I

[issue11578] Increase test coverage for timeit.py

2015-01-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset aa6f8e067ec3 by Serhiy Storchaka in branch '2.7': Use float division to avoid deprecation warning in test_timeit (issue #11578). https://hg.python.org/cpython/rev/aa6f8e067ec3 -- ___ Python tracker

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: Last major change related to generators in Python/ceval.c: --- changeset: 47594:212a1fee6bf9 parent: 47585:b0ef00187a7e user:Benjamin Peterson benja...@python.org date:Wed Jun 11 15:59:43 2008 + files: Doc/library/dis.rst

[issue20169] random module doc page has broken links

2015-01-30 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20169 ___

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +pitrou, serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353 ___ ___

[issue17188] Document 'from None' in raise statement doc.

2015-01-30 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag stage: needs patch - patch review versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17188

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: Attached gen_exc_value_py27.patch: Patch for Python 2.7. No unit test yet. The full test suite of trollius pass on the patched Python 2.7 and on the patched Python 3.5. The full test suite of asyncio also pass on the patched Python 3.5. -- Added

Re: The Most Diabolical Python Antipattern

2015-01-30 Thread Mark Lawrence
On 30/01/2015 08:10, Mark Lawrence wrote: On 30/01/2015 06:16, Marko Rauhamaa wrote: Ian Kelly ian.g.ke...@gmail.com: At least use except Exception instead of a bare except. Do you really want things like SystemExit and KeyboardInterrupt to get turned into 0? How about:

[issue23350] Content-length is incorrect when request body is a list or tuple

2015-01-30 Thread Martin Panter
Martin Panter added the comment: Sorry my comment was a bit rushed. I wasn’t saying this feature shouldn’t be added. I guess I was pointing out two things: 1. Someone should updated the documentation to say that Content-Length no longer has to be explicitly provided for lists and tuples. 2.

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-30 Thread Sturla Molden
On 30/01/15 23:25, Marko Rauhamaa wrote: Sturla Molden sturla.mol...@gmail.com: Only a handful of POSIX functions are required to be fork safe, i.e. callable on each side of a fork without an exec. That is a pretty surprising statement. Forking without an exec is a routine way to do

[issue14613] time.time can return NaN

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: I'm interested to investigate this issue, but right now I have no idea how to reproduce it. If I cannot reproduce the issue, I cannot investigate it. Are you able to write a short Python script to reproduce the issue? Did you modify manually the system time?

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Steven D'Aprano
Gregory Ewing wrote: I'm completely convinced nowadays that there is no use case for C++. I can think of one use-case for C++. You walk up to somebody in the street, say I wrote my own C++ parser!, and while they are gibbering and shaking in shock, you rifle through their pockets and steal

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: Attached gen_exc_value.patch changes how generators handle the currently handled exception (tstate-exc_value). The patch probably lacks tests to test the exact behaviour of sys.exc_info(). The 3 examples below can be used to write such tests. But before

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: Oh, by the way: keeping the exception after the except block is also a tricky reference leak. In Python 3, since exceptions store their traceback, this issue may keep a lot of objects alive too long, whereas they are expected to be destroyed much earlier.

Re: Create dictionary based of x items per key from two lists

2015-01-30 Thread Chris Angelico
On Sat, Jan 31, 2015 at 1:27 PM, rajanb...@gmail.com wrote: l1 = [a,b,c,d,e,f,g,h,i,j] l2 = [aR,bR,cR] l2 will always be smaller or equal to l1 numL1PerL2 = len(l1)/len(l2) I want to create a dictionary that has key from l1 and value from l2 based on numL1PerL2 So { a:aR, b:aR,

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: See also: * PEP 3134: Exception Chaining and Embedded Tracebacks (Python 3.0) * Issue #3021: Lexical exception handlers (Python 3.0) -- thread: https://mail.python.org/pipermail/python-3000/2008-May/013740.html * PEP 380: Syntax for Delegating to a

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Currently, a generator inherits the currently handled exception from the caller This is expected, since this is how normal functions behave. -- ___ Python tracker rep...@bugs.python.org

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: Currently, a generator inherits the currently handled exception from the caller This is expected, since this is how normal functions behave. Do you see how to fix the issue without changing the behaviour? --

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 04:50 PM, Steven D'Aprano wrote: Oh great. So if the average application creates a hundred thousand pointers of the course of a session, you'll only have a thousand or so seg faults and leaks. Well, that certainly explains this: https://access.redhat.com/articles/1332213 I

[issue23354] Loading 2 GiLOC file which raises exception causes wrong traceback

2015-01-30 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23354 ___ ___ Python-bugs-list

[issue23355] rsplit duplicates split behavior

2015-01-30 Thread eryksun
eryksun added the comment: The result of str.split and str.rsplit can differ depending on the optional 2nd parameter, maxsplit: 'a b c'.split(None, 1) ['a', 'b c'] 'a b c'.rsplit(None, 1) ['a b', 'c'] https://docs.python.org/2/library/stdtypes.html#str.rsplit --

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Attached patch fixes the test script and doesn't break any test. -- Added file: http://bugs.python.org/file37933/gen_exc_state_restore.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 04:12 PM, Sturla Molden wrote: Michael Torrie torr...@gmail.com wrote: Yes I can tell you haven't used C++. Compared to C, I've always found memory management in C++ to be quite a lot easier. The main reason is that C++ guarantees objects will be destroyed when going out of

Re: Sort of Augmented Reality

2015-01-30 Thread Larry Hudson
On 01/29/2015 06:55 PM, Rustom Mody wrote: [snip...] Like smelly cheese and classical music, math is an acquired taste. Actually enjoyable once you get past the initiation This comment is OT, irrelevant and only about myself... I found the appreciation of classical music instinctive and

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Note the patch also fixes the reference leak in test_asyncio. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353 ___

[issue23354] Loading 2 GiLOC file which raises exception causes wrong traceback

2015-01-30 Thread SoniEx2
New submission from SoniEx2: I loaded a file with 2 GiLOC followed by assert False and this was the error/traceback: Traceback (most recent call last): File test.py, line -2147483647, in module AssertionError -- components: Interpreter Core messages: 235079 nosy: SoniEx2 priority:

inet_http_server is only one username and passowrd in supervisor

2015-01-30 Thread shinriyo
Hi there I use supervisor. in the [inet_http_server] section, there are only one username and password username=user password=pass Do you know how to add more than two users. Thank you. -- https://mail.python.org/mailman/listinfo/python-list

  1   2   >