[issue23245] urllib2: urlopen() gets exception(kwargs bug?)

2015-02-23 Thread Douman
Douman added the comment: Just to up issue. It seems that there is some changes in 2.7.9 that breaks usage of urllib2.urlopen() -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23245 ___

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Unless we use recent PyPy with ordered dicts. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23493 ___ ___

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: Oh, forget my comment. sorted() never changes the input list, so the microbenchmark is ok. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23493 ___

Re: Future of Pypy?

2015-02-23 Thread Dave Cook
On 2015-02-22, Dave Farrance davefarra...@omitthisyahooandthis.co.uk wrote: It's still quicker to do a re-write in the more cumbersome C You should try Cython. Dave -- https://mail.python.org/mailman/listinfo/python-list

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My interpretation of the results. In CPython using operator.itemgetter() makes sorting up to 2 times faster (only 25% faster with string keys), in PyPy it make sorting slightly slower (because operator.itemgetter() is implemented in Python, but the lambda

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: CPython: $ python3.4 -m timeit -s 'f = lambda kv: kv[0]' -s 's = list(dict.fromkeys(range(1000)).items())' -- 'sorted(s, key=f)' 1000 loops, best of 3: 904 usec per loop $ python3.4 -m timeit -s 'import operator' -s 'f = operator.itemgetter(0)' -s 's =

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: If I remember correctly, the complexity and performance of sort/sorted depends if the data set is sorted or not. You may recreated the list/dictionary at each iteration to get performances closer to items = sorted(dct.items(), key=lambda kv: kv[0]) (dict keys

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: That said, it is applied only n-times and is likely insignificant when compared to the O(n log n) sort. (...) 904 usec = 462 usec is very significant: it's 49% faster. So I'm ok for the change. Note: PyPy JIT may not be able to optimize

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: My interpretation of the results. In CPython using operator.itemgetter() makes sorting up to 2 times faster If I remember correctly, Python functions implemented in C don't create a Python frame. The Python frame is an important cost in term of performances.

bufsize must be an integer in subprocess.Popen

2015-02-23 Thread Robert Clove
Hi All, I am using the Linux system with python, i am running the following script #!/usr/bin/python import threading import time import sys import subprocess import datetime import os import time import logging

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- status: languishing - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23493 ___ ___

Re: Question on asyncio

2015-02-23 Thread Marko Rauhamaa
pfranke...@gmail.com: Hello Marko! Am Sonntag, 22. Februar 2015 22:21:55 UTC+1 schrieb Marko Rauhamaa: In asyncio, you typically ignore the value returned by yield. While generators use yield to communicate results to the calling program, coroutines use yield only as a trick to implement

Re: Design thought for callbacks

2015-02-23 Thread Steven D'Aprano
Cem Karan wrote: On Feb 21, 2015, at 12:27 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: The simplest possible identity-based scheme would be something like this: # don't hate me for using a global variable CALLBACKS = [] def register(func): if func not in

Re: list storing variables

2015-02-23 Thread Marko Rauhamaa
ast nom...@invalid.com: Is there a way to define a container object able to store some variables so that a change of a variable make a change in this object content ? I dont need this feature. It is just something I am thinking about. In C language, there is A for address of A In Python,

Re: Future of Pypy?

2015-02-23 Thread Dave Farrance
Dave Cook davec...@nowhere.net wrote: On 2015-02-22, Dave Farrance davefarra...@omitthisyahooandthis.co.uk wrote: It's still quicker to do a re-write in the more cumbersome C You should try Cython. I did try Cython when I was trying to figure out what to do about the slow speed. My initial

Re: bufsize must be an integer in subprocess.Popen

2015-02-23 Thread INADA Naoki
When `shell=True`, the first argument should be string passed to shell. So you should: proc1=subprocess.Popen(/root/Desktop/abc.py 64 abc, shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE) On Mon, Feb 23, 2015 at 9:13 PM, Robert Clove cloverob...@gmail.com wrote: Hi All, I am

Re: bufsize must be an integer in subprocess.Popen

2015-02-23 Thread Shgck
On 23/02/2015 13:13, Robert Clove wrote: Hi All, I am using the Linux system with python, i am running the following script #!/usr/bin/python import threading import time import sys import subprocess import datetime import os import time import logging

list storing variables

2015-02-23 Thread ast
hi a = 2; b = 5 Li = [a, b] Li [2, 5] a=3 Li [2, 5] Ok, a change in a or b doesn't impact Li. This works as expected Is there a way to define a container object able to store some variables so that a change of a variable make a change in this object content ? I dont need this

Re: Design thought for callbacks

2015-02-23 Thread Frank Millman
Cem Karan cfkar...@gmail.com wrote in message news:a3c11a70-5846-4915-bb26-b23793b65...@gmail.com... Good questions! That was why I was asking about 'gotchas' with WeakSets originally. Honestly, the only way to know for sure would be to write two APIs for doing similar things, and then

Python shell: Arrow keys not working in PuTTY

2015-02-23 Thread David Aldrich
Hi I want to use the Python 3.4 interpreter interactively, via a PuTTY ssh session. Python is running on Centos 5. Currently, the arrow keys do not work: $ /usr/local/bin/python3.4 Python 3.4.2 (default, Feb 11 2015, 15:06:33) [GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux Type help,

Re: Python shell: Arrow keys not working in PuTTY

2015-02-23 Thread Tim Chase
On 2015-02-23 13:44, David Aldrich wrote: I want to use the Python 3.4 interpreter interactively, via a PuTTY ssh session. Python is running on Centos 5. Currently, the arrow keys do not work: [snip] sudo apt-get install libreadline-dev followed by a rebuild of Python or pip

[issue23314] Disabling CRT asserts in debug build

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: 23314_tf_inherit_check.diff: I would prefer to see this complex code in a function of the support module. For example, the SuppressCrashReport class is a good candidate. -- ___ Python tracker rep...@bugs.python.org

Re: Design thought for callbacks

2015-02-23 Thread Cem Karan
On Feb 22, 2015, at 5:29 PM, Laura Creighton l...@openend.se wrote: In a message of Sun, 22 Feb 2015 17:09:01 -0500, Cem Karan writes: Documentation is a given; it MUST be there. That said, documenting something, but still making it surprising, is a bad idea. For example, several people

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you measure the effect on json.encode()? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23493 ___ ___

Re: list storing variables

2015-02-23 Thread Dave Angel
On 02/23/2015 07:55 AM, ast wrote: hi a = 2; b = 5 Li = [a, b] Li [2, 5] a=3 Li [2, 5] Ok, a change in a or b doesn't impact Li. This works as expected Is there a way to define a container object able to store some variables so that a change of a variable make a change in this object

Python Silent Install

2015-02-23 Thread Colin Atkinson
Hi, I am deploying Python to hundreds of machines using SCCM 2012. I am using the below command to install: Msiexec /i python.msi TARGETDIR=C:\Program Files\Python ALLUSERS=1 /qn Even though I am using /qn, a command prompt still appears at the end of the install for about 5-6 seconds. Is

Re: bufsize must be an integer in subprocess.Popen

2015-02-23 Thread Chris Angelico
On Mon, Feb 23, 2015 at 11:13 PM, Robert Clove cloverob...@gmail.com wrote: proc1=subprocess.Popen(/root/Desktop/abc.py,64,abc,shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE) As others have said, you need to use either a single command or a list of strings. But why are you using

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-23 Thread Cyd Haselton
Cyd Haselton added the comment: The attached g-zipped file contains the first set of patches required to build Python 3.4.2 from source in the environment specified in the origonal post. Will post the second/final set ASAP -- Added file:

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: It's not convinient to have patches in a tarball. Please at least open patches one by one, or better: open one issue per patch. You should group similar changes in a single patch: for example all changes related to wcstombs(). You should explain each change.

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Wouter Bolsterlee
Wouter Bolsterlee added the comment: Using IPython and CPython 3.4: d = dict.fromkeys(map(str, range(1000))) Current implementation: %timeit sorted(d.items(), key=lambda kv: kv[0]) 1000 loops, best of 3: 605 µs per loop %timeit sorted(d.items(), key=lambda kv: kv[0]) 1000 loops, best of

Re: Standard

2015-02-23 Thread jkn
On Sunday, 22 February 2015 14:11:54 UTC, Mark Lawrence wrote: On 19/02/2015 16:27, Phillip Fleming wrote: In my opinion, Python will not take off like C/C++ if there is no ANSI standard. Python has already taken off because it doesn't have a standard as such. Bjarne Stroustrup, in

[issue10128] multiprocessing.Pool throws exception with __main__.py

2015-02-23 Thread Marc Schlaich
Marc Schlaich added the comment: Please fix this. Scripts with multiprocessing bundled as wheels are broken with Python 2.7 on Windows: https://github.com/pypa/pip/issues/1891 -- nosy: +schlamar ___ Python tracker rep...@bugs.python.org

Re: Future of Pypy?

2015-02-23 Thread Dave Farrance
Laura Creighton l...@openend.se wrote: Good news -- it seems to be working fine with PyPy. https://travis-ci.org/hugovk/Pillow/builds for me, not extensively tested, it just seems to be working. I have several pypy's floating around here, each within its own virtualenv. If you aren't familiar

Re: Python shell: Arrow keys not working in PuTTY

2015-02-23 Thread Chris Angelico
On Tue, Feb 24, 2015 at 12:44 AM, David Aldrich david.aldr...@emea.nec.com wrote: I want to use the Python 3.4 interpreter interactively, via a PuTTY ssh session. Python is running on Centos 5. This stackoverflow thread:

Re: bufsize must be an integer in subprocess.Popen

2015-02-23 Thread INADA Naoki
Hi, the parameter list should be a list of strings, not several unpacked strings : command = [/root/Desktop/abc.py,64,abc] proc1 = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) The first argument is list of string only when `shell=False`

Re: Python Silent Install

2015-02-23 Thread Tim Golden
On 23/02/2015 13:57, Colin Atkinson wrote: I am deploying Python to hundreds of machines using SCCM 2012. I am using the below command to install: Msiexec /i “python.msi” TARGETDIR=”C:\Program Files\Python” ALLUSERS=1 /qn Even though I am using /qn, a command prompt still appears at the

Cython - was: Future of Pypy?

2015-02-23 Thread Stefan Behnel
Dave Farrance schrieb am 23.02.2015 um 15:13: Dave Cook wrote: On 2015-02-22, Dave Farrance wrote: It's still quicker to do a re-write in the more cumbersome C You should try Cython. I did try Cython when I was trying to figure out what to do about the slow speed. My initial attempt

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-23 Thread Cyd Haselton
Changes by Cyd Haselton chasel...@gmail.com: Removed file: http://bugs.python.org/file38209/python-3.4.2-androidpatches-1.tar.gz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23496 ___

Re: Question on asyncio

2015-02-23 Thread Jonas Wielicki
On 23.02.2015 14:27, Marko Rauhamaa wrote: pfranke...@gmail.com: The corresponding call is a call to the python smbus library. It includes several sleeps (even though they are only about 50ms). Therefore I think it is worthwhile to encapsulate it into a coroutine. Maybe. Then you'll

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-23 Thread Cyd Haselton
Cyd Haselton added the comment: Apologies for the tarball, but all patches within are related to this issue Removing tarball and will re-post individual, cleaned-up patches, grouped by issue. Ryan, can you re-do patch for pythonrun.c? If not. I'l. work it in. --

RE: Python shell: Arrow keys not working in PuTTY

2015-02-23 Thread David Aldrich
Thanks for your replies, I will give readline a try. PS: and you mention being on CentOS but running apt-get. I believe CentOS and other Red-Hat based distros use yum instead of apt-get Yes, I think I need to use: yum install readline-devel Best regards David --

Re: Concatenate list values

2015-02-23 Thread Peter Otten
loial wrote: Is there a quick way to concatenate all the values in a list into a string, except the first value? I want this to work with variable length lists. All values in list will be strings. Any help appreciated strings ['All', 'values', 'in', 'list', 'will', 'be', 'strings']

[issue23314] Disabling CRT asserts in debug build

2015-02-23 Thread Steve Dower
Steve Dower added the comment: You're right, SuppressCrashReport also makes more sense here, though it still needs to be used explicitly in every new process. New patch attached. -- Added file: http://bugs.python.org/file38210/23314_tf_inhert_check_2.diff

Re: Concatenate list values

2015-02-23 Thread John Gordon
In 12821378-62af-4954-8b61-aa0738c5f...@googlegroups.com loial jldunn2...@gmail.com writes: Is there a quick way to concatenate all the values in a list into a string, except the first value? I want this to work with variable length lists. All values in list will be strings. Any help

Re: Concatenate list values

2015-02-23 Thread Tim Chase
On 2015-02-23 07:58, loial wrote: Is there a quick way to concatenate all the values in a list into a string, except the first value? I want this to work with variable length lists. All values in list will be strings. Using .join(my_list[1:]) should work. If it is an arbitrary

Well, that was a head scratcher...

2015-02-23 Thread Skip Montanaro
I've been reworking some of the code in the platform I use at work. I'm the sole developer/maintainer/hard-core user left, so I can pretty much do what I want with it (convert modules to Cython, delete no longer used modules, etc). The platform uses PyGtk, so we use signals and other features of

Re: Concatenate list values

2015-02-23 Thread alister
On Mon, 23 Feb 2015 07:58:39 -0800, loial wrote: Is there a quick way to concatenate all the values in a list into a string, except the first value? I want this to work with variable length lists. All values in list will be strings. Any help appreciated ''.join(mylist[1:]) all

Re: Python Silent Install

2015-02-23 Thread Tim Golden
On 23/02/2015 15:29, Tim Golden wrote: On 23/02/2015 13:57, Colin Atkinson wrote: I am deploying Python to hundreds of machines using SCCM 2012. I am using the below command to install: Msiexec /i “python.msi” TARGETDIR=”C:\Program Files\Python” ALLUSERS=1 /qn Even though I am using /qn,

Concatenate list values

2015-02-23 Thread loial
Is there a quick way to concatenate all the values in a list into a string, except the first value? I want this to work with variable length lists. All values in list will be strings. Any help appreciated -- https://mail.python.org/mailman/listinfo/python-list

Re: Future of Pypy?

2015-02-23 Thread Laura Creighton
Arrgh! I forgot to warn you that you need a very recent version of virtualenv to work with PyPy. I am very sorry about that. Glad to see that things are working now. Laura -- https://mail.python.org/mailman/listinfo/python-list

Re: Concatenate list values

2015-02-23 Thread Andrew Berg
On 2015.02.23 09:58, loial wrote: Is there a quick way to concatenate all the values in a list into a string, except the first value? I want this to work with variable length lists. All values in list will be strings. Any help appreciated The tutorial covers strings and lists:

Re: Unrecognized backslash escapes in string literals

2015-02-23 Thread Serhiy Storchaka
On 23.02.15 04:55, Chris Angelico wrote: I agree, the fault is primarily with Windows. But I've seen similar issues when people use /-\| for box drawing and framing and such; Windows paths are by far the most common case of this, but not the sole. There is also issues with regular expressions.

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2015-02-23 Thread Demian Brecht
Demian Brecht added the comment: Pending review of the exceptions from another core dev, the patch looks good to me. Thanks for sticking with it :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3566

[issue15955] gzip, bz2, lzma: add option to limit output size

2015-02-23 Thread Martin Panter
Martin Panter added the comment: Rev3 still seems to have the same weird indentation as rev2. Are you using some sort of diff --ignore-all-space option by accident? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15955

Re: list storing variables

2015-02-23 Thread Marko Rauhamaa
Peter Otten __pete...@web.de: The OP explicitly mentions the operator. There's no python analog to that and the behavior shown below: $ cat pointers.c #include stdio.h int main() { int a = 2, b = 5; int * Li[2] = { a, b }; printf(%d %d\n, *Li[0], *Li[1]); a = 3; printf(%d

Re: Best practice: Sharing object between different objects

2015-02-23 Thread Rob Gaddi
On Sat, 21 Feb 2015 04:15:50 -0800, pfranken85 wrote: Hello! I have a best-practice question: Imagine I have several hardware devices that I work with on the same I2C bus and I am using the python smbus module for that purpose. The individual devices are sensors, ADC, DAC components. As I

Re: list storing variables

2015-02-23 Thread Chris Angelico
On Tue, Feb 24, 2015 at 6:06 AM, Marko Rauhamaa ma...@pacujo.net wrote: What I'm saying is that there's nothing special about Python's object model or variables. Guido could decide tomorrow to add a C-esque operator to Python without breaking a single existing Python program. The Python

Re: Best practice: Sharing object between different objects

2015-02-23 Thread Ian Kelly
On Mon, Feb 23, 2015 at 1:02 PM, sohcahto...@gmail.com wrote: What's REALLY interesting is that this happens: import myModule myModule.myInt 1 myModule.myInt = 2 myModule.myInt 2 del myModule import myModule myModule.myInt 2 I would REALLY expect that deleting the module object and

Re: list storing variables

2015-02-23 Thread Marko Rauhamaa
Ian Kelly ian.g.ke...@gmail.com: Obviously one can use any Turing-complete language to emulate features of any other Turing-complete language, but I think the point is that there is no syntactic support for it. While my contribution was made tongue-in-cheek, there's a grain of truth in every

ANN: Bokeh 0.8.1 released

2015-02-23 Thread Damian Avila
Hi all, We are excited to announce the release of version 0.8.1 of Bokeh, an interactive web plotting library for Python... and other languages! This minor release includes many bug fixes and docs improvements: * Fixed HoverTool * Fixed Abstract Rendering implementation and docs * Fixed Charts

[issue23504] Add __all__ into types

2015-02-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Currently pydoc outputs only two classes and two functions in the types module. Proposed patch add __all__ into the types module, so that pydoc will output builtin class deliberately added into the types module. -- components: Library (Lib) files:

Re: new.py and having '.' in PYTHONPATH

2015-02-23 Thread Ian Kelly
On Mon, Feb 23, 2015 at 3:14 PM, Ethan Furman et...@stoneleaf.us wrote: On 02/23/2015 01:00 PM, Tobiah wrote: Anyway, it raises the question as to whether having '.' in the PYTHONPATH is at all a sane thing to do. The current directory is added to sys.path /only/ for the interactive

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry, here is it. -- keywords: +patch Added file: http://bugs.python.org/file38208/random_uint32.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Some microbenchmark results on 32-bit Linux: $ ./python -m timeit -s from random import getrandbits -- getrandbits(64) Before: 100 loops, best of 3: 1.41 usec per loop After: 100 loops, best of 3: 1.34 usec per loop $ ./python -m timeit -s from

Re: Future of Pypy?

2015-02-23 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: Yes, but my point is that if some other way solves the problem, then you should *use that other technique* rather than complain about the GIL. The GIL is not a bottleneck if you can bypass it. I can sympathize with somebody who says I

Re: Unrecognized backslash escapes in string literals

2015-02-23 Thread Peter Otten
Ben Finney wrote: Chris Angelico ros...@gmail.com writes: That said, though, there's probably a lot of code out there that depends on backslashes being non-special, so it's quite probably something that can't be changed. But it'd be nice to be able to turn on a warning for it. If you're

Re: Future of Pypy?

2015-02-23 Thread Chris Angelico
On Mon, Feb 23, 2015 at 6:41 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: - and you must be using libraries and tools which prevent you moving to Jython or IronPython or some other alternative. I don't get this at all. Why should I not want Python to have the same

[issue23484] SemLock acquire() keyword arg 'blocking' is invalid

2015-02-23 Thread Teodor Dima
Teodor Dima added the comment: Of course, there's code in the wild that expects and uses the parameter named 'block' so simply changing this keyword will result in breaking others' code. That is, indeed, the case with my company's code as well. --

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: The patch looks good to me. For utint32_t, see my old issue #17884: Try to reuse stdint.h types like int32_t. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488

Re: Question on asyncio

2015-02-23 Thread pfranken85
Hello Marko! Am Sonntag, 22. Februar 2015 22:21:55 UTC+1 schrieb Marko Rauhamaa: In asyncio, you typically ignore the value returned by yield. While generators use yield to communicate results to the calling program, coroutines use yield only as a trick to implement cooperative multitasking

Re: Design thought for callbacks

2015-02-23 Thread Gregory Ewing
Cem Karan wrote: I tend to structure my code as a tree or DAG of objects. The owner refers to the owned object, but the owned object has no reference to its owner. With callbacks, you get cycles, where the owned owns the owner. This is why I suggested registering a listener object plus a

Re: Future of Pypy?

2015-02-23 Thread Steven D'Aprano
Ethan Furman wrote: On 02/22/2015 11:41 PM, Steven D'Aprano wrote: If you want *CPython* to work without a GIL, well, are you volunteering to do the work? It is a massive job, and the core devs aren't terribly interested. Probably because they understand that the GIL is not often an

Re: Future of Pypy?

2015-02-23 Thread Paul Rubin
Chris Angelico ros...@gmail.com writes: So, you would have to pass code to the other process, probably. What about this: y = 4 other_thread_queue.put(lambda x: x*y) the y in the lambda is a free variable that's a reference to the surrounding mutable context, so that's at best dubious. You

[issue23505] Urlparse insufficient validation leads to open redirect

2015-02-23 Thread Yassine ABOUKIR
New submission from Yassine ABOUKIR: The module urlparse lacks proper validation of the input leading to open redirect vulnerability. The issue is that URLs do not survive the round-trip through `urlunparse(urlparse(url))`. Python sees `/foo.com` as a URL with no hostname or scheme and

Re: Python shell: Arrow keys not working in PuTTY

2015-02-23 Thread Steven D'Aprano
Laura Creighton wrote: DO NOT REBUILD PYTHON ON CENTOS! It can break the whole package management system which depends on having a particular version of python installed. If you are running Centos you need to use virtualenv to be safe. Laura Almost right! You can install Python from

Re: list storing variables

2015-02-23 Thread Steven D'Aprano
Ben Finney wrote: In C language, there is A for address of A There is no “address of a value” concept in Python. You access a value by some reference, either a name or an item in a collection. When a reference changes to reference some different value, other references are not affected.

Re: Are threads bad? - was: Future of Pypy?

2015-02-23 Thread Chris Angelico
On Tue, Feb 24, 2015 at 4:27 PM, Paul Rubin no.email@nospam.invalid wrote: Sure, your code might not be making any mutations (that you know of), but malloc definitely is [1], and that's just the tip of the iceberg. Other things like buffers for stdin and stdout, DNS resolution etc. all have

Re: Future of Pypy?

2015-02-23 Thread Steven D'Aprano
Paul Rubin wrote: With threads in a single process, this isn't a problem. They all access the same memory space, so they can all share state. As soon as you go to separate processes, these considerations become serious. Right, that's a limitation of processes compared to threads. I think

Re: Future of Pypy?

2015-02-23 Thread Steven D'Aprano
Chris Angelico wrote: On Mon, Feb 23, 2015 at 6:41 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: - and you must be using libraries and tools which prevent you moving to Jython or IronPython or some other alternative. I don't get this at all. Why should I not want Python

Re: Are threads bad? - was: Future of Pypy?

2015-02-23 Thread Paul Rubin
Ryan Stuart ryan.stuart...@gmail.com writes: I'm not sure what else to say really. It's just a fact of life that Threads by definition run in the same memory space and hence always have the possibility of nasty unforeseen problems. They are unforeseen because it is extremely difficult (maybe

Re: Future of Pypy?

2015-02-23 Thread Chris Angelico
On Tue, Feb 24, 2015 at 5:56 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Most people are not using the bleeding edge version of Python, and even those who do, aren't usually using it in production. There are still plenty of people using Python 2.3 in production, and even a

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2015-02-23 Thread Martin Panter
Martin Panter added the comment: I am posting a new version of Daniel’s patch as issue4806-star-TypeError.v2.patch: * Merged with recent “default” (3.5) branch * Dropped the documentation fix, since revision a8aa918041c2 already fixed that in an identical fashion * Changed to a “look before

Re: Python shell: Arrow keys not working in PuTTY

2015-02-23 Thread Steven D'Aprano
Ned Deily wrote: In article 54ebdcfa$0$11100$c3e8...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Almost right! You can install Python from source. Unzip the source tar ball, cd into the source directory, and run: ./configure make BUT do *not* run