pylib/py.test 1.3.4: fixes and new native traceback option

2010-09-15 Thread holger krekel
pylib/py.test 1.3.4 is a minor maintenance release mostly containing bug fixes and a new --tb=native traceback option to show normal Python standard tracebacks instead of the py.test enhanced tracebacks. See below for more change info and http://pytest.org for more general information on

OpenOpt 0.31, FuncDesigner 0.21, DerApproximator 0.21

2010-09-15 Thread dmitrey
Hi all, I'm glad to inform you about new releases of our completely free (BSD license) cross-platform software, written using Python language and NumPy: OpenOpt 0.31 (numerical optimization), FuncDesigner 0.21 (automatic differentiation, modelling, interpolation, integration), DerApproximator

python call a procedure at the specified time

2010-09-15 Thread Von
Hi, I have a python script running behind the scene,and I need it to call a method on sunday 9 o'clock. I get an idea,that I get the current time,and calculate the seconds to sunday 9 o'clock, then sleep these seconds and call my method,I think there could be an elegant way to resolve this.

Re: python call a procedure at the specified time

2010-09-15 Thread Nitin Pawar
are you looking for something like cron? On Wed, Sep 15, 2010 at 11:43 AM, Von von...@gmail.com wrote: Hi, I have a python script running behind the scene,and I need it to call a method on sunday 9 o'clock. I get an idea,that I get the current time,and calculate the seconds to sunday 9

Re: python call a procedure at the specified time

2010-09-15 Thread Von
Hi Nitin,I need a python solution for that. On Wed, Sep 15, 2010 at 2:15 PM, Nitin Pawar nitinpawar...@gmail.comwrote: are you looking for something like cron? On Wed, Sep 15, 2010 at 11:43 AM, Von von...@gmail.com wrote: Hi, I have a python script running behind the scene,and I need it to

Re: python call a procedure at the specified time

2010-09-15 Thread Nitin Pawar
I think to do so either you will need to schedule a cron or write a daemon process which will run continuously. Assuming that its running only once a day or say timely manner daemon will be a costly affair for system resources To schedule crons for python, this might be useful (using yaml)

Re: String formatting with the format string syntax

2010-09-15 Thread Peter Otten
Andre Alexander Bell wrote: On 09/14/2010 08:20 PM, Miki wrote: You can use ** syntax: english = {'hello':'hello'} s.format(**english) Thanks for your answer. Actually your answer tells me that my example was misleading. Consider the template s = 'A template with {variable1} and

google app engine _method? put(self):

2010-09-15 Thread kristiannissen
How can I get the request passed on to my views when using this middleware? class RestHTTPMiddleware(object): def __init__(self, app): self.app = app def __call__(self, environ, start_response): request = Request(environ) body = StringIO.StringIO(request.body) method =

Re: python call a procedure at the specified time

2010-09-15 Thread Von
Thanks Nitin,I wonder how cron works,does it create a timer thread for each task? On Wed, Sep 15, 2010 at 2:35 PM, Nitin Pawar nitinpawar...@gmail.comwrote: I think to do so either you will need to schedule a cron or write a daemon process which will run continuously. Assuming that its

Re: python call a procedure at the specified time

2010-09-15 Thread Von
I have read the cron man page just now,It says that cron wakes up every minute to check task. I will try install/uninstall with cron. Cheers, On Wed, Sep 15, 2010 at 3:25 PM, Von von...@gmail.com wrote: Thanks Nitin,I wonder how cron works,does it create a timer thread for each task? On

Re: python call a procedure at the specified time

2010-09-15 Thread Nitin Pawar
cron is daemon running which maps the tasks with the frequency if you want to run a task at a specific time, you can schedule it for the same if you need any help, ping on gtalk, can help you out Thanks, Nitin On Wed, Sep 15, 2010 at 1:05 PM, Von von...@gmail.com wrote: I have read the cron

Re: String formatting with the format string syntax

2010-09-15 Thread Peter Otten
Peter Otten wrote: Andre Alexander Bell wrote: On 09/14/2010 08:20 PM, Miki wrote: You can use ** syntax: english = {'hello':'hello'} s.format(**english) Thanks for your answer. Actually your answer tells me that my example was misleading. Consider the template s = 'A template with

