Do2 Commandline Utility - Do2.py

2012-02-28 Thread philrist
This is an extension to the Do.py program. It adds several features. Documentation is included in the source. begin 644 Do2.py M#0HC(TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM M+2TM+2T-B,@3F%M93H@1\R#0HC($1EV-R:7!T:6]N.B!%'!A;F0@86YD

ANN: SciPy 0.10.1 released

2012-02-28 Thread Ralf Gommers
Hi all, I am pleased to announce the availability of SciPy 0.10.1. This is a maintenance release, with no new features compared to 0.10.0. Sources and binaries can be found at http://sourceforge.net/projects/scipy/files/scipy/0.10.1/, release notes are copied below. Enjoy, The SciPy developers

Do Commandline Utility - Do.py

2012-02-28 Thread philrist
Here is the latest version of my Do.py Windows command line utility. Documentation is included in the source. It is used from a Windows Explorer context menu or other command line where one file path is supplied and two are needed or where a path other than the selected path is required. It is

Re: Error importing __init__ declared variable from another package

2012-02-28 Thread Jason Veldicott
Accidentally hit post by mistake before msg completed. Any comments appreciated. It's a very simple scenario, but not sure what the mistake is. Thanks Jason On Tue, Feb 28, 2012 at 6:55 PM, Jason Veldicott jasonveldic...@gmail.comwrote: Hi, I have a simple configuration of modules as

Re: Error importing __init__ declared variable from another package

2012-02-28 Thread Peter Otten
Jason Veldicott wrote: Hi, I have a simple configuration of modules as beneath, but an import error is reported: /engine (__init__ is empty here) engine.py /sim __init__.py The module engine.py imports a variable instantiated in sim.__init__ as follows: from sim

check if directory is writable in a portable way

2012-02-28 Thread Andrea Crotti
How should I check if I can create files in a directory? I tried to simply check if the directory is writeable with this function: def is_writable(name): Return true if the file is writable from the current user return os.access(name, os.W_OK) but that doesn't work at all on

Re: Python urllib2 problem: Name or service not known

2012-02-28 Thread Alex Borghgraef
On Feb 28, 1:36 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Mon, 27 Feb 2012 12:48:27 -0800, Alex Borghgraef wrote: Hi all, Some time ago I've written some python code to read video data off an IP camera connected via a router to a laptop. Now I try to run this code

Re: Python urllib2 problem: Name or service not known

2012-02-28 Thread Alex Borghgraef
On Feb 28, 10:50 am, Alex Borghgraef alexander.borghgr...@gmail.com wrote: I'll still have to find out a way to get this thing working with proxy enabled if I ever want to connect it to our overall network. Ok, doing os.environ['http_proxy']='' before importing urllib2 seems to do the trick

Re: check if directory is writable in a portable way

2012-02-28 Thread Tim Golden
On 28/02/2012 10:07, Andrea Crotti wrote: How should I check if I can create files in a directory? I tried to simply check if the directory is writeable with this function: def is_writable(name): Return true if the file is writable from the current user return os.access(name, os.W_OK) but

Re: namespace question

2012-02-28 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: On Sun, 26 Feb 2012 19:47:49 +1100, Ben Finney wrote: An integer variable is a variable holding an integer. A string variable is a variable holding a string. A list variable is a variable holding a list. And Python has none

Re: check if directory is writable in a portable way

2012-02-28 Thread Andrea Crotti
On 02/28/2012 11:34 AM, Tim Chase wrote: On 02/28/12 04:07, Andrea Crotti wrote: How should I check if I can create files in a directory? So maybe the only solution that works is something like try: open(path.join('temp', 'w')) except OsError: return False else:

Re: check if directory is writable in a portable way

2012-02-28 Thread Tim Chase
On 02/28/12 04:07, Andrea Crotti wrote: How should I check if I can create files in a directory? So maybe the only solution that works is something like try: open(path.join('temp', 'w')) except OsError: return False else: os.remove(path.join('temp')) return True It

Re: check if directory is writable in a portable way

