[ANN] bzr 2.6.0 released

2013-08-05 Thread Vincent Ladeuil
On behalf of the Bazaar team and community, I'm happy to announce availability of a new release of the bzr adaptive version control system. Bazaar http://bazaar.canonical.com/ is a Canonical project and part of the GNU project http://gnu.org/ to produce a free operating system. Thanks to

Astroid 1.0 released

2013-08-05 Thread Sylvain Thénault
Astroid_ is the new name of former logilab-astng library. It's an AST library, used as the basis of Pylint_ and including Python 2.5 - 3.3 compatible tree representation, statical type inference and other features useful for advanced Python code analysis, such as an API to provide extra

[RELEASED] Python 3.4.0a1

2013-08-05 Thread Larry Hastings
On behalf of the Python development team, I'm pleased to announce the first alpha release of Python 3.4. This is a preview release, and its use is not recommended for production settings. Python 3.4 includes a range of improvements of the 3.x series, including hundreds of small improvements

Re: Hangman question

2013-08-05 Thread Joshua Landau
On 5 August 2013 06:11, eschneide...@comcast.net wrote: I'm on chapter 9 of this guide to python: http://inventwithpython.com/chapter9.html but I don't quite understand why line 79 is what it is (blanks = blanks[:i] + secretWord[i] + blanks[i+1:]). I particularly don't get the [i+1:]

Re: Hangman question

2013-08-05 Thread Peter Otten
eschneide...@comcast.net wrote: I'm on chapter 9 of this guide to python: http://inventwithpython.com/chapter9.html but I don't quite understand why line 79 is what it is (blanks = blanks[:i] + secretWord[i] + blanks[i+1:]). I particularly don't get the [i+1:] part. Any additional

Re: Hangman question

2013-08-05 Thread Dave Angel
eschneide...@comcast.net wrote: I'm on chapter 9 of this guide to python: http://inventwithpython.com/chapter9.html but I don't quite understand why line 79 is what it is (blanks = blanks[:i] + secretWord[i] + blanks[i+1:]). I particularly don't get the [i+1:] part. Any additional

Re: outputting time in microseconds or milliseconds