Re: String formatting with the format string syntax

2010-09-15 Thread Andre Alexander Bell
On 09/15/2010 10:00 AM, Peter Otten wrote: def extract_names(t, recurse=1): for _, name, fmt, _ in t._formatter_parser(): if name is not None: yield name if recurse and fmt is not None: for name in extract_names(fmt, recurse-1):

Re: String formatting with the format string syntax

2010-09-15 Thread Peter Otten
Andre Alexander Bell wrote: On 09/15/2010 10:00 AM, Peter Otten wrote: def extract_names(t, recurse=1): for _, name, fmt, _ in t._formatter_parser(): if name is not None: yield name if recurse and fmt is not None: for name in

Accessing windoze file attributes

2010-09-15 Thread Douglas
Environment: X86, 1Gb RAM, Win XP, latest SP, Excel 2003. Hi, can anyone direct a relative newbie to the best source of info? I am writing my own backup app in Python 2.5.2 (all my company will allow me to use) using IDLE. I intend to run this app daily via the Task Scheduler to back up a

ANN: OpenOpt 0.31, FuncDesigner 0.21, DerApproximator 0.21

2010-09-15 Thread dmitrey
Hi all, I'm glad to inform you about new releases of our completely free (BSD license) cross-platform software, written using Python language and NumPy: OpenOpt 0.31 (numerical optimization), FuncDesigner 0.21 (automatic differentiation, modelling, interpolation, integration), DerApproximator

python cxfreeze package pyqt app lost icon and tray icon

2010-09-15 Thread Von
Hi, Here is my command: cxfreeze --target-dir=AutoOrder gui.py --base-name=D:\Python31\Lib\site-packages\cx_Freeze\bases\Win32GUI.exe --include-path=. -z icon.jpg Both app icon and tray icon used icon.jpg Regards, -- http://mail.python.org/mailman/listinfo/python-list

Re: String formatting with the format string syntax

2010-09-15 Thread Andre Alexander Bell
On 09/15/2010 10:48 AM, Peter Otten wrote: I personally would not be too concerned about the leading underscore, but you can use string.Formatter().parse(template) instead. Thanks for this pointer. I like it this way. So if I now combine your generator with your suggestion, I end up with

Re: help with calling a static method in a private class

2010-09-15 Thread lallous
On Sep 14, 4:38 pm, de...@web.de (Diez B. Roggisch) wrote: lallouslall...@lgwm.org writes: How can I keep the class private and have the following work: [code] class __internal_class(object):     @staticmethod     def meth1(s):         print meth1:, s     @staticmethod     def

Re: python call a procedure at the specified time

2010-09-15 Thread Von
I used timer way,and I found that threading.Timer didn't work with PyQt,so I used QTimer instead,and it did work. On Wed, Sep 15, 2010 at 3:44 PM, Nitin Pawar nitinpawar...@gmail.comwrote: cron is daemon running which maps the tasks with the frequency if you want to run a task at a specific

Re: Accessing windoze file attributes

2010-09-15 Thread Diez B. Roggisch
Douglas mumm...@gmail.com writes: Hi, can anyone direct a relative newbie to the best source of info? I am writing my own backup app in Python 2.5.2 (all my company will allow me to use) using IDLE. I intend to run this app daily via the Task Scheduler to back up a mission-critical

Re: Accessing windoze file attributes

2010-09-15 Thread David Robinow
On Wed, Sep 15, 2010 at 4:51 AM, Douglas mumm...@gmail.com wrote: Environment: X86, 1Gb RAM, Win XP, latest SP, Excel 2003. Hi, can anyone direct a relative newbie to the best source of info? I am writing my own backup app in Python 2.5.2 (all my company will allow me to use) using IDLE. I

30 is True

2010-09-15 Thread Yingjie Lan
Hi, I am not sure how to interprete this, in the interactive mode: 30 is True False (30) is True True 3 (0 is True) True Why did I get the first 'False'? I'm a little confused. Thanks in advance for anybody who shed some light on this. YL --

Re: Accessing windoze file attributes