2012-02-28 Thread Tim Chase
On 02/28/12 06:01, Andrea Crotti wrote: How should I check if I can create files in a directory? But isn't there (or should there be) a windows-related library that abstracts this horrible things? Yes, there should be. There isn't as far as I know (though that doesn't mean much given my

pickling to an output file.

2012-02-28 Thread Smiley 4321
I have created a bytestream (readfile.pkl) from pickle.dump() already in different folder (say /tmp) succesfully. Now I wish to open the file, read it and finally write the output to a file to output.txt. To read the file bytestream file (readfile.pkl) I did perform as -- --- import pickle def

Re: Question about sub-packages

2012-02-28 Thread Frank Millman
Frank Millman fr...@chagford.com wrote in message news:jii0vo$36t$1...@dough.gmane.org... Hi all This is a follow-up to my recent question about circular imports, but on a different subject, hence the new thread. [...] If this makes sense, my next thought was, where is the best place to

Re: check if directory is writable in a portable way

2012-02-28 Thread Tim Golden
On 28/02/2012 12:01, Andrea Crotti wrote: On 02/28/2012 11:34 AM, Tim Chase wrote: On 02/28/12 04:07, Andrea Crotti wrote: How should I check if I can create files in a directory? So maybe the only solution that works is something like try: open(path.join('temp', 'w')) except OsError: return

Re: namespace question

2012-02-28 Thread Steven D'Aprano
On Tue, 28 Feb 2012 22:36:56 +1100, Ben Finney wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: On Sun, 26 Feb 2012 19:47:49 +1100, Ben Finney wrote: An integer variable is a variable holding an integer. A string variable is a variable holding a string. A list variable

xlrd 0.7.3 released!

2012-02-28 Thread Chris Withers
Hi All, I'm pleased to announce the release of xlrd 0.7.3. This release just brings in some documentation updates that were missed for 0.7.2. cheers, Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk --

suppressing argparse arguments in the help

2012-02-28 Thread Andrea Crotti
I have a script that might be used interactively but also has some arguments that should not be used by normal users. So I just want to suppress them from the help. I've read somewhere that the help=SUPPRESS should do what I want: parser.add_argument('-n', '--test_only',

Pickle performing class instantiation ??

2012-02-28 Thread Smiley 4321
I am looking for pickle performing class instantiation, something as prototype like - - Have a class - Instantiate the class with 3 parameters - pickle the class instance - generate a bytestream (.pkl) using pickle.dump -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle performing class instantiation ??

2012-02-28 Thread Smiley 4321
Am I doing the right thing for - - Have a class - Instantiate the class with 3 parameters - pickle the class instance - generate a bytestream (.pkl) using pickle.dump, simply guessing - as - --- #!/usr/bin/python import pickle class Pickle: def __init__(self, Parameter1, Parameter2,

Re: suppressing argparse arguments in the help

2012-02-28 Thread Peter Otten
Andrea Crotti wrote: I have a script that might be used interactively but also has some arguments that should not be used by normal users. So I just want to suppress them from the help. I've read somewhere that the help=SUPPRESS should do what I want: parser.add_argument('-n',

RE: Pickle performing class instantiation ??

2012-02-28 Thread Prasad, Ramit
class Pickle:     def __init__(self, Parameter1, Parameter2, Parameter3):         self.PM1 = Parameter1         self.PM2 = Parameter2         self.PM3 = Parameter3 with open('/tmp/readfile.pkl', 'wb') as f:     pickle.dump((self.PM1, self.PM2, self.PM3), f)     with open('/tmp/readfile.pkl',

Re: Pickle performing class instantiation ??

2012-02-28 Thread Peter Otten
Smiley 4321 wrote: Am I doing the right thing for - - Have a class - Instantiate the class with 3 parameters - pickle the class instance - generate a bytestream (.pkl) using pickle.dump, simply guessing - as - --- #!/usr/bin/python import pickle class Pickle: def

Re: Pickle performing class instantiation ??

2012-02-28 Thread Andrew Berg
On 2/28/2012 9:54 AM, Smiley 4321 wrote: NameError: name 'self' is not defined self is meaningless outside a class definition. You should refactor your dump, load and print code as methods inside the class definition, create an instance and call the methods on that instance. -- CPython 3.2.2 |

Re: suppressing argparse arguments in the help

2012-02-28 Thread Andrea Crotti
On 02/28/2012 04:02 PM, Peter Otten wrote: Andrea Crotti wrote: I have a script that might be used interactively but also has some arguments that should not be used by normal users. So I just want to suppress them from the help. I've read somewhere that the help=SUPPRESS should do what I want:

Re: multiprocessing, what am I doing wrong?

2012-02-28 Thread Eric Frederich
If I do a time.sleep(0.001) right at the beginning of the run() method, then it completes fine. I was able to run it through a couple hundred times without problem. If I sleep for less time than that or not at all, it may or may not complete. On Mon, Feb 27, 2012 at 9:38 PM, MRAB

Need to write python source with python

2012-02-28 Thread crstop
Hi All, I'm new to Python but have experience with a few other programming languages(Java, Perl, JavaScript). I'm using Python 2.7.2 and I'm trying to create and write to a file (.py) a python class and functions from python. I will also need to later read and edit the file. I realize I

GUI for pickle read

2012-02-28 Thread Smiley 4321
Can I have some thoughts about - building a GUI to display the results of the pickle read? A prototype code should be fine on Linux. ~ BR -- http://mail.python.org/mailman/listinfo/python-list

Re: Need to write python source with python

2012-02-28 Thread Peter Otten
crs...@gmail.com wrote: I'm new to Python but have experience with a few other programming languages(Java, Perl, JavaScript). I'm using Python 2.7.2 and I'm trying to create and write to a file (.py) a python class and functions from python. I will also need to later read and edit the

Re: Need to write python source with python

2012-02-28 Thread 88888 Dihedral
在 2012年2月29日星期三UTC+8上午1时56分43秒,Peter Otten写道: crs...@gmail.com wrote: I'm new to Python but have experience with a few other programming languages(Java, Perl, JavaScript). I'm using Python 2.7.2 and I'm trying to create and write to a file (.py) a python class and functions from

Re: multiprocessing, what am I doing wrong?

2012-02-28 Thread MRAB
On 28/02/2012 17:16, Eric Frederich wrote: If I do a time.sleep(0.001) right at the beginning of the run() method, then it completes fine. I was able to run it through a couple hundred times without problem. If I sleep for less time than that or not at all, it may or may not complete. [snip]

Re: suppressing argparse arguments in the help

2012-02-28 Thread Peter Otten
Andrea Crotti wrote: On 02/28/2012 04:02 PM, Peter Otten wrote: Andrea Crotti wrote: I have a script that might be used interactively but also has some arguments that should not be used by normal users. So I just want to suppress them from the help. I've read somewhere that the

Re: GUI for pickle read

2012-02-28 Thread Jerry Hill
On Tue, Feb 28, 2012 at 12:51 PM, Smiley 4321 ssmil...@gmail.com wrote: Can I have some thoughts about - building a GUI to display the results of the pickle read? A prototype code should be fine on Linux. It doesn't seem like it would be all that useful, though I may just be lacking in

Re: Need to write python source with python

2012-02-28 Thread crstop
On Tuesday, February 28, 2012 9:56:43 AM UTC-8, Peter Otten wrote: crs...@gmail.com wrote: I'm new to Python but have experience with a few other programming languages(Java, Perl, JavaScript). I'm using Python 2.7.2 and I'm trying to create and write to a file (.py) a python class

Listing children processes

2012-02-28 Thread Mihai Badoiu
I'm trying to compute the total CPU load of an external process and it's children. (so I cannot use resource.getrusage) For the load of the process I can just grab it from /proc/X/stat. How do I get the CPU load of the children processes? Is there an easy way to get a list of the children

Re: GUI for pickle read

2012-02-28 Thread Aaron France
On Tue, Feb 28, 2012 at 12:51 PM, Smiley 4321ssmil...@gmail.com wrote: Can I have some thoughts about - building a GUI to display the results of the pickle read? A prototype code should be fine on Linux. What on earth is this post asking? Do you want code? Opinions? --

Re: Question about circular imports

2012-02-28 Thread Ethan Furman
OKB (not okblacke) wrote: Anyway, testing this just reinforced my distaste for circular imports. Just trying to think about how it ought to work with a importing c but then c and d importing each other makes my brain hurt. Refactoring the files so that common code is in a separate

Re: Python math is off by .000000000000045

2012-02-28 Thread Ethan Furman
Michael Torrie wrote: He's simply showing you the hex (binary) representation of the floating-point number's binary representation. As you can clearly see in the case of 1.1, there is no finite sequence that can store that. You end up with repeating numbers. Thanks for the explanation.

Re: Need to write python source with python

2012-02-28 Thread Peter Otten
crs...@gmail.com wrote: On Tuesday, February 28, 2012 9:56:43 AM UTC-8, Peter Otten wrote: crs...@gmail.com wrote: I'm new to Python but have experience with a few other programming languages(Java, Perl, JavaScript). I'm using Python 2.7.2 and I'm trying to create and write to a file

Re: wcout issue

2012-02-28 Thread Dave Angel
On 02/27/2012 10:26 PM, Ben Held wrote: Hello, After upgrading from Python 2.6 to 3.2 in our application we noticed that after calling Py_Initialize, our output from std::wcout has extra spaces in it: wcout LJust a test\n; now prints out: J u s t a t e s t Any clue why? Ben Held

Re: Need to write python source with python

2012-02-28 Thread crstop
On Tuesday, February 28, 2012 11:25:33 AM UTC-8, Peter Otten wrote: crs...@gmail.com wrote: On Tuesday, February 28, 2012 9:56:43 AM UTC-8, Peter Otten wrote: crs...@gmail.com wrote: I'm new to Python but have experience with a few other programming languages(Java, Perl,

Re: Listing children processes

2012-02-28 Thread Chris Rebert
On Tue, Feb 28, 2012 at 10:33 AM, Mihai Badoiu mbad...@gmail.com wrote: I'm trying to compute the total CPU load of an external process and it's children.  (so I cannot use resource.getrusage)  For the load of the process I can just grab it from /proc/X/stat.  How do I get the CPU load of the

Re: Listing children processes

2012-02-28 Thread Mihai Badoiu
Looked at that before. psutil doesn't do children. --mihai On Tue, Feb 28, 2012 at 4:35 PM, Chris Rebert c...@rebertia.com wrote: On Tue, Feb 28, 2012 at 10:33 AM, Mihai Badoiu mbad...@gmail.com wrote: I'm trying to compute the total CPU load of an external process and it's children. (so

Re: Listing children processes

2012-02-28 Thread Arnaud Delobelle
On 28 February 2012 21:39, Mihai Badoiu mbad...@gmail.com wrote: On Tue, Feb 28, 2012 at 4:35 PM, Chris Rebert c...@rebertia.com wrote: On Tue, Feb 28, 2012 at 10:33 AM, Mihai Badoiu mbad...@gmail.com wrote: I'm trying to compute the total CPU load of an external process and it's children. 

alternative to with statement?

2012-02-28 Thread Craig Yoshioka
I see that there was previously a PEP to allow the with statement to skip the enclosing block... this was shot down, and I'm trying to think of the most elegant alternative. The best I've found is to abuse the for notation: for _ in cachingcontext(x): # create cached resources here # return

RE: alternative to with statement?

2012-02-28 Thread Prasad, Ramit
Craig Yoshioka wrote: I see that there was previously a PEP to allow the with statement to skip the enclosing block... this was shot down, and I'm trying to think of the most elegant alternative. [..] I would have really liked: with cachingcontext(x): # create cached resources here # return

Re: suppressing argparse arguments in the help

2012-02-28 Thread Calvin Spealman
On Tue, Feb 28, 2012 at 1:07 PM, Peter Otten __pete...@web.de wrote: Andrea Crotti wrote: On 02/28/2012 04:02 PM, Peter Otten wrote: Andrea Crotti wrote: I have a script that might be used interactively but also has some arguments that should not be used by normal users. So I just want to

Re: alternative to with statement?

2012-02-28 Thread Chris Kaynor
On Tue, Feb 28, 2012 at 1:04 PM, Craig Yoshioka crai...@me.com wrote: I see that there was previously a PEP to allow the with statement to skip the enclosing block... this was shot down, and I'm trying to think of the most elegant alternative. The best I've found is to abuse the for

Re: alternative to with statement?

2012-02-28 Thread Terry Reedy
On 2/28/2012 5:12 PM, Prasad, Ramit wrote: Craig Yoshioka wrote: I see that there was previously a PEP to allow the with statement to skip the enclosing block... this was shot down, and I'm trying to think of the most elegant alternative. [..] I would have really liked: with

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-28 Thread Rick Johnson
On Feb 24, 8:54 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: for...else is a very useful construct, but the name is misleading. It took me a long time to stop thinking that the else clause executes when the for loop was empty. Agreed. This is a major stumbling block for

Re: GUI for pickle read

2012-02-28 Thread Rick Johnson
On Feb 28, 12:13 pm, Jerry Hill malaclyp...@gmail.com wrote: On Tue, Feb 28, 2012 at 12:51 PM, Smiley 4321 ssmil...@gmail.com wrote: Can I have some thoughts about - building a GUI to display the results of the pickle read? Sure. But first can you show us some code that reads a pickled file

Re: alternative to with statement?

2012-02-28 Thread Craig Yoshioka
It is a bit non-normal. but I think this is a good use case as I want to create a very simple-to-use system for non-python experts to safely wrap their CLI programs in a caching architecture... that's why I lament the inability to not use the more streamlined 'with' syntax– abusing the for

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-28 Thread Chris Angelico
On Wed, Feb 29, 2012 at 9:56 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Feb 24, 8:54 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: In Python 4000, I think for loops should be spelled: for name in iterable:     # for block then:     # only if not exited with

Re: check if directory is writable in a portable way

2012-02-28 Thread Mark Hammond
On 28/02/2012 9:07 PM, Andrea Crotti wrote: How should I check if I can create files in a directory? By trying to create them there :) Presumably you want to know that so you can write something real - so just write that something real. The problem gets quite hard when you consider things

Re: Listing children processes

2012-02-28 Thread Mark Lawrence
On 28/02/2012 21:47, Arnaud Delobelle wrote: On 28 February 2012 21:39, Mihai Badoiumbad...@gmail.com wrote: On Tue, Feb 28, 2012 at 4:35 PM, Chris Rebertc...@rebertia.com wrote: On Tue, Feb 28, 2012 at 10:33 AM, Mihai Badoiumbad...@gmail.com wrote: I'm trying to compute the total CPU

Re: Listing children processes

2012-02-28 Thread Dave Angel
On 02/28/2012 06:41 PM, Mark Lawrence wrote: On 28/02/2012 21:47, Arnaud Delobelle wrote: Please don't top-post! Also, psutil.Process.get_children() looks to me like it does children. You are incorrect. I've been told of by the BDFL for stating that people should not top post on any

Re: Listing children processes

2012-02-28 Thread Steven D'Aprano
On Tue, 28 Feb 2012 23:41:16 +, Mark Lawrence wrote: I've been told of by the BDFL for stating that people should not top post on any Python mailing list/news group. He's the BDFL of Python, not of mailing list etiquette. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Listing children processes

2012-02-28 Thread Ben Finney
Mark Lawrence breamore...@yahoo.co.uk writes: On 28/02/2012 21:47, Arnaud Delobelle wrote: Please don't top-post! Also, psutil.Process.get_children() looks to me like it does children. You are incorrect. Incorrect? The only factual statement Arnaud made was about ‘psutil’. I've been

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-28 Thread Steven D'Aprano
On Wed, 29 Feb 2012 10:24:18 +1100, Chris Angelico wrote: Every syntactic structure should have the addition of a foo: suite, which will run when the programmer expects it to and no other time. This would solve a LOT of problems. Indeed, when I design my killer language, the identifiers

RE: alternative to with statement?

2012-02-28 Thread Prasad, Ramit
Craig Yoshioka wrote: It is a bit non-normal. but I think this is a good use case as I want to create a very simple-to-use system for non-python experts to safely wrap their CLI programs in a caching architecture... that's why I lament the inability to not use the more streamlined 'with'

Re: Listing children processes

2012-02-28 Thread Mark Lawrence
On 29/02/2012 00:16, Steven D'Aprano wrote: On Tue, 28 Feb 2012 23:41:16 +, Mark Lawrence wrote: I've been told of by the BDFL for stating that people should not top post on any Python mailing list/news group. He's the BDFL of Python, not of mailing list etiquette. Incorrect, I was

python scripts solution for euler projects

2012-02-28 Thread scripts examples
Got a web site setup for solving euler problems in python, perl, ruby and javascript. Feel free to give me any feedback, thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: python scripts solution for euler projects

2012-02-28 Thread Rodrick Brown
On Tue, Feb 28, 2012 at 10:59 PM, scripts examples example.scri...@gmail.com wrote: Got a web site setup for solving euler problems in python, perl, ruby and javascript. Feel free to give me any feedback, thanks. -- http://mail.python.org/mailman/listinfo/python-list --

Re: Error importing __init__ declared variable from another package

2012-02-28 Thread Jason Veldicott
Hi, I have a simple configuration of modules as beneath, but an import error is reported: /engine (__init__ is empty here) engine.py /sim __init__.py The module engine.py imports a variable instantiated in sim.__init__ as follows: from sim import

Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-02-28 Thread John Salerno
The book I'm reading about using Tkinter only does this when creating the top-level window: app = Application() app.mainloop() and of course the Application class has subclassed the tkinter.Frame class. However, in the Python documentation, I see this: root = Tk() app =

Re: Listing children processes

2012-02-28 Thread Ben Finney
Mark Lawrence breamore...@yahoo.co.uk writes: On 29/02/2012 00:16, Steven D'Aprano wrote: On Tue, 28 Feb 2012 23:41:16 +, Mark Lawrence wrote: I've been told of by the BDFL for stating that people should not top post on any Python mailing list/news group. He's the BDFL of Python,

[no subject]

2012-02-28 Thread Brendon Joyce
-- http://mail.python.org/mailman/listinfo/python-list

Pickle handling dictionary

2012-02-28 Thread Smiley 4321
I was successful in testing pickle with multiple objects both READ WRITE. I did WRITE as - --- #!/usr/bin/python import pickle class apple_Class(object): def __init__(self, **kwds): self.__dict__.update(kwds) myInst = apple_Class() myInst.FirstString = Apple myInst.SecondString =

[issue12905] multiple errors in test_socket on OpenBSD

2012-02-28 Thread Charles-François Natali
Changes by Charles-François Natali neolo...@free.fr: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12905 ___ ___

[issue14147] print r\ cause SyntaxError

2012-02-28 Thread lilei
New submission from lilei v...@163.com: $ python Python 2.7.1 (r271:86832, Apr 16 2011, 23:27:12) [GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2 Type help, copyright, credits or license for more information. print r'\' File stdin, line 1 print r'\' ^ SyntaxError: EOL while

[issue14147] print r\ cause SyntaxError

2012-02-28 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: See http://docs.python.org/faq/design.html#why-can-t-raw-strings-r-strings-end-with-a-backslash -- nosy: +ezio.melotti resolution: - invalid stage: - committed/rejected status: open - closed

[issue13876] Sporadic failure in test_socket

2012-02-28 Thread Nadeem Vawda
Nadeem Vawda nadeem.va...@gmail.com added the comment: The same failure has appeared on the Debian bigmem buildbot: http://www.python.org/dev/buildbot/all/builders/AMD64%20debian%20bigmem%203.x/builds/152/steps/test/logs/stdio -- versions: +Python 3.3

[issue14145] string.rfind() returns AttributeError: 'list' object has no attribute 'rfind'

2012-02-28 Thread Eric V. Smith
Eric V. Smith e...@trueblade.com added the comment: I can't reproduce this. Can you please post the entire traceback? It would be preferable if you could also show the exact code that's causing the problem, typed from a python command prompt (see my example below). I can reproduce the error

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Ethan Furman
Ethan Furman et...@stoneleaf.us added the comment: Changed TestTraceback.test_traceback_verbiage to use test.support and test.script_helper (much simpler now, thanks Antoine!). It is still in test_raise, however. I do not understand why we would put it in test_cmd_line_script -- it seems to

[issue8170] Wrong Paths for distutils build --plat-name=win-amd64

2012-02-28 Thread Robin Becker
Robin Becker rgbec...@users.sourceforge.net added the comment: Some context. ReportLab windows exe installers for pythons 2.x x=4-7 are built on a single 32bit machine with 32bit pythons using a code that looks like this set FT_LIB=c:\devel\libs_x86\freetype.lib \python2x\python setup.py

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: It's about separating out the testing of the command line executable (i.e. test_cmd_line and test_cmd_line_script) from that of the interpreter's internal behaviour. test_raise is about making sure the raise statement works correctly - the

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Ethan Furman
Ethan Furman et...@stoneleaf.us added the comment: Is there a better place, then, than test_cmd_line_script? The entire purpose of PEP 409 is to allow the suppression of non-relevant information in the exception traceback. As such I would expect every Python interpreter to adhere to it.

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Ethan Furman
Ethan Furman et...@stoneleaf.us added the comment: I guess the crux of the issue for me is that I'm trying to test interpreter output, and the fact that I am using a command-line script to do so is an implementation detail. -- ___ Python tracker

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: test_cmd_line and test_cmd_line_script are both about testing the behaviour of the interpreter when run from the command line. Since this test *is* a behavioural test for the interpreter when invoked as an application, it should be in one of

[issue8170] Wrong Paths for distutils build --plat-name=win-amd64

2012-02-28 Thread Mark Hammond
Mark Hammond skippy.hamm...@gmail.com added the comment: Can't you just install a 64bit Python in a different directory and use that executable to build the 64bit installer? It seems less error prone and should work without manually copying stuff or changing any code. --

[issue14148] Option to kill stuck workers in a multiprocessing pool

2012-02-28 Thread Paul Moore
New submission from Paul Moore p.f.mo...@gmail.com: I have an application which fires off a number of database connections via a multiprocessing pool. Unfortunately, the database software occasionally gets stuck and a connection request hangs indefinitely. This locks up the whole process

[issue14149] Argparse usage model requires argument names to be python identifiers

2012-02-28 Thread Joseph Birr-Pixton
New submission from Joseph Birr-Pixton jpix...@gmail.com: Say I have an argument with the name 'foo-bar'. Argparse accepts and parses arguments, but Namespace does not allow me to access the value. Yes, I can use getattr or Namespace.__dict__. But that's ugly. Yes, I can change the name of

[issue13903] New shared-keys dictionary implementation

2012-02-28 Thread Mark Shannon
Changes by Mark Shannon m...@hotpy.org: Added file: http://bugs.python.org/file24670/49b7e7e4a27c.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13903 ___

[issue14150] AIX, crash loading shared module into another process than python like operator.so results in 0509-130

2012-02-28 Thread Jan Stürtz
New submission from Jan Stürtz stue...@googlemail.com: AIX 5.2.0.0 with gcc 4.3.0: Compiling a shared python: with: ./configure --enable-shared --with-gcc --disable-ipv6 --with-system-ffi make; make install results in a working build. But when I build mod_wsgi into apache with this python and

[issue14150] AIX, crash loading shared module into another process than python like operator.so results in 0509-130

2012-02-28 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +sable ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14150 ___ ___ Python-bugs-list mailing

[issue14151] multiprocessing.connection.Listener fails with invalid address

2012-02-28 Thread Popa Claudiu
New submission from Popa Claudiu pcmantic...@gmail.com: In multiprocessing.connection, when using a Windows named pipe on a Unix platform, the following error will occur. This should not happen, the format of the address should be validated somehow before. The following error will occur

[issue10115] Support accept4() for atomic setting of flags at socket creation

2012-02-28 Thread Matt Joiner
Matt Joiner anacro...@gmail.com added the comment: Can we get this exposed as an os.accept4, and an optional flags parameter to socket.socket.accept? -- nosy: +anacrolix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10115

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Ethan Furman
Ethan Furman et...@stoneleaf.us added the comment: Moved to test_cmd_line_script. -- Added file: http://bugs.python.org/file24672/raise_from_none_test_cleanup.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14136

[issue14080] Sporadic test_imp failure

2012-02-28 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: Then how do you explain the failure being nothing more than prepending . compared to an absolute file path? Anyway, the test passes under importlib with ``./python.exe -m importlib.test.regrtest test_imp``, so it requires some special setup to

[issue14152] arraymodule: structmember.h dependency

2012-02-28 Thread Stefan Krah
New submission from Stefan Krah stefan-use...@bytereef.org: The arraymodule depends on structmember.h. Patch attached. -- components: Build files: arraymodule_deps.diff keywords: patch messages: 154556 nosy: skrah priority: normal severity: normal stage: patch review status: open title:

[issue14153] Expose os.device_encoding() at the C level

2012-02-28 Thread Brett Cannon
New submission from Brett Cannon br...@python.org: The _io module imports the os module purely for the use of os.device_encoding(). That function, though, is defined by posix and thus is already available to C code. To avoid this import dependency it would be better to simply expose the

[issue14136] Simplify PEP 409 command line test and move it to test_cmd_line_script

2012-02-28 Thread Ethan Furman
Ethan Furman et...@stoneleaf.us added the comment: Nick, Thank you for your thorough answers. I'm not trying to be difficult, just trying to learn and understand. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14136

[issue13405] Add DTrace probes

2012-02-28 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: MacOS 10.6 was released in August 2009. The code should compile there flawless with a couple of trivial changes, as proved by Marc. Supporting compilation in MacOS 10.5 is doable but more difficult. Since this is an optional feature, not

[issue13405] Add DTrace probes

2012-02-28 Thread Wilfredo Sanchez
Wilfredo Sanchez wsanc...@wsanchez.net added the comment: Given that the current Mac OS is 10.7, and 10.8 was just announced, it seems reasonable to limit support to 10.6, if going back any further is more than a little bit of additional work. IIRC, 10.6 is also the last release to support

[issue13405] Add DTrace probes

2012-02-28 Thread Philip Jenvey
Philip Jenvey pjen...@underboss.org added the comment: Actually 10.5 was the last PowerPC release -- nosy: +pjenvey ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___

[issue12151] test_logging fails sometimes

2012-02-28 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset ce0b9b1328d4 by Vinay Sajip in branch 'default': Added additional diagnostics to help with #12151. http://hg.python.org/cpython/rev/ce0b9b1328d4 -- ___ Python tracker

[issue13405] Add DTrace probes

2012-02-28 Thread Marc Abramowitz
Marc Abramowitz msabr...@gmail.com added the comment: Limiting to 10.6 and above seems entirely reasonable to me. I am one of the few folks that I know who is still on 10.6. Most of my friends are on 10.7. Since OS X is primarily a desktop OS, I think people tend to upgrade more quickly

[issue13405] Add DTrace probes

2012-02-28 Thread Marc Abramowitz
Marc Abramowitz msabr...@gmail.com added the comment: I wanted to post an update on FreeBSD 9.0, which Jesús and I worked on a bit yesterday. Maybe Jordan will chime in here with an answer to my FreeBSD problems. :-) With a little bit of Makefile hackery (make it skip building the phelper

[issue14152] setup.py: Python header file dependencies

2012-02-28 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: There is a comment in setup.py that suggests that *all* Python headers should be added to the dependencies (?): # Python header files headers = [sysconfig.get_config_h_filename()] headers +=

  1   2   >