2013-08-05 Thread Ulrich Eckhardt
Am 02.08.2013 15:17, schrieb matt.doolittl...@gmail.com: so you are saying that self.logfile.write('%s\t'%(str(time( should be: self.logfile.write('%s\t'%(str(time.time( No, I'm not saying that. What I wanted to make clear is that your code is impossible to understand as it

Re: stupid simple scope issue

2013-08-05 Thread JohnD
On 2013-08-04, Chris Angelico ros...@gmail.com wrote: On Sun, Aug 4, 2013 at 8:21 PM, JohnD j...@nowhere.com wrote: On 2013-08-04, Chris Angelico ros...@gmail.com wrote: [...] Python does have a slightly odd (compared to other languages) interpretation of variable assignments (name bindings,

__iadd__ for a subclass of array - howto

2013-08-05 Thread Helmut Jarausch
Hi, I'd like to subclass array.array and implement operators like __iadd__ How can this be accomplished. I'tried from array import array class Vec(array) : def __new__(cls,Vinit) : return array.__new__(cls,'d',Vinit) def __init__(self,*args) : self.N = len(self) def

Re: __iadd__ for a subclass of array - howto

2013-08-05 Thread Ian Kelly
On Mon, Aug 5, 2013 at 1:34 AM, Helmut Jarausch jarau...@igpm.rwth-aachen.de wrote: Hi, I'd like to subclass array.array and implement operators like __iadd__ How can this be accomplished. I'tried from array import array class Vec(array) : def __new__(cls,Vinit) : return

Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread Luca Cerone
Hi everybody, I am trying to understand how to use named pipes in python to launch external processes (in a Linux environment). As an example I am trying to imitate the behaviour of the following sets of commands is bash: mkfifo named_pipe ls -lah named_pipe cat named_pipe In Python I

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-08-05 Thread Sanjay Arora
On Tue, Jul 23, 2013 at 2:49 PM, Chris Angelico ros...@gmail.com wrote: Ah, there's a solution to this one. You simply use your own envelope-from address; SPF shouldn't be being checked for the From: header. Forwarding and using the original sender's address in the SMTP 'MAIL FROM' command

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread Paul Wiseman
On 5 August 2013 14:09, Luca Cerone luca.cer...@gmail.com wrote: Hi everybody, I am trying to understand how to use named pipes in python to launch external processes (in a Linux environment). As an example I am trying to imitate the behaviour of the following sets of commands is bash:

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread Luca Cerone
Hi Paul, first of all thanks for the help. I am aware of the first solutions, just now I would like to experiment a bit with using named pipes (I also know that the example is trivial, but it just to grasp the main concepts) You can also pass a file object to p1's stdout and p2's stdin if

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread MRAB
On 05/08/2013 14:09, Luca Cerone wrote: Hi everybody, I am trying to understand how to use named pipes in python to launch external processes (in a Linux environment). As an example I am trying to imitate the behaviour of the following sets of commands is bash: mkfifo named_pipe ls -lah

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread Luca Cerone
Hi MRAB, thanks for the reply! Opening the pipe for reading will block until it's also opened for writing, and vice versa. OK. In your bash code, 'ls' blocked until you ran 'cat', but because you ran 'ls' in the background you didn't notice it! Right. In your Python code,

Re: [argparse] mutually exclusive group with 2 sets of options

2013-08-05 Thread Miki Tebeka
Is it possible with argparse to have this syntax for a script? my-script (-a -b VALUE-B | -c -d VALUE-D) I would like to do this with the argparse module. You can probably do something similar using sub commands (http://docs.python.org/2/library/argparse.html#sub-commands). --

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread Alister
On Mon, 05 Aug 2013 06:09:53 -0700, Luca Cerone wrote: Hi everybody, I am trying to understand how to use named pipes in python to launch external processes (in a Linux environment). As an example I am trying to imitate the behaviour of the following sets of commands is bash: mkfifo

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread MRAB
On 05/08/2013 15:11, Luca Cerone wrote: Hi MRAB, thanks for the reply! Opening the pipe for reading will block until it's also opened for writing, and vice versa. OK. In your bash code, 'ls' blocked until you ran 'cat', but because you ran 'ls' in the background you didn't notice it!

Re: Bug? ( () == [] ) != ( ().__eq__([]) )

2013-08-05 Thread Markus Rother
Thanks for the good explanation. My intention was to pass a custom method/function as a comparator to an object. My misconception was, that __eq__ is equivalent to the '==' operator, and could be passed as a first class function. Apparently, that is not possible without wrapping the comparison

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread Luca Cerone
Hi Alister, Are you sure you are using the correct tool for the task? Yes. For two reasons: 1. I want to learn how to do this in Python :) 2. for an application I have in mind I will need to run external tools (not developed by me) and process the output using some tools that I have written in

Re: Bug? ( () == [] ) != ( ().__eq__([]) )

2013-08-05 Thread Ian Kelly
On Mon, Aug 5, 2013 at 8:58 AM, Markus Rother markus.rot...@web.de wrote: Thanks for the good explanation. My intention was to pass a custom method/function as a comparator to an object. My misconception was, that __eq__ is equivalent to the '==' operator, and could be passed as a first

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread Luca Cerone
Thanks MRAB, You need to ensure that the pipe is already open at the other end. So I need to open the process that reads the pipe before writing in it? Why are you using a named pipe anyway? For some bug in ipython (see my previous email) I can't use subprocess.Popen and pipe in the

Re: Piping processes works with 'shell = True' but not otherwise.

2013-08-05 Thread Luca Cerone
thanks and what about python 2.7? In Python 3.3 and above: p = subprocess.Popen(..., stderr=subprocess.DEVNULL) P.s. sorry for the late reply, I discovered I don't receive notifications from google groups.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread MRAB
On 05/08/2013 16:27, Luca Cerone wrote: Thanks MRAB, You need to ensure that the pipe is already open at the other end. So I need to open the process that reads the pipe before writing in it? Why are you using a named pipe anyway? For some bug in ipython (see my previous email) I can't

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread Neil Cerutti
On 2013-08-05, Luca Cerone luca.cer...@gmail.com wrote: I just would like to learn how to handle named pipes in Python, which I find it easier to do by using a simple example that I am comfortable to use :) Names pipes are a unix concept that saves you the hassle and limitations of writing to

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread Luca Cerone
Thanks this works (if you add shell=True in Popen). If I don't want to use shell = True, how can I redirect the stdout to named_pipe? Popen accepts an open file handle for stdout, which I can't open for writing because that blocks the process... os.mkfifo(named_pipe, 0777) ls_process =

RE: [argparse] mutually exclusive group with 2 sets of options

2013-08-05 Thread Joseph L. Casale
You can probably do something similar using sub commands (http://docs.python.org/2/library/argparse.html#sub-commands). The problem here is that argparse does not pass the subparser into the parsed args and shared args between subparsers need to be declared each time. Come execution time, when

Re: Piping processes works with 'shell = True' but not otherwise.

2013-08-05 Thread Tobiah
On 05/27/2013 04:33 AM, Luca Cerone wrote: Will it violate privacy / NDA to post the command line? Even if we can't actually replicate your system, we may be able to see something from the commands given. Unfortunately yes.. p1 = Popen(['nsa_snoop', 'terror_suspect', '--no-privacy',

Module for dialoging with intercative programs, sockets, files, etc.

2013-08-05 Thread Olive
I have found telnetlib which make very easy to interact with a telnet server, especially the read_until command. I wonder if something similar exits for other things that a telnet server. I for the moment have in mind interacting with a GSM modem (we do it by reading and writing a pseudo serial

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread MRAB
On 05/08/2013 17:54, Luca Cerone wrote: Thanks this works (if you add shell=True in Popen). If I don't want to use shell = True, how can I redirect the stdout to named_pipe? Popen accepts an open file handle for stdout, which I can't open for writing because that blocks the process... You're

Re: [argparse] mutually exclusive group with 2 sets of options

2013-08-05 Thread Rafael Durán Castañeda
El 04/08/13 04:10, Francois Lafont escribió: Hi, Is it possible with argparse to have this syntax for a script? my-script (-a -b VALUE-B | -c -d VALUE-D) I would like to do this with the argparse module. Thanks in advance. I think you are looking for exclusive groups:

Newbie: static typing?

2013-08-05 Thread Rui Maciel
Is there any pythonic way to perform static typing? After searching the web I've stumbled on a significant number of comments that appear to cover static typing as a proof of concept , but in the process I've found no tutorial on how to implement it. Does anyone care to enlighten a newbie?

Re: Newbie: static typing?

2013-08-05 Thread Gary Herron
On 08/05/2013 01:46 PM, Rui Maciel wrote: Is there any pythonic way to perform static typing? After searching the web I've stumbled on a significant number of comments that appear to cover static typing as a proof of concept , but in the process I've found no tutorial on how to implement it.

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread Luca Cerone
You're back to using separate threads for the reader and the writer. And how do I create separate threads in Python? I was trying to use the threading library without not too success.. -- http://mail.python.org/mailman/listinfo/python-list

Re: [argparse] mutually exclusive group with 2 sets of options

2013-08-05 Thread Francois Lafont
Le 05/08/2013 16:11, Miki Tebeka a écrit : You can probably do something similar using sub commands (http://docs.python.org/2/library/argparse.html#sub-commands). Yes, but this is not the same syntax. I want this syntax : my-script (-a -b VALUE-B | -c -d VALUE-D) I don't want this syntax:

RE: [argparse] mutually exclusive group with 2 sets of options

2013-08-05 Thread Joseph L. Casale
I think you are looking for exclusive groups: http://docs.python.org/2.7/library/argparse.html#argparse.add_mutually_excl usive_group No. That links first doc line in that method shows the very point we are all discussing: Create a mutually exclusive group. argparse will make sure that

undefined method []' for nil:NilClass (NoMethodError)

2013-08-05 Thread thcerbla . netsrot
Hi, I have this script to monitor solr4 with munin. But I get an error and I hove no idea what's the problem. Hope someone can help me... Thanks, Torsten Error: /etc/munin/plugins/solr4_multicore_avgRequestsPerSecond:60: undefined method []' for nil:NilClass (NoMethodError) from

Re: undefined method []' for nil:NilClass (NoMethodError)

2013-08-05 Thread Chris Angelico
On Mon, Aug 5, 2013 at 11:24 PM, thcerbla.nets...@googlemail.com wrote: I have this script to monitor solr4 with munin. But I get an error and I hove no idea what's the problem. Error: /etc/munin/plugins/solr4_multicore_avgRequestsPerSecond:60: undefined method []' for nil:NilClass

Re: [argparse] mutually exclusive group with 2 sets of options

2013-08-05 Thread Francois Lafont
Le 05/08/2013 22:01, Rafael Durán Castañeda a écrit : I think you are looking for exclusive groups: http://docs.python.org/2.7/library/argparse.html#argparse.add_mutually_exclusive_group Yes... but no. The doc explains you can do this: my-script (-b VALUE-B | -d VALUE-D) ie mutally

Re: Simulate `bash` behaviour using Python and named pipes.

2013-08-05 Thread MRAB
On 05/08/2013 22:47, Luca Cerone wrote: You're back to using separate threads for the reader and the writer. And how do I create separate threads in Python? I was trying to use the threading library without not too success.. To run a function in a separate thread: import threading def

Re: PyArg_ParseTuple() when the type could be anything?

2013-08-05 Thread David M. Cotter
i was able to get what i wanted by simply iterating over the tupile instead of using ParseTupile, then just query the type, then convert the type to C and move on to the next. totally great, now i can pass N different argument types to a single function, and have the C side deal gracefully

Re: Newbie: static typing?

2013-08-05 Thread Ian Kelly
On Mon, Aug 5, 2013 at 2:46 PM, Rui Maciel rui.mac...@gmail.com wrote: Is there any pythonic way to perform static typing? After searching the web I've stumbled on a significant number of comments that appear to cover static typing as a proof of concept , but in the process I've found no

Re: Newbie: static typing?

2013-08-05 Thread Ben Finney
Rui Maciel rui.mac...@gmail.com writes: Is there any pythonic way to perform static typing? I think no; static typing is inherently un-Pythonic. Python provides strong, dynamic typing. Enjoy it! Does anyone care to enlighten a newbie? Is there some specific problem you think needs static

Creating a running tally/ definitely new to this

2013-08-05 Thread gratedmedia
I currently working on a game, where I need to maintain a running tally of money, as the player makes purchases as they navigate thru game. I not exactly sure how to do this in python. I know it is a fairly basic step, nonetheless. Any assistance would be greatly appreciated. --

Sort lines in a plain text file alphanumerically

2013-08-05 Thread Devyn Collier Johnson
I am wanting to sort a plain text file alphanumerically by the lines. I have tried this code, but I get an error. I assume this command does not accept newline characters. file = open('/home/collier/pytest/sort.TXT', 'r').read() print(file) z c w r h s d file.sort() #The first blank line

Re: Creating a running tally/ definitely new to this

2013-08-05 Thread Joshua Landau
On 6 August 2013 02:01, gratedme...@gmail.com wrote: I currently working on a game, where I need to maintain a running tally of money, as the player makes purchases as they navigate thru game. I not exactly sure how to do this in python. I know it is a fairly basic step, nonetheless. Any

Re: Creating a running tally/ definitely new to this

2013-08-05 Thread Dave Angel
gratedme...@gmail.com wrote: I currently working on a game, where I need to maintain a running tally of money, as the player makes purchases as they navigate thru game. I not exactly sure how to do this in python. I know it is a fairly basic step, nonetheless. Any assistance would be

Re: Sort lines in a plain text file alphanumerically

2013-08-05 Thread MRAB
On 06/08/2013 03:00, Devyn Collier Johnson wrote: I am wanting to sort a plain text file alphanumerically by the lines. I have tried this code, but I get an error. I assume this command does not accept newline characters. file = open('/home/collier/pytest/sort.TXT', 'r').read() That

Re: Sort lines in a plain text file alphanumerically

2013-08-05 Thread Joshua Landau
On 6 August 2013 03:00, Devyn Collier Johnson devyncjohn...@gmail.comwrote: I am wanting to sort a plain text file alphanumerically by the lines. I have tried this code, but I get an error. I assume this command does not accept newline characters. HINT #1: Don't assume that without a reason.

Re: Sort lines in a plain text file alphanumerically

2013-08-05 Thread edu4madh
On Monday, August 5, 2013 10:00:55 PM UTC-4, Devyn Collier Johnson wrote: I am wanting to sort a plain text file alphanumerically by the lines. I have tried this code, but I get an error. I assume this command does not accept newline characters. file =

Re: Sort lines in a plain text file alphanumerically

2013-08-05 Thread alex23
On 6/08/2013 1:12 PM, Joshua Landau wrote: Because it's bad to open files without a with unless you know what you're doing, use a with: with open('/home/collier/pytest/__sort.TXT') as file: sorted(file, key=str.casefold, reverse=True) Shouldn't that be: with

Re: Sort lines in a plain text file alphanumerically

2013-08-05 Thread alex23
On 6/08/2013 1:49 PM, alex23 wrote: Shouldn't that be: with open('/home/collier/pytest/__sort.TXT') as file: data = file.readlines() sorted(data, key=str.casefold, reverse=True) I'm tempted to say HINT #5: don't provide a solution without testing it first but that would

Re: Sort lines in a plain text file alphanumerically

2013-08-05 Thread alex23
On 6/08/2013 1:49 PM, alex23 wrote: On 6/08/2013 1:12 PM, Joshua Landau wrote: Because it's bad to open files without a with unless you know what you're doing, use a with: with open('/home/collier/pytest/__sort.TXT') as file: sorted(file, key=str.casefold, reverse=True)

Re: Hangman question

2013-08-05 Thread eschneider92
Thanks I get it now. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: static typing?

2013-08-05 Thread Steven D'Aprano
On Mon, 05 Aug 2013 21:46:57 +0100, Rui Maciel wrote: Is there any pythonic way to perform static typing? After searching the web I've stumbled on a significant number of comments that appear to cover static typing as a proof of concept , but in the process I've found no tutorial on how to

[issue18658] Mercurial CPython log ticket link is broken

2013-08-05 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, it looks like it has been fixed. The format has changed as well. Previously: 5 hours ago R David Murray Merge: #18657: remove duplicate entries from Misc/ACKS.default tip 5 hours ago R David Murray #18657: remove duplicate entries from

[issue18651] test failures on KFreeBSD

2013-08-05 Thread Petr.Salinger
Petr.Salinger added the comment: It is related to http://bugs.python.org/issue12958 http://bugs.python.org/issue17684 The second one changed support.anticipate_failure to unittest.skipIf -- nosy: +Petr.Salinger ___ Python tracker

[issue18532] hashlib.HASH objects should officially expose the hash name

2013-08-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 238c37e4c395 by Jason R. Coombs in branch 'default': Issue 18532: Added tests and documentation to formally specify the .name attribute on hashlib objects. http://hg.python.org/cpython/rev/238c37e4c395 -- nosy: +python-dev

[issue18532] hashlib.HASH objects should officially expose the hash name

2013-08-05 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've confirmed the tests pass and the updated documentation renders nicely and without warnings. These changes now make the name attribute officially-supported and tested. -- resolution: - fixed ___ Python

[issue18658] Mercurial CPython log ticket link is broken

2013-08-05 Thread Vajrasky Kok
Vajrasky Kok added the comment: Wait, something weird is happening in CPython commits log website, http://hg.python.org/cpython . These are the latest four commits. age author description 45 hours agoJason R. Coombs Issue 18532: Added tests and documentation to formally

[issue18658] Mercurial CPython log ticket link is broken

2013-08-05 Thread Ezio Melotti
Ezio Melotti added the comment: This is a separate issue though, isn't it? Have you tried to ctrl+f5 the page? (Also this is probably something that should be reported to the Mercurial bug tracker, since -- unlike the issue links -- is not something we modified.) -- nosy:

[issue6057] sqlite3 error classes should be documented

2013-08-05 Thread timm
timm added the comment: I would find it useful to have the exception classes listed in the Python documentation rather than having to refer to two documents, but I don't have strong feelings on this. Given that nobody has fixed this for 4 years, should we just close the ticket? I'd be happy

[issue18658] Mercurial CPython log ticket link is broken

2013-08-05 Thread Ned Deily
Ned Deily added the comment: While it looks unusual, the commit list is fine. It reflects what you see currently in a hg log. What happened is that someone imported an older local change set or something similar. It's not always easy to tell from the log. -- resolution: - invalid

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok
New submission from Vajrasky Kok: There is test_precision in Lib/test_format.py which is not being unit tested. Also, there is a unused variable inside test_precision. Attached the patch to fix these problems. -- components: Tests files: test_precision.patch keywords: patch messages:

[issue14323] Normalize math precision in RGB/YIQ conversion

2013-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can you add a reference for the coefficients? I have only link to Wikipedia which refers to Code of Federal Regulations §73.682. This link (http://en.wikipedia.org/wiki/YIQ) already mentioned at the top of the file. (You claim about the current rounding

[issue18660] os.read behavior on Linux

2013-08-05 Thread Louis RIVIERE
New submission from Louis RIVIERE: A call to os.read that used to work on older Linux kernel, doesn't anymore with newer Linux kernel. As a workaroud we can use libc.read (ctypes) instead of os.read. But I feel like os.read should work, as it used to. The code (and comments) can be seen here :

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Mark Dickinson
Mark Dickinson added the comment: Patch looks good to me. -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18659 ___ ___

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset cfd875bcbe41 by Mark Dickinson in branch 'default': Issue #18659: fix test_format test that wasn't being executed. Thanks Vajrasky Kok for the patch. http://hg.python.org/cpython/rev/cfd875bcbe41 -- nosy: +python-dev

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed. Thanks! -- assignee: - mark.dickinson resolution: - fixed stage: - committed/rejected status: open - closed type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18659

[issue18661] Typo in grpmodule.c

2013-08-05 Thread Vajrasky Kok
New submission from Vajrasky Kok: I guess, there is a typo in Modules/grpmodule.c. See the patch below: diff -r f4f81ebc3de9 Modules/grpmodule.c --- a/Modules/grpmodule.c Sun Aug 04 15:50:08 2013 -0400 +++ b/Modules/grpmodule.c Mon Aug 05 17:40:33 2013 +0800 @@ -10,7 +10,7 @@

[issue18661] Typo in grpmodule.c

2013-08-05 Thread Mark Dickinson
Mark Dickinson added the comment: {0} is fine; some compilers will warn about it, but I believe it's valid C. -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18661

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Mark Dickinson
Mark Dickinson added the comment: Okay, that caused some buildbots to fail. I'm going to back out the change until I have time to figure out what's going on. -- resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9bee1fd64ee6 by Mark Dickinson in branch 'default': Issue #18659: Backed out changeset cfd875bcbe41 after buildbot failures. http://hg.python.org/cpython/rev/9bee1fd64ee6 -- ___ Python tracker

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Mark Dickinson
Mark Dickinson added the comment: Sample buildbot output here: http://buildbot.python.org/all/builders/x86%20RHEL%206%203.x/builds/2485/steps/test/logs/stdio Relevant snippet: test_precision (test.test_format.FormatTest) ... FAIL

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok
Vajrasky Kok added the comment: Let me help you to debug this issue. ethan@amiau:~/Documents/code/python/cpython$ cat /tmp/a.py import sys INT_MAX = sys.maxsize f = 1.2 format(f, .%sf % (INT_MAX + 1)) ethan@amiau:~/Documents/code/python/cpython$ ./python /tmp/a.py Traceback (most recent call

[issue18660] os.read behavior on Linux

2013-08-05 Thread Ronald Oussoren
Changes by Ronald Oussoren ronaldousso...@mac.com: -- nosy: +ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18660 ___ ___

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok
Vajrasky Kok added the comment: For now, instead of hardcoding INT_MAX to 2147483647 in test, maybe we can use module: import IN IN.INT_MAX 2147483647 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18659

[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-05 Thread Mark Dickinson
Mark Dickinson added the comment: +1 on the name 'first_true'. Does exactly what it says on the tin. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18652 ___

[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-05 Thread Hynek Schlawack
Hynek Schlawack added the comment: +1 on the name 'first_true'. Does exactly what it says on the tin. I fully agree. *** I assume what's missing now is a permission from Raymond to mess with his turf? -- ___ Python tracker rep...@bugs.python.org

[issue18515] zipfile._ZipDecryptor generates wasteful crc32 table on import

2013-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The objection to zipfile-no-crc32.patch is that binascii.crc32() and _crc32() have different signatures. binascii.crc32() accepts a byte object while _crc32() accepts a single integer. With packing this value into a bytes object _crc32() will be much

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +haypo, serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18659 ___ ___

[issue13083] _sre: getstring() releases the buffer before using it

2013-08-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - duplicate stage: - committed/rejected status: open - closed superseder: - Segfault when using re.finditer over mmap ___ Python tracker rep...@bugs.python.org

[issue13083] _sre: getstring() releases the buffer before using it

2013-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13083 ___ ___ Python-bugs-list mailing list

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread STINNER Victor
STINNER Victor added the comment: The IN module must not be used, it is hardcoded and never regenerated. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18659 ___

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread STINNER Victor
STINNER Victor added the comment: I added the test in the following commit: changeset: 84266:ef5175d08e7e branch: 3.3 parent: 84263:7ecca1a98220 user:Victor Stinner victor.stin...@gmail.com date:Sun Jun 23 14:54:30 2013 +0200 files: Lib/test/test_format.py

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: We have _testcapi.INT_MAX. I guess different exceptions raised on 64-bit platform. First parser checks that a number can be represented as Py_ssize_t (i.e. = PY_SSIZE_T_MAX). Here Too many decimal digits in format string can be raised. Then precision passed

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok
Vajrasky Kok added the comment: For the passers-by who want to help: The precision too big exception is raised in Python/formatter_unicode.c line 1168 and 1002. The Too many decimal digits... exception is raised in Python/formatter_unicode.c line 71. So the question is whether it is

[issue18273] Simplify calling and discovery of json test package

2013-08-05 Thread Ezio Melotti
Ezio Melotti added the comment: I like the patch. Can you make ./python Lib/test/test_json/ work too? Currently it doesn't seem to work (it works for e.g. ./python Lib/test/test_email/). -- stage: - patch review ___ Python tracker

[issue14323] Normalize math precision in RGB/YIQ conversion

2013-08-05 Thread Ezio Melotti
Ezio Melotti added the comment: LGTM. -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14323 ___ ___

[issue18078] threading.Condition to allow notify on a specific waiter

2013-08-05 Thread João Bernardo
João Bernardo added the comment: Seems like just because I never used I don't support. Boost C++ libraries has a wait_for_any functionality to synchronize futures. C# has a WaitAny in the WaitHandle class (like our Condition). Another problem is: the Condition class cannot be easily

[issue18585] Add a text truncation function

2013-08-05 Thread Ezio Melotti
Ezio Melotti added the comment: [...] and ASCII are fine with me. Perhaps there could be an argument controlling where to truncate (left, right or centre). A good use-case for the new Enums, perhaps? :-) I wrote a similar function once and in addition to the width it had this feature too

[issue18585] Add a text truncation function

2013-08-05 Thread Ezio Melotti
Ezio Melotti added the comment: Perhaps shorten would be a better name -- summarize sounds smarter than it actually is :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18585 ___

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, I guess the fix for this ticket should be kept simple. If we want to merge the exception message or touch the code base or do something smarter than fixing the test, maybe we should create a separate ticket. So I used Serhiy Storchaka's suggestion to use

[issue18585] Add a text truncation function

2013-08-05 Thread R. David Murray
R. David Murray added the comment: Looking just at the proposed functionality (taking a prefix) and ignoring the requested complexification :), the usual name for the text produced by this process is a lead (http://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Lead_section), although

[issue18472] Update PEP 8 to encourage modern conventions

2013-08-05 Thread Ezio Melotti
Ezio Melotti added the comment: I'm a bit late but I still have a few comments: + The paren-using form also means that when the exception arguments are + long or include string formatting, you don't need to use line + continuation characters thanks to the containing parentheses. This

[issue18606] Add statistics module to standard library

2013-08-05 Thread Steven D'Aprano
Steven D'Aprano added the comment: On 03/08/13 13:22, Alexander Belopolsky wrote: Alexander Belopolsky added the comment: The implementation of median and mode families of functions as classes is clever, So long as it is not too clever. but I am not sure it is a good idea to return

[issue2528] Change os.access to check ACLs under Windows

2013-08-05 Thread Tim Golden
Tim Golden added the comment: Here's an updated patch against trunk with tests doc changes -- status: languishing - open Added file: http://bugs.python.org/file31165/issue2528.2.patch ___ Python tracker rep...@bugs.python.org

[issue2528] Change os.access to check ACLs under Windows

2013-08-05 Thread Tim Golden
Tim Golden added the comment: ... and to answer Amaury's question in msg109871 it creates a reasonable consistency between the results of os.access and the user's actual ability to read / write a file. eg, you might have no permissions whatsoever on the file but as long as it wasn't

[issue17372] provide pretty printer for xml.etree.ElementTree

2013-08-05 Thread Laszlo Papp
Laszlo Papp added the comment: This has just made me switching away from xml.etree.ElementTree today, sadly. What a pity; it would have been all kind of cool to stick to this minimal, otherwise working parser and builder. -- nosy: +lpapp ___ Python

  1   2   >