2010-09-15 Thread Lawrence D'Oliveiro
In message 8dc0fa8e-f0e6-4603-9283-186551597...@a19g2000vbi.googlegroups.com, Douglas wrote: It works well enough, but now I want to make it sensitive to the A attribute (only backup the file if it is set), and update it afterwards (unset it). This will help me avoid wasted disk due to

Re: distutils, cygwin, 'not a regular file'

2010-09-15 Thread Lawrence D'Oliveiro
In message 8faqj0fno...@mid.individual.net, Paul Watson wrote: ' not a regular file -- skipping ' not a regular file -- skipping ' not a regular file -- skipping Just a guess, is the file it’s complaining about named “'”? -- http://mail.python.org/mailman/listinfo/python-list

Re: 30 is True

2010-09-15 Thread Michael Ricordeau
Because is operator take precedence on operator . Le Wed, 15 Sep 2010 05:34:06 -0700 (PDT), Yingjie Lan lany...@yahoo.com a écrit : Hi, I am not sure how to interprete this, in the interactive mode: 30 is True False (30) is True True 3 (0 is True) True Why did I get the first

Re: 30 is True

2010-09-15 Thread Peter Otten
Yingjie Lan wrote: I am not sure how to interprete this, in the interactive mode: 30 is True False (30) is True True 3 (0 is True) True Why did I get the first 'False'? I'm a little confused. http://docs.python.org/reference/expressions.html#notin Unlike C, all comparison

Re: 30 is True

2010-09-15 Thread Jussi Piitulainen
Yingjie Lan writes: I am not sure how to interprete this, in the interactive mode: 30 is True False (30) is True True 3 (0 is True) True Why did I get the first 'False'? I'm a little confused. It is interpreted as equivalent to this: 3 0 and 0 is True False From the

Re: 30 is True

2010-09-15 Thread Mel
Yingjie Lan wrote: I am not sure how to interprete this, in the interactive mode: 30 is True False (30) is True True 3 (0 is True) True Why did I get the first 'False'? I'm a little confused. Thanks in advance for anybody who shed some light on this. This looks like comparison

Re: 30 is True

2010-09-15 Thread Michael Ricordeau
Not really true for and is : http://docs.python.org/reference/expressions.html#evaluation-order Operator and operator is are in the same precedence but in group Comparisons : Operators in the same box group left to right (except for comparisons, including tests, which all have the same

Re: 30 is True

2010-09-15 Thread Jon Siddle
As others have said, it's not a matter of precendence. Using the compiler module you can see how python actually parses this: 3 (0 is True) Compare(Const(3), [('', Compare(Const(0), [('is', Name('True'))]))]) No great surprise there. 3 0 is True Compare(Const(3), [('', Const(0)), ('is',

Re: 30 is True

2010-09-15 Thread Yingjie Lan
From: Jon Siddle j...@corefiling.co.uk Subject: Re: 30 is True To: python-list@python.org Date: Wednesday, September 15, 2010, 5:04 PM   As others have said, it's not a matter of precendence. Using the compiler module you can see how python actually parses this: 3 (0 is True)

os.path.normcase rationale?

2010-09-15 Thread Chris Withers
Hi All, I'm curious as to why, with a file called Foo.txt os.path.normcase('FoO.txt') will return foo.txt rather than Foo.txt? Yes, I know the behaviour is documented, but I'm wondering if anyone can remember the rationale for that behaviour? cheers, Chris -- Simplistix - Content

Re: business date and calendar libraries?

2010-09-15 Thread nn
On Sep 13, 3:02 pm, David Robinow drobi...@gmail.com wrote: On Mon, Sep 13, 2010 at 1:06 PM, Chris Withers ch...@simplistix.co.uk wrote: I'm wondering what libraries people would use to answer the following questions relating to business days: - on a less-naive level; same question but

Re: Numpy: Multiplying arrays of matrices

2010-09-15 Thread Colin J. Williams
On 14-Sep-10 19:54 PM, Gregory Ewing wrote: Suppose I have two N+2 dimensional arrays, representing N-d arrays of 2-d matrices. I want to perform matrix multiplication between corresponding matrices in these arrays. I had thought that dot() might do this, but it appears not, because e.g.

Deleting widgets from PyQt4 QFormWidget

2010-09-15 Thread Andrew
I'm trying to remove the widgets from the QFormLayout widget from PyQt4. According to the documentation I should be able to use the command .takeAt(int) which will delete the widget from the layout and then return to me the QLayoutWidget. It currently is giving me back the widget, but is not

Re: Deleting widgets from PyQt4 QFormWidget

2010-09-15 Thread Andrew
On Sep 15, 9:53 am, Andrew andrewt.h...@gmail.com wrote: I'm trying to remove the widgets from the QFormLayout widget from PyQt4. According to the documentation I should be able to use the command .takeAt(int) which will delete the widget from the layout and then return to me the

Re: Numpy: Multiplying arrays of matrices

2010-09-15 Thread Shashwat Anand
On Tue, Sep 14, 2010 at 7:54 PM, Gregory Ewing greg.ew...@canterbury.ac.nzwrote: Suppose I have two N+2 dimensional arrays, representing N-d arrays of 2-d matrices. I want to perform matrix multiplication between corresponding matrices in these arrays. I had thought that dot() might do

Re: Accessing windoze file attributes

2010-09-15 Thread Douglas
@Diez and @David Thanks guys. Both excellent leads. Colour me happy. I can now make progress and meet some deadlines. :) @Lawrence Why reinvent rsync? In what way is rsync relevant to the stated problem? Did you actually READ the question? Note: I use Linux at home (yes, even rsync) and very

Debugger - fails to continue with breakpoint set

2010-09-15 Thread Ed Greenberg
I'm pretty new to Python, but I am really enjoying it as an alternative to Perl and PHP. When I run the debugger [import pdb; pdb.set_trace()] and then do next and step, and evaluate variables, etc, when I hit 'c' for continue, we go to the end, just fine. As soon as I set a breakpoint down

socket.error: [Errno 98] Address already in use

2010-09-15 Thread cerr
Hi There, I get a socket error [Errno 98] Address already in use when i try to open a socket that got closed before with close(). How come close() doesn't close the socket properly? My socket code : s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host, port)) s.listen(1) ...

Re: socket.error: [Errno 98] Address already in use

2010-09-15 Thread Thomas Jollans
On Wednesday 15 September 2010, it occurred to cerr to exclaim: Hi There, I get a socket error [Errno 98] Address already in use when i try to open a socket that got closed before with close(). How come close() doesn't close the socket properly? My socket code : s =

Re: distutils, cygwin, 'not a regular file'

2010-09-15 Thread Thomas Jollans
On Wednesday 15 September 2010, it occurred to Paul Watson to exclaim: So, what is not a regular file about this? Is there any way to find out which files are being considered irregular? Regular files are the kind of files used to store bytes. Other kinds of files you might find in a file

Re: Cross Compiling Python for ARM

2010-09-15 Thread Hans Mulder
Thomas Jollans wrote: On Tuesday 14 September 2010, it occurred to Neil Benn to exclaim: # ./python -sh: ./python: not found I'm guessing either there is no file ./python, or /bin/sh is fundamentally broken. or ./python is a symlink to a file that does not exist, or ./python is a

Re: socket.error: [Errno 98] Address already in use

2010-09-15 Thread Grant Edwards
On 2010-09-15, cerr ron.egg...@gmail.com wrote: I get a socket error [Errno 98] Address already in use when i try to open a socket that got closed before with close(). How come close() doesn't close the socket properly? My socket code : s = socket.socket(socket.AF_INET,

Re: Debugger - fails to continue with breakpoint set

2010-09-15 Thread Thomas Jollans
On Wednesday 15 September 2010, it occurred to Ed Greenberg to exclaim: I'm pretty new to Python, but I am really enjoying it as an alternative to Perl and PHP. When I run the debugger [import pdb; pdb.set_trace()] and then do next and step, and evaluate variables, etc, when I hit 'c' for

Multiprocessing Queue strange behavior

2010-09-15 Thread Bruno Oliveira
Hi list, I recently found a bug in my company's code because of a strange behavior using multiprocessing.Queue. The following code snippet: from multiprocessing import Queue queue = Queue() queue.put('x') print queue.get_nowait() Fails with: ... File

Re: Multiprocessing Queue strange behavior

2010-09-15 Thread MRAB
On 15/09/2010 21:10, Bruno Oliveira wrote: Hi list, I recently found a bug in my company's code because of a strange behavior using multiprocessing.Queue. The following code snippet: from multiprocessing import Queue queue = Queue() queue.put('x') print queue.get_nowait() Fails with: ...

Please I need help!

2010-09-15 Thread Maria
I urgently need money help!https://siteheart.com/js/chat/chat.html? ent=9228hash=97b8aa4b4eec4801f941b0aa97cd2587ipcsid=842e10a5515ee7299638a546b6b2997f Maria -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.normcase rationale?

2010-09-15 Thread Ben Finney
Chris Withers ch...@simplistix.co.uk writes: I'm curious as to why, with a file called Foo.txt os.path.normcase('FoO.txt') will return foo.txt rather than Foo.txt? What kind of answer are you looking for? A direct answer would be: it does that because on case-insensitive filesystems, it

Re: business date and calendar libraries?

2010-09-15 Thread Robert Kern
On 9/13/10 12:06 PM, Chris Withers wrote: Hi All, I'm wondering what libraries people would use to answer the following questions relating to business days: - on a naive level; what's give me the last business day (ie: skipping weekends) - on a less-naive level; same question but taking into

Re: Numpy: Multiplying arrays of matrices

2010-09-15 Thread Robert Kern
On 9/15/10 11:36 AM, Colin J. Williams wrote: On 14-Sep-10 19:54 PM, Gregory Ewing wrote: Suppose I have two N+2 dimensional arrays, representing N-d arrays of 2-d matrices. I want to perform matrix multiplication between corresponding matrices in these arrays. I had thought that dot() might

Re: Debugger - fails to continue with breakpoint set

2010-09-15 Thread Ed Greenberg
On 09/15/2010 02:04 PM, Thomas Jollans wrote: On Wednesday 15 September 2010, it occurred to Ed Greenberg to exclaim: I'm pretty new to Python, but I am really enjoying it as an alternative to Perl and PHP. When I run the debugger [import pdb; pdb.set_trace()] and then do next and step,

Re: os.path.normcase rationale?

2010-09-15 Thread Gregory Ewing
Ben Finney wrote: it doesn't matter what the case is, so there's no need for anything more complex than all lowercase. Also doing what was suggested would require looking at what's in the file system, which would be a lot of bother to go to for no good reason, and would fail for paths that

it doesn't work ;) [class recursive function]

2010-09-15 Thread Ethan Furman
I need some fresh eyes, or better brains, or both! The expected debugging output is a list of names in alphabetical order from each node (there are about 90 of them); what I am getting is this: -- dbf.tables.Index.from_file('', r'aad13658_last_name_for_state.idx') starting next_item call

compiling python 3.1.2 with local readline fails to get readline - help!

2010-09-15 Thread gavino
I compiled readline 6.1 myself. # ./configure --prefix=/home/apps/python --disable-shared --with- pymalloc --with-threads --with-pth --enable-big-digits --disable-ipv6 --enable-readline --with-readline=/home/apps/readline/lib/ # make -j14 modules not installed: readline

Re: it doesn't work ;) [class recursive function]

2010-09-15 Thread MRAB
On 16/09/2010 00:23, Ethan Furman wrote: I need some fresh eyes, or better brains, or both! The expected debugging output is a list of names in alphabetical order from each node (there are about 90 of them); what I am getting is this: -- dbf.tables.Index.from_file('',

Re: compiling python 3.1.2 with local readline fails to get readline - help!

2010-09-15 Thread James Mills
On Thu, Sep 16, 2010 at 9:58 AM, gavino gavcom...@gmail.com wrote: I compiled readline 6.1 myself. #  ./configure --prefix=/home/apps/python --disable-shared --with- pymalloc --with-threads --with-pth --enable-big-digits --disable-ipv6 --enable-readline

classes and dictionaries

2010-09-15 Thread Jason Swails
Hello everyone, I'm encountering an issue in one of my Python classes that makes extensive use of dictionaries. I was under the impression that each time an object was instantiated, all of its variables were created in a new section of memory, so that if you change the value of the variable in

program organization question for web development with python

2010-09-15 Thread Hans
Hi, I'm new to this area. Please allow me to ask some (maybe stupid) questions. I'm planning to write a web application which used for searching my mysql database. 1. files organization I have this in my main.py: print a href=display_tb.py?id=%stable=%scursor=%s%s/a %

work opportunity

2010-09-15 Thread Health Coach
FREE to Join ! You get up to 35% cashback for every qualified purchase you make on the site. On any personal referrals, you'll also make 1/2% on their qualifying purchases! * www.ma360eMall.com Everything you need and want Get paid to shop with Cashback

Re: classes and dictionaries

2010-09-15 Thread James Mills
On Thu, Sep 16, 2010 at 10:13 AM, Jason Swails jason.swa...@gmail.com wrote: Hello everyone, I'm encountering an issue in one of my Python classes that makes extensive use of dictionaries.  I was under the impression that each time an object was instantiated, all of its variables were created

Re: program organization question for web development with python

2010-09-15 Thread James Mills
On Thu, Sep 16, 2010 at 10:14 AM, Hans hans...@gmail.com wrote: I'm new to this area. Please allow me to ask some (maybe stupid) questions. Without reading the rest of your post too much. Designs are up to you, I can't comment. I can only share in a fairly common view, and that is, we'd

Re: classes and dictionaries

2010-09-15 Thread MRAB
On 16/09/2010 01:13, Jason Swails wrote: Hello everyone, I'm encountering an issue in one of my Python classes that makes extensive use of dictionaries. I was under the impression that each time an object was instantiated, all of its variables were created in a new section of memory, so that

Re: socket.error: [Errno 98] Address already in use

2010-09-15 Thread jipalaciosort...@gmail.com
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 El 15/09/2010 20:58, Grant Edwards escribió: On 2010-09-15, cerr ron.egg...@gmail.com wrote: I get a socket error [Errno 98] Address already in use when i try to open a socket that got closed before with close(). How come close() doesn't close

Re: compiling python 3.1.2 with local readline fails to get readline - help!

2010-09-15 Thread gavino
On Sep 15, 5:12 pm, James Mills prolo...@shortcircuit.net.au wrote: On Thu, Sep 16, 2010 at 9:58 AM, gavino gavcom...@gmail.com wrote: I compiled readline 6.1 myself. #  ./configure --prefix=/home/apps/python --disable-shared --with- pymalloc --with-threads --with-pth --enable-big-digits

Re: [Python-Dev] problem with python 3.1

2010-09-15 Thread James Mills
(Posting to python general discussion). On Thu, Sep 16, 2010 at 10:17 AM, João Vitor john...@hotmail.com wrote: I made a program that, according to my teacher, is correct but is not running properly. The program is really simple: import math x = input (Coloque o valor do primeiro cateto:) y

Re: compiling python 3.1.2 with local readline fails to get readline - help!

2010-09-15 Thread James Mills
On Thu, Sep 16, 2010 at 11:10 AM, gavino gavcom...@gmail.com wrote: I am comiling 3.1.2. I am not root but a user. I compiled readline and it did not complain. gdb and zlib  and some other modules also were not found. Like I said earlier in my previous post, is the readline line that you

Re: WMI in Python

2010-09-15 Thread alex23
KING LABS kinglabs...@gmail.com wrote: The following information is exactly what I am trying to collect for the inventory. I can find vb scripts with googling. I want to do the same with Python Win32. Use Server/Client architecture . Client(agent) updates the information to server. I highly

Re: Accessing windoze file attributes

2010-09-15 Thread Lawrence D'Oliveiro
In message a3cb644c-ea77-484a-9509-bf6fea9e9...@q18g2000vbm.googlegroups.com, Douglas wrote: Why reinvent rsync? In what way is rsync relevant to the stated problem? Did you actually READ the question? Yes. Note: I use Linux at home (yes, even rsync) and very much prefer it to Windows.

Re: WMI in Python

2010-09-15 Thread Lawrence D'Oliveiro
In message d8d3a07f-118c-4f8b-a6fc-f6f8762c9...@x18g2000pro.googlegroups.com, alex23 wrote: However, for a quick ready solution, have you looked at Microsoft's Scriptomatic?[2] It's a handy little tool that lets you specify the WMI query you want and produces code for you, with Python being

How do you preserve time values with date.datefromtimestamp()

2010-09-15 Thread Rodrick Brown
I'm doing something like today = datetime.date.fromtimestamp(1284584357.241863) today.ctime() 'Wed Sep 15 00:00:00 2010' Why isn't the time field being populated what I expect is to see something like Wed Sep 15 2010 16:59:17:241863 -- [ Rodrick R. Brown ] http://www.rodrickbrown.com

Argparse: add_argument with action=append appends to default

2010-09-15 Thread John O'Hagan
I find this surprising: import argparse parser = argparse.ArgumentParser() parser.add_argument('--test', action='append', default=['default']) [...] parser.parse_args(['--test', 'arg']) Namespace(test=['default', 'arg']) As an argument is provided, I didn't expect to see the default in there

Re: How do you preserve time values with date.datefromtimestamp()

2010-09-15 Thread Cameron Simpson
On 15Sep2010 22:31, Rodrick Brown rodrick.br...@gmail.com wrote: | I'm doing something like | | today = datetime.date.fromtimestamp(1284584357.241863) | today.ctime() | 'Wed Sep 15 00:00:00 2010' | | Why isn't the time field being populated what I expect is to see something | like Wed Sep 15

select() call and filedescriptor out of range in select error

2010-09-15 Thread k3xji
Hi all, We have a select-based server written in Python. Occasionally, maybe twice a month there occurs a weird problem, select() returns with filedescriptor out of range in select() error. This is of course a normal error and handled gracefully. Our policy is to take down few users for select()

Re: Numpy: Multiplying arrays of matrices

2010-09-15 Thread Carl Banks
On Sep 14, 4:54 pm, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Suppose I have two N+2 dimensional arrays, representing N-d arrays of 2-d matrices. I want to perform matrix multiplication between corresponding matrices in these arrays. I had thought that dot() might do this, but it

Re: help with calling a static method in a private class

2010-09-15 Thread Steven D'Aprano
On Tue, 14 Sep 2010 16:38:50 +0200, Diez B. Roggisch wrote: And additionally, but simply not using staticmethods at all. It's a rather obscure feature of python - usually, classmethods are what is considered a static method in other languages. Are you sure about that? I know Java isn't

Re: select() call and filedescriptor out of range in select error

2010-09-15 Thread Ned Deily
In article bafd7b25-8a4a-4ef9-b839-adc42b62d...@i17g2000vbq.googlegroups.com, k3xji sum...@gmail.com wrote: We have a select-based server written in Python. Occasionally, maybe twice a month there occurs a weird problem, select() returns with filedescriptor out of range in select() error.

Re: select() call and filedescriptor out of range in select error

2010-09-15 Thread Steven D'Aprano
On Wed, 15 Sep 2010 21:05:49 -0700, k3xji wrote: Hi all, We have a select-based server written in Python. Occasionally, maybe twice a month there occurs a weird problem, select() returns with filedescriptor out of range in select() error. This is of course a normal error and handled

Re: select() call and filedescriptor out of range in select error

2010-09-15 Thread James Mills
On Thu, Sep 16, 2010 at 2:49 PM, Ned Deily n...@acm.org wrote: If the problem is that the socket object in question no longer exists, you can protect your code there by enclosing the remove operation in a try block, like: The question that remains to be seen however is: Why does your list

[issue9315] The trace module lacks unit tests

2010-09-15 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It looks like 3.1 with computed gotos produces the yet another different tracing of list comprehensions: 2: l = [i for 10: i in 1: range(10)] Well, this kind of thing is going to depend on the exact bytecode, the

[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-15 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: You should make sure that all operations (except close() itself) raise ValueError. Currently: f = gzip.open(test.gz, rb) f.close() f.read() b'' f.seek(0) 0 Also, you don't have to post a patch for 2.7. We'll do the porting ourselves. Thanks

[issue9315] The trace module lacks unit tests

2010-09-15 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- Removed message: http://bugs.python.org/msg116438 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9315 ___

[issue9858] RawIOBase doesn't define readinto

2010-09-15 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +benjamin.peterson, stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9858 ___ ___

[issue9857] SkipTest in tearDown is reported an as an error

2010-09-15 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Interesting use case. If the test has not yet failed this is fine. The problem is that if an exception has *already* been raised then it will already have been added to the result - so by then skipping is meaningless (or contradictory

[issue9858] RawIOBase doesn't define readinto

2010-09-15 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: +1 for a failing one. (Does the base implementation not raise?) Is it even possible to implement a real one without buffering? -- ___ Python tracker rep...@bugs.python.org

[issue9858] RawIOBase doesn't define readinto

2010-09-15 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: +1 for a failing one. (Does the base implementation not raise?) The base implementation doesn't exist :) Is it even possible to implement a real one without buffering? FileIO does. It's the same as read(), except that you read into an

[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Attached is a script to find all of the mismatches between the C and Python implementations. There are several. Below is the output: RawIOBase C is missing: ['readinto', 'write'] StringIO C is missing: ['name'] StringIO

[issue9859] Add tests to verify API match of modules with 2 implementations

2010-09-15 Thread Daniel Stutzbach
New submission from Daniel Stutzbach dan...@stutzbachenterprises.com: Recently it came to light that the classes in C and Python implementations of the io module have slightly different attributes (issue9858). I propose the addition of a helper function in Lib/test/support.py to verify that

[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: FWIW, I just opened Issue9859: Add tests to verify API match of modules with 2 implementations. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9858

[issue9851] multiprocessing socket timeout will break client

2010-09-15 Thread Jesse Noller
Jesse Noller jnol...@gmail.com added the comment: Calling it stupid doesn't incentivize me to help you, or fix it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9851 ___

[issue9857] SkipTest in tearDown is reported an as an error

2010-09-15 Thread Raghuram Devarakonda
Changes by Raghuram Devarakonda draghu...@gmail.com: -- nosy: +draghuram ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9857 ___ ___

[issue9860] Building python outside of source directory fails

2010-09-15 Thread Alexander Belopolsky
New submission from Alexander Belopolsky belopol...@users.sourceforge.net: When testing config options, it is often useful to build python in a directory different from the root of the source tree. This is supported by autoconf based builds as follows: you cd to the desired directory run

[issue678264] test_resource fails when file size is limited

2010-09-15 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: The test does not fail if FSIZE is not max on linux/py3k, but max is still represented as -1 on linux. So the reported bug is no longer valid, but Martin's concern has not been addressed. -- nosy: +r.david.murray

[issue9861] subprocess module changed exposed attributes

2010-09-15 Thread paul clinch
New submission from paul clinch pcli...@internet-glue.co.uk: Some attributes, e.g. STARTF_USESHOWWINDOW have moved to _subrocess.STARTF_USESHOWWINDOW. This breaks old code. -- components: Library (Lib) messages: 116450 nosy: pclinch priority: normal severity: normal status: open title:

[issue9860] Building python outside of source directory fails

2010-09-15 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: I think the problem is with the following explicit rules in Makefile: Parser/tokenizer_pgen.o:$(srcdir)/Parser/tokenizer.c Parser/pgenmain.o: $(srcdir)/Include/parsetok.h It looks like these rules are not

[issue9859] Add tests to verify API match of modules with 2 implementations

2010-09-15 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Shouldn't the test suite catch such discrepancies by testing all of the API? So your script catching something would be the equivalent of oops, we forgot a test (or oops, this name shouldn't be public). Which is not a bad thing to

[issue9859] Add tests to verify API match of modules with 2 implementations

2010-09-15 Thread Daniel Stutzbach
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Yes, exactly. :-) (see also Issue9731, which has a similar flavor) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9859

[issue9516] sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now 10.3 but 10.5 during configure

2010-09-15 Thread Stonewall Ballard
Stonewall Ballard ston...@gmail.com added the comment: I just ran into this with Python 2.7, installed using port. I'm using python to process a text file in an Xcode 3.2 Script build step, and it's throwing the error because my Xcode target has a base sdk of 10.5. -- nosy: +stoneyb

[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2010/9/15 Daniel Stutzbach rep...@bugs.python.org: Daniel Stutzbach dan...@stutzbachenterprises.com added the comment: Attached is a script to find all of the mismatches between the C and Python implementations.  There are several.  

  1   2   >