numpy array operation

2013-01-29 Thread C. Ng
Is there a numpy operation that does the following to the array? 1 2 == 4 3 3 4 2 1 Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy array operation

2013-01-29 Thread Peter Otten
C. Ng wrote: Is there a numpy operation that does the following to the array? 1 2 == 4 3 3 4 2 1 How about a array([[1, 2], [3, 4]]) a[::-1].transpose()[::-1].transpose() array([[4, 3], [2, 1]]) Or did you mean a.reshape((4,))[::-1].reshape((2,2)) array([[4, 3],

Re: Further evidence that Python may be the best language forever

2013-01-29 Thread Michael Poeltl
hi Stefan, * Stefan Behnel stefan...@behnel.de [2013-01-29 08:00]: Michael Torrie, 29.01.2013 02:15: On 01/28/2013 03:46 PM, Malcolm McCrimmon wrote: My company recently hosted a programming competition for schools across the country. One team made it to the finals using the Python

Re: numpy array operation

2013-01-29 Thread Tim Williams
On Tuesday, January 29, 2013 3:41:54 AM UTC-5, C. Ng wrote: Is there a numpy operation that does the following to the array? 1 2 == 4 3 3 4 2 1 Thanks in advance. import numpy as np a=np.array([[1,2],[3,4]]) a array([[1, 2], [3, 4]]) np.fliplr(np.flipud(a))

[os.path.join(r'E:\Python', name) for name in []] returns []

2013-01-29 Thread iMath
why [os.path.join(r'E:\Python', name) for name in []] returns [] ? please explain it in detail ! -- http://mail.python.org/mailman/listinfo/python-list

Re: [os.path.join(r'E:\Python', name) for name in []] returns []

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 12:21 AM, iMath redstone-c...@163.com wrote: why [os.path.join(r'E:\Python', name) for name in []] returns [] ? please explain it in detail ! That's a list comprehension. If you're familiar with functional programming, it's like a map operation. Since the input list

Re: [os.path.join(r'E:\Python', name) for name in []] returns []

2013-01-29 Thread Jean-Michel Pichavant
- Original Message - why [os.path.join(r'E:\Python', name) for name in []] returns [] ? please explain it in detail ! -- http://mail.python.org/mailman/listinfo/python-list You're mapping an empty list. for name in [] JM -- IMPORTANT NOTICE: The contents of this email and any

Re: [os.path.join(r'E:\Python', name) for name in []] returns []

2013-01-29 Thread Steven D'Aprano
iMath wrote: why [os.path.join(r'E:\Python', name) for name in []] returns [] ? Because you are iterating over an empty list, []. That list comprehension is the equivalent of: result = [] for name in []: result.append( os.path.join(r'E:\Python', name) ) Since you iterate over an empty

Re: [os.path.join(r'E:\Python', name) for name in []] returns []

2013-01-29 Thread Dave Angel
On 01/29/2013 08:21 AM, iMath wrote: why [os.path.join(r'E:\Python', name) for name in []] returns [] ? please explain it in detail ! [ os.path.join(r'E:\Python', name) for name in [] ] It'd be nice if you would explain what part of it bothers you. Do you know what a list comprehension is?

Re: environment fingerprint

2013-01-29 Thread Andrew Berg
On 2013.01.29 07:18, Jabba Laci wrote: Hi, I have a script that I want to run in different environments: on Linux, on Windows, on my home machine, at my workplace, in virtualbox, etc. In each environment I want to use different configurations. For instance the temp. directory on Linux would

Re: Mixxx DJ app and Python

2013-01-29 Thread David Hutto
On Mon, Jan 28, 2013 at 10:10 AM, mikp...@gmail.com wrote: Hi guys, I am thinking of driving a DJ application from Python. I am running Linux and I found the Mixxx app. Does anyone know if there are python bindings, or if this is possible at all? or does anyone have experience with another

Re: Mixxx DJ app and Python

2013-01-29 Thread David Hutto
On Tue, Jan 29, 2013 at 11:06 AM, David Hutto dwightdhu...@gmail.com wrote: On Mon, Jan 28, 2013 at 10:10 AM, mikp...@gmail.com wrote: Hi guys, I am thinking of driving a DJ application from Python. I am running Linux and I found the Mixxx app. Does anyone know if there are python

Re: Mixxx DJ app and Python

2013-01-29 Thread David Hutto
Does anyone know if there are python bindings, or if this is possible at all? or does anyone have experience with another software that does the same DJ thing? Hydrogen, and audacity work perfectly together. What I was about to do is take the mic, get the soundtrack/beat to the song

Re: Mixxx DJ app and Python

2013-01-29 Thread David Hutto
On Tue, Jan 29, 2013 at 11:16 AM, David Hutto dwightdhu...@gmail.com wrote: Does anyone know if there are python bindings, or if this is possible at all? or does anyone have experience with another software that does the same DJ thing? Hydrogen, and audacity work perfectly together.

Re: I have issues installing pycrypto (and thus fabric) with pip

2013-01-29 Thread Nicholas Kolatsis
Thanks. I've gotten everything working now. For anyone else who comes along, 'sudo apt-get install python-dev' did the job. Note that Fabric is useful for much, MUCH more than this. I look forward to finding out :) Off-topic: why is your virtualenv/project name so weird? Noted. It's

Re: Mixxx DJ app and Python

2013-01-29 Thread mikprog
On Tuesday, January 29, 2013 4:13:09 PM UTC, David Hutto wrote: [..] or does anyone have experience with another software that does the same DJ thing? Hydrogen, and audacity work perfectly together. Hi David, thanks for your reply. I am not sure though that this is going to help

Re: Mixxx DJ app and Python

2013-01-29 Thread David Hutto
On Tue, Jan 29, 2013 at 11:18 AM, mikp...@gmail.com wrote: On Tuesday, January 29, 2013 4:13:09 PM UTC, David Hutto wrote: [..] or does anyone have experience with another software that does the same DJ thing? Hydrogen, and audacity work perfectly together. Hi David, thanks for

Re: Mixxx DJ app and Python

2013-01-29 Thread Ben
This may not be too helpful, but I built a TCP server into the Mixxx application (in C++). I placed the server in ratecontroller (as I needed to vary the rate remotely). I then could send and receive TCP packets with a single board computer that ran a python client. It wasn't too bad. If you

Re: Mixxx DJ app and Python

2013-01-29 Thread David Hutto
On Tue, Jan 29, 2013 at 11:45 AM, Ben bungi...@gmail.com wrote: This may not be too helpful, but I built a TCP server into the Mixxx application (in C++). I placed the server in ratecontroller (as I needed to vary the rate remotely). I then could send and receive TCP packets with a single

Split string data have ,

2013-01-29 Thread moonhkt
Hi All Python 2.6.2 on AIX 5.3 How to using split o y = 'abc.p,zip.p,a,b' print y abc.p,zip.p,a,b k= y.split(,) print k[0] abc.p Need Result, First element is abc.p,zip.p -- http://mail.python.org/mailman/listinfo/python-list

Re: Mixxx DJ app and Python

2013-01-29 Thread mikprog
On Tuesday, January 29, 2013 4:45:18 PM UTC, Ben wrote: This may not be too helpful, but I built a TCP server into the Mixxx application (in C++). I placed the server in ratecontroller (as I needed to vary the rate remotely). I then could send and receive TCP packets with a single board

RE: Split string first data have ,

2013-01-29 Thread Nick Cash
y = 'abc.p,zip.p,a,b' print y abc.p,zip.p,a,b x = what is your question?? print x I'm guessing that you want to split on ,, but want the quoted section to be a single token? Have you looked at the CSV module (http://docs.python.org/3/library/csv.html)? If my guess is wrong, or you're

Re: Mixxx DJ app and Python

2013-01-29 Thread mikprog
On Tuesday, January 29, 2013 4:42:07 PM UTC, David Hutto wrote: [..] Well you can just use their(Mixx's) source code that they used from another wav form manipulation library(more than likely), after the trigger from the bluetooth. If you're talking voice, and music to sync, then

Re: Split string data have ,

2013-01-29 Thread Tim Chase
On Tue, 29 moonhkt moon...@gmail.com wrote: y = 'abc.p,zip.p,a,b' print y abc.p,zip.p,a,b k= y.split(,) print k[0] abc.p Need Result, First element is abc.p,zip.p The csv module should handle this nicely: import csv y = 'abc.p,zip.p,a,b' print y abc.p,zip.p,a,b

Re: Mixxx DJ app and Python

2013-01-29 Thread David Hutto
Thanks David. It seems that the code is in C++ so I should write Python wrappers myself, Or ctypes. which could be interesting, but given the time frame I have is just not possible, Pity :-( However I was not going to transmit sounds, but just commands to mix the sounds that are already in

Re: Split string data have ,

2013-01-29 Thread Chris Rebert
On Jan 29, 2013 9:05 AM, moonhkt moon...@gmail.com wrote: Hi All Python 2.6.2 on AIX 5.3 How to using split o y = 'abc.p,zip.p,a,b' print y abc.p,zip.p,a,b k= y.split(,) print k[0] abc.p Need Result, First element is abc.p,zip.p Try the csv module or the shlex module. --

Re: ] returns []

2013-01-29 Thread rusi
On Jan 29, 6:22 pm, iMath redstone-c...@163.com wrote: 在 2013年1月29日星期二UTC+8下午9时21分16秒,iMath写道: why [os.path.join(r'E:\Python', name) for name in []] returns [] ? please explain it in detail ! [os.path.join(r'E:\Python', name) for name in []] [] [Small algebra lesson] In algebra there

Re: Further evidence that Python may be the best language forever

2013-01-29 Thread Malcolm McCrimmon
Sure! I don't think we've publicly posted the teams' implementations, but the original client code is all up here--http://www.windward.net/codewar/2013_01/windwardopolis.php The issue with the original link may be if you're running Firefox--it's a Vimeo video, and I know they have some

Re: The best, friendly and easy use Python Editor.

2013-01-29 Thread rusi
On Jan 25, 10:35 pm, Leonard, Arah arah.leon...@bruker-axs.com wrote: It's just a text file after all. True indeed, let's not worry about trivial issues like indentation, mixing tabs and spaces or whatever.  Notepad anybody? :) Hey, I didn't say Notepad was the *best* tool for the job,

Galry, a high-performance interactive visualization package in Python

2013-01-29 Thread Cyrille Rossant
Dear all, I'm making available today a first pre-release of Galry http://rossant.github.com/galry/, a BSD-licensed high performance interactive visualization toolbox in Python based on OpenGL. Its matplotlib-like high-level interface allows to interactively visualize plots with tens of millions

Re: numpy array operation

2013-01-29 Thread Alok Singhal
On Tue, 29 Jan 2013 00:41:54 -0800, C. Ng wrote: Is there a numpy operation that does the following to the array? 1 2 == 4 3 3 4 2 1 Thanks in advance. How about: import numpy as np a = np.array([[1,2],[3,4]]) a array([[1, 2], [3, 4]]) a[::-1, ::-1] array([[4, 3],

Re: Galry, a high-performance interactive visualization package in Python

2013-01-29 Thread Terry Reedy
On 1/29/2013 1:23 PM, Cyrille Rossant wrote: The goal of this beta pre-release is to ensure that Galry can work on the widest possible range of systems and graphics cards (OpenGL v2+ is required). http://rossant.github.com/galry/ From that site: Mandatory dependencies include Python 2.7,

Re: numpy array operation

2013-01-29 Thread Terry Reedy
On 1/29/2013 1:49 PM, Alok Singhal wrote: On Tue, 29 Jan 2013 00:41:54 -0800, C. Ng wrote: Is there a numpy operation that does the following to the array? 1 2 == 4 3 3 4 2 1 Thanks in advance. How about: import numpy as np a = np.array([[1,2],[3,4]]) a array([[1, 2], [3, 4]])

Quepy, transform questions in natural language into queries in a DB language using python

2013-01-29 Thread Elias Andrawos
We are sharing an open source framework that we made here at Machinalis: Quepy https://github.com/machinalis/quepy Quepy is a Python framework to transform questions in natural language into queries in a database language. It can be easily adapted to different types of questions in natural

GeoBases: data services and visualization

2013-01-29 Thread Alex
This new project provides tools to play with geographical data. It also works with non-geographical data, except for map visualizations :). There are embedded data sources in the project, but you can easily play with your own data in addition to the available ones. Files containing data about

Ways to apply while learning....

2013-01-29 Thread agamal100
Hello, I am learning programming as a spare time hobby and learning python through codecademy. Today I have downloaded and installed aptana, and found out that although I have been progressing for some time now but I do not remember how to code and I have to look everything up. I want to know

Re: Ways to apply while learning....

2013-01-29 Thread David Hutto
On Tue, Jan 29, 2013 at 5:57 PM, agamal...@gmail.com wrote: Hello, I am learning programming as a spare time hobby and learning python through codecademy. Today I have downloaded and installed aptana, and found out that although I have been progressing for some time now but I do not

Re: environment fingerprint

2013-01-29 Thread Jabba Laci
Hi, Thanks for the tip. I came up with the solution below. For my purposes the short fingerprint is enough. Laszlo == import platform as p import uuid import hashlib def get_fingerprint(md5=False): Fingerprint of the current operating system/platform. If md5 is True, a digital

Re: environment fingerprint

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 10:33 AM, Jabba Laci jabba.l...@gmail.com wrote: if md5: md5 = hashlib.md5() md5.update(text) return md5.hexdigest() Simpler: if md5: return hashlib.md5(text).hexdigest() ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: ] returns []

2013-01-29 Thread marty . musatov
MUSATOV -- http://mail.python.org/mailman/listinfo/python-list

Re: [os.path.join(r'E:\Python', name) for name in []] returns []

2013-01-29 Thread iMath
在 2013年1月29日星期二UTC+8下午9时33分26秒,Steven D'Aprano写道: iMath wrote: why [os.path.join(r'E:\Python', name) for name in []] returns [] ? Because you are iterating over an empty list, []. That list comprehension is the equivalent of: result = [] for name in []: result.append(

Re: [os.path.join(r'E:\Python', name) for name in []] returns []

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 12:56 PM, iMath redstone-c...@163.com wrote: 在 2013年1月29日星期二UTC+8下午9时33分26秒,Steven D'Aprano写道: iMath wrote: why [os.path.join(r'E:\Python', name) for name in []] returns [] ? Because you are iterating over an empty list, []. That list comprehension is the equivalent

Re: Split string data have ,

2013-01-29 Thread moonhkt
On Jan 30, 1:08 am, Chris Rebert c...@rebertia.com wrote: On Jan 29, 2013 9:05 AM, moonhkt moon...@gmail.com wrote: Hi All Python 2.6.2 on AIX 5.3 How to using split o y = 'abc.p,zip.p,a,b' print y abc.p,zip.p,a,b k= y.split(,) print k[0] abc.p Need Result,

Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Daniel W. Rouse Jr.
Hi all, I have recently started learning Python (2.7.3) but need a better explanation of how to use tuples and dictionaries. I am currently using Learning Python by Mark Lutz and David Ascher, published by O'Reilly (ISBN 1-56592-464-9)--but I find the explanations insufficient and the

Re: simple tkinter battery monitor

2013-01-29 Thread leonix . power
Thank you very much! fixed with w.after Here is the code, works under Linux for those who have acpi. My output of acpi -V is the following, the code is parsing the first line of the output. Any improvements are appreciated. $ acpi -V Battery 0: Discharging, 12%, 00:10:59 remaining Battery 0:

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 1:55 PM, Daniel W. Rouse Jr. dwrousejr@nethere.comnospam wrote: I am currently using Learning Python by Mark Lutz and David Ascher, published by O'Reilly (ISBN 1-56592-464-9)--but I find the explanations insufficient and the number of examples to be sparse. I do

struggling with these problems

2013-01-29 Thread su29090
1.Given that worst_offenders has been defined as a list with at least 6 elements, write a statement that defines lesser_offenders to be a new list that contains all the elements from index 5 of worst_offenders and beyond. Do not modify worst_offenders . I tried this but it didn't work:

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Daniel W. Rouse Jr.
Chris Angelico ros...@gmail.com wrote in message news:mailman.1197.1359515470.2939.python-l...@python.org... On Wed, Jan 30, 2013 at 1:55 PM, Daniel W. Rouse Jr. dwrousejr@nethere.comnospam wrote: I am currently using Learning Python by Mark Lutz and David Ascher, published by O'Reilly (ISBN

Re: Mixxx DJ app and Python

2013-01-29 Thread alex23
On Jan 29, 1:10 am, mikp...@gmail.com wrote: I am thinking of driving a DJ application from Python. I am running Linux and I found the Mixxx app. Does anyone know if there are python bindings, or if this is possible at all? or does anyone have experience with another software that does the

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 2:42 PM, Daniel W. Rouse Jr. dwrousejr@nethere.comnospam wrote: Chris Angelico ros...@gmail.com wrote in message news:mailman.1197.1359515470.2939.python-l...@python.org... Have you checked out the online documentation at http://docs.python.org/ ? That might have what

Re: struggling with these problems

2013-01-29 Thread MRAB
On 2013-01-30 03:26, su29090 wrote: 1.Given that worst_offenders has been defined as a list with at least 6 elements, write a statement that defines lesser_offenders to be a new list that contains all the elements from index 5 of worst_offenders and beyond. Do not modify worst_offenders .

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Mitya Sirenef
On 01/29/2013 09:55 PM, Daniel W. Rouse Jr. wrote: Hi all, I have recently started learning Python (2.7.3) but need a better explanation of how to use tuples and dictionaries. I am currently using Learning Python by Mark Lutz and David Ascher, published by O'Reilly (ISBN

Re: struggling with these problems

2013-01-29 Thread Steven D'Aprano
On Wed, 30 Jan 2013 03:59:32 +, MRAB wrote: Python uses half-open ranges (and counts from 0), which means that the start index is included and the end index is excluded. Therefore, worst_offenders[5:6] means the slice from index 5 up to, but excluding, index 6; in other words, an empty

security quirk

2013-01-29 Thread RichD
I read Wall Street Journal, and occasionally check articles on their Web site. It's mostly free, with some items available to subscribers only. It seems random, which ones they block, about 20%. Anywho, sometimes I use their search utility, the usual author or title search, and it blocks, then

Signal versus noise (was: security quirk)

2013-01-29 Thread Ben Finney
RichD r_delaney2...@yahoo.com writes: Anywho, sometimes I use their search utility, the usual author or title search, and it blocks, then I look it up on Google, and link from there, and it loads! ok, Web gurus, what's going on? That evidently has nothing in particular to do with the topic

Re: security quirk

2013-01-29 Thread Rodrick Brown
On Tue, Jan 29, 2013 at 11:55 PM, RichD r_delaney2...@yahoo.com wrote: I read Wall Street Journal, and occasionally check articles on their Web site. It's mostly free, with some items available to subscribers only. It seems random, which ones they block, about 20%. Anywho, sometimes I use

Re: security quirk

2013-01-29 Thread Chris Rebert
On Tue, Jan 29, 2013 at 8:55 PM, RichD r_delaney2...@yahoo.com wrote: I read Wall Street Journal, and occasionally check articles on their Web site. It's mostly free, with some items available to subscribers only. It seems random, which ones they block, about 20%. Anywho, sometimes I use

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread John Gordon
In hkcdnwgroqkwfpxmnz2dnuvz_qadn...@o1.com Daniel W. Rouse Jr. dwrousejr@nethere.comNOSPAM writes: I have recently started learning Python (2.7.3) but need a better explanation of how to use tuples and dictionaries. A tuple is a linear sequence of items, accessed via subscripts that start at

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Daniel W. Rouse Jr.
John Gordon gor...@panix.com wrote in message news:keaa9v$1ru$1...@reader1.panix.com... In hkcdnwgroqkwfpxmnz2dnuvz_qadn...@o1.com Daniel W. Rouse Jr. dwrousejr@nethere.comNOSPAM writes: I have recently started learning Python (2.7.3) but need a better explanation of how to use tuples and

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 5:14 PM, Daniel W. Rouse Jr. dwrousejr@nethere.comnospam wrote: To me, this looks like an array. Is tuple just the Python name for an array? Not quite. An array is closer to a Python list - a tuple can be thought of as a frozen list, if you like. Lists can be added to,

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Steven D'Aprano
On Tue, 29 Jan 2013 22:14:42 -0800, Daniel W. Rouse Jr. wrote: John Gordon gor...@panix.com wrote in message news:keaa9v$1ru$1...@reader1.panix.com... A tuple is a linear sequence of items, accessed via subscripts that start at zero. Tuples are read-only; items cannot be added, removed,

[issue14018] OS X installer does not detect bad symlinks created by Xcode 3.2.6

2013-01-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset c2830debb15a by Ned Deily in branch '2.7': Issue #14018: Backport OS X installer updates from 3.3. http://hg.python.org/cpython/rev/c2830debb15a New changeset d54330c8daaa by Ned Deily in branch '3.2': Issue #14018: Backport OS X installer updates

[issue17028] launcher does not read shebang line when arguments are given

2013-01-29 Thread Thomas Heller
Thomas Heller added the comment: Hope it is ok to assign this to you, vinay. -- assignee: - vinay.sajip nosy: +vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17028 ___

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset a242ac99161f by Serhiy Storchaka in branch '2.7': Issue #16979: Fix error handling bugs in the unicode-escape-decode decoder. http://hg.python.org/cpython/rev/a242ac99161f New changeset 084bec5443d6 by Serhiy Storchaka in branch '3.2': Issue

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Until subtests added an explicit call looks better to me. And when subtests will be added we will just add subtest inside the helper function. -- ___ Python tracker rep...@bugs.python.org

[issue16980] SystemError in codecs.unicode_escape_decode()

2013-01-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16980

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16979

[issue16975] Broken error handling in codecs.escape_decode()

2013-01-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16975

[issue16971] Refleaks in charmap decoder

2013-01-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 625c397a7283 by Serhiy Storchaka in branch '3.3': Issue #16971: Fix a refleak in the charmap decoder. http://hg.python.org/cpython/rev/625c397a7283 New changeset 02c4ecc87f74 by Serhiy Storchaka in branch 'default': Issue #16971: Fix a refleak in

[issue16971] Refleaks in charmap decoder

2013-01-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16971

[issue16997] subtests

2013-01-29 Thread Nick Coghlan
Nick Coghlan added the comment: I like the idea of the subTest API being something like: def subTest(self, _id, *, **params): However, I'd still factor that in to the reported test ID, not into the exception message. -- ___ Python tracker

[issue17069] HTTP result code in urllib2.urlopen() file object undocumented

2013-01-29 Thread Tuure Laurinolli
New submission from Tuure Laurinolli: As per documentation at http://docs.python.org/2/library/urllib2.html the file-like object returned by urllib2.urlopen() should have methods geturl() and info(). It actually also has getcode(), which appears to do the same as getcode() on urllib.urlopen()

[issue12707] Deprecate addinfourl getters

2013-01-29 Thread Petri Lehtinen
Petri Lehtinen added the comment: +1 for the documentation changes, which should be applied to 2.7 as well. The deprecation is the only thing to go to 3.4 only, if it's done at all. -- nosy: +petri.lehtinen versions: +Python 2.7, Python 3.3 ___

[issue12707] Deprecate addinfourl getters

2013-01-29 Thread Petri Lehtinen
Petri Lehtinen added the comment: Also note that getcode() is already documented in urllib (not urllib2) documentation: http://docs.python.org/2/library/urllib.html#urllib.urlopen -- ___ Python tracker rep...@bugs.python.org

[issue17036] Implementation of the PEP 433: Easier suppression of file descriptor inheritance

2013-01-29 Thread STINNER Victor
STINNER Victor added the comment: New patch: - sys.setdefaultcloexec() takes again an argument, so sys.setdefaultcloexec(False) is allowed - add cloexec parameter to select.devpoll(), select.kqueue() and select.epoll() - when a function accepts a file name and a file descriptor: the cloexec

[issue17036] Implementation of the PEP 433: Easier suppression of file descriptor inheritance

2013-01-29 Thread STINNER Victor
STINNER Victor added the comment: My TODO list is almost empty: the implementation is done. I just see possible enhancement on Windows: socket.socket() and os.dup() can use an atomic flag to set close-on-exec if native functions are used (WSASocket, DuplicateHandle) instead of the POSIX API.

[issue17070] Use the new cloexec to improve security and avoid bugs

2013-01-29 Thread STINNER Victor
New submission from STINNER Victor: Attached patches use the new cloexec parameter added by the PEP 433 (see issue #17036). cloexec_fs_walk.patch: [security] don't leak a file descriptors of directories to a child processes cloexec_listening_socket.patch: [security] don't leak a listening

[issue17070] Use the new cloexec to improve security and avoid bugs

2013-01-29 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Added file: http://bugs.python.org/file28892/cloexec_subprocess.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17070 ___

[issue17071] Signature.bind() fails with a keyword argument named self

2013-01-29 Thread Antoine Pitrou
New submission from Antoine Pitrou: def f(a, self): pass ... sig = inspect.signature(f) sig.bind(1, 2) inspect.BoundArguments object at 0x7f607ead1e28 sig.bind(a=1, self=2) Traceback (most recent call last): File stdin, line 1, in module TypeError: bind() got multiple values for argument

[issue17036] Implementation of the PEP 433: Easier suppression of file descriptor inheritance

2013-01-29 Thread STINNER Victor
STINNER Victor added the comment: revert enhancements using cloexec=True to simplify the patch: will be done in another issue I just created the issue #17070 to track this task. -- ___ Python tracker rep...@bugs.python.org

[issue17070] Use the new cloexec to improve security and avoid bugs

2013-01-29 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Added file: http://bugs.python.org/file28889/cloexec_listening_socket.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17070 ___

[issue17070] Use the new cloexec to improve security and avoid bugs

2013-01-29 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Added file: http://bugs.python.org/file28890/cloexec_log_file.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17070 ___

[issue17070] Use the new cloexec to improve security and avoid bugs

2013-01-29 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Added file: http://bugs.python.org/file28891/cloexec_misc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17070 ___

[issue17015] mock could be smarter and inspect the spec's signature

2013-01-29 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- dependencies: +Signature.bind() fails with a keyword argument named self ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17015 ___

[issue17071] Signature.bind() fails with a keyword argument named self

2013-01-29 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17071 ___ ___

[issue17036] Implementation of the PEP 433: Easier suppression of file descriptor inheritance

2013-01-29 Thread STINNER Victor
STINNER Victor added the comment: My TODO list is almost empty Oh, I forgot one point: I stil don't know if the close-on-exec flag of file descriptors of pass_fds argument of subprocess.Popen should be set. If close-on-exec flag is set globally, it's not convinient to have to clear the flag

[issue17070] PEP 433: Use the new cloexec to improve security and avoid bugs

2013-01-29 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: Use the new cloexec to improve security and avoid bugs - PEP 433: Use the new cloexec to improve security and avoid bugs ___ Python tracker rep...@bugs.python.org

[issue17036] Implementation of the PEP 433: Easier suppression of file descriptor inheritance

2013-01-29 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: Removed file: http://bugs.python.org/file28837/9bdfa1a3ea8c.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17036 ___

[issue17071] Signature.bind() fails with a keyword argument named self

2013-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: I'll take a look later today. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17071 ___ ___ Python-bugs-list

[issue16946] subprocess: _close_open_fd_range_safe() does not set close-on-exec flag on Linux 2.6.23 if O_CLOEXEC is defined

2013-01-29 Thread STINNER Victor
STINNER Victor added the comment: This issue is fixed in my implementation of the PEP 433: see #17036. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16946 ___

[issue17072] Decimal, quantize, round and negative value

2013-01-29 Thread Hakim Taklanti
New submission from Hakim Taklanti: from decimal import Decimal from decimal import ROUND_UP, ROUND_DOWN a = Decimal(-3.86) b = Decimal(5.73) a_up = a.quantize(Decimal(.1), ROUND_UP) a.quantize(Decimal(.1), ROUND_UP) # -3.8 expected Decimal('-3.9') a.quantize(Decimal(.1), ROUND_DOWN) #

[issue17072] Decimal, quantize, round and negative value

2013-01-29 Thread Mark Dickinson
Mark Dickinson added the comment: Indeed, that looks wrong. I'll take a look. -- assignee: - mark.dickinson nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17072 ___

[issue17072] Decimal, quantize, round and negative value

2013-01-29 Thread Mark Dickinson
Mark Dickinson added the comment: Sorry, I take that back. The behaviour is correct: ROUND_UP rounds away from zero; ROUND_DOWN towards zero. For rounding towards +/- infinity, you want ROUND_CEILING and ROUND_FLOOR: Python 2.7.3 |EPD 7.3-1 (32-bit)| (default, Apr 12 2012, 11:28:34)

[issue17072] Decimal, quantize, round and negative value

2013-01-29 Thread Hakim Taklanti
Hakim Taklanti added the comment: Indeed, perhaps to enhance the documentation. Thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17072 ___

[issue17073] Integer overflow in sqlite module

2013-01-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The proposed patch fixes an integer overflow in such cases: 1. When an authorizer callback (registered with set_authorizer()) returns an integer which doesn't fit into C int. Now integers out of C int range interpreted as SQLITE_DENY (as any non-integer

[issue17073] Integer overflow in sqlite module

2013-01-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file28893/sqlite_int_overflow-2.7.patch Added file: http://bugs.python.org/file28894/sqlite_int_overflow-3.2.patch Added file:

[issue15989] Possible integer overflow of PyLong_AsLong() results

2013-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sqlite module part extracted to issue17073. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15989 ___ ___

[issue16968] Fix test discovery for test_concurrent_futures.py

2013-01-29 Thread Zachary Ware
Zachary Ware added the comment: Right you are, Chris. v4 has a comment added to regrtest.runtest_inner pointing back to this issue. Also in v4, ReapedSuite has been moved to test.support. At least one other test module (test_pydoc) uses the same idiom as test_concurrent_futures, and so

[issue17074] (docs) Consistent formatting of constants

2013-01-29 Thread Zearin
New submission from Zearin: When reading the docs, I noticed that the capitalization and formatting of the Python constants ``True``, ``False``, and ``None`` were inconsistent. The attached patch contains a fix for all such occurrences under ``/Doc/library/``. (I **think** I correctly made

[issue17074] (docs) Consistent formatting of constants

2013-01-29 Thread Zearin
Changes by Zearin zea...@users.sourceforge.net: -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17074 ___ ___

  1   2   >