On Thu, 31 Dec 2009 20:47:49 -0800, Peng Yu wrote:
I observe that python library primarily use exception for error handling
rather than use error code.
In the article API Design Matters by Michi Henning
Communications of the ACM
Vol. 52 No. 5, Pages 46-56
10.1145/1506409.1506424
On Fri, Jan 1, 2010 at 2:47 AM, Victor Subervi victorsube...@gmail.comwrote:
On Thu, Dec 31, 2009 at 3:46 PM, MRAB pyt...@mrabarnett.plus.com wrote:
Victor Subervi wrote:
On Thu, Dec 31, 2009 at 3:01 PM, MRAB pyt...@mrabarnett.plus.commailto:
pyt...@mrabarnett.plus.com wrote:
Victor
In article mailman.300.1262323578.28905.python-l...@python.org,
Benjamin Kaplan benjamin.kap...@case.edu wrote:
In Python, throwing exceptions for expected outcomes is considered
very bad form [...]
Who says that? I certainly don't.
--
Aahz (a...@pythoncraft.com) *
Peng Yu wrote:
I observe that python library primarily use exception for error
handling rather than use error code.
[...]
It says Another popular design flaw—namely, throwing exceptions for
expected outcomes—also causes inefficiencies because catching and
handling exceptions is almost always
On Jan 1, 12:43 am, a...@pythoncraft.com (Aahz) wrote:
In article mailman.300.1262323578.28905.python-l...@python.org,
Benjamin Kaplan benjamin.kap...@case.edu wrote:
In Python, throwing exceptions for expected outcomes is considered
very bad form [...]
Who says that? I certainly don't.
On Dec 31 2009, 2:06 pm, Steve Howell showel...@yahoo.com wrote:
FYI:
http://twitter.com/gvanrossum
Python is a truly awesome programming language. Not only is Guido a
genius language designer, but he is also a great project leader. What
an accomplishment. Congratulations to everybody
2009/12/31 Hari h...@pillai.co.uk:
Hi
I am using pywinauto to automate an custom program to startup and load
process , execute etc. But cannot determine menuselect. Is there a way or
tool which can run against the exe to show the menu, dialog box, list box
which are contained within it.
On Fri, 2010-01-01 at 03:25 -0800, J Peyret wrote:
On Dec 31 2009, 2:06 pm, Steve Howell showel...@yahoo.com wrote:
FYI:
http://twitter.com/gvanrossum
Python is a truly awesome programming language. Not only is Guido a
genius language designer, but he is also a great project leader.
On Dec 29 2009, 6:25 am, griwes griwes.m...@gmail.com wrote:
Hello, I am going to write an application in C++, application which
should be easy to extend by scripts. I chose python for script
language in this application. I'd like to have own API for python. And
here the question arises: how
On 1/1/2010 3:13 AM, davidj411 wrote:
I am not sure why this behavior is this way.
at beginning of script, i want to create a bunch of empty lists and
use each one for its own purpose.
however, updating one list seems to update the others.
a = b = c = []
a.append('1')
a.append('1')
On 1 Jan., 02:47, Steven D'Aprano st...@remove-this-
cybersource.com.au wrote:
On Thu, 31 Dec 2009 11:34:39 -0800, Tom Machinski wrote:
On Wed, Dec 30, 2009 at 4:01 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
On Wed, 30 Dec 2009 15:18:11 -0800, Tom Machinski wrote:
Hi;
I'd like to import urllib2 in windows python 3.1.1, but I'm not able to
do it.
So, I researched the library directory; the result is following:
2009/06/07 19:1161,749 unittest.py
2010/01/01 22:18DIR urllib
2007/12/06 09:48 6,318 uu.py
Hidekazu IWAKI iw...@iwakihidekazu.net wrote:
Hi;
I'd like to import urllib2 in windows python 3.1.1, but I'm not able to
do it.
Python 3 doesn't have a urllib2 module; use the urllib package instead.
See http://www.python.org/dev/peps/pep-3108/#urllib-package
--
On Fri, 01 Jan 2010 11:34:19 +0100 Martin v. Loewis
mar...@v.loewis.de wrote:
Your observation is not wrong, but, as Benjamin already explained,
you are misinterpreting Michi Henning's statement. He doesn't condemn
exception handling per se, but only for the handling of *expected*
outcomes.
Python 3 doesn't have a urllib2 module; use the urllib package instead.
Thank you for your answer and the link.
Oh, sorry. It was one of the changes from .2.x to 3.x. I didn't know.
There are really important and a lot of changes.
Thank you!
On Fri, Jan 1, 2010 at 10:57 PM, Duncan Booth
On Fri, 01 Jan 2010 02:43:21 -0800, Jonathan Gardner wrote:
On Jan 1, 12:43 am, a...@pythoncraft.com (Aahz) wrote:
In article mailman.300.1262323578.28905.python-l...@python.org,
Benjamin Kaplan benjamin.kap...@case.edu wrote:
In Python, throwing exceptions for expected outcomes is
On 1/2/2010 12:46 AM, Hidekazu IWAKI wrote:
Hi;
I'd like to import urllib2 in windows python 3.1.1, but I'm not able to
do it.
So, I researched the library directory; the result is following:
.
.
2009/06/07 19:1161,749 unittest.py
2010/01/01 22:18DIR urllib
On Fri, 01 Jan 2010 05:19:02 -0800, Wolfram Hinderer wrote:
On 1 Jan., 02:47, Steven D'Aprano st...@remove-this-
cybersource.com.au wrote:
On Thu, 31 Dec 2009 11:34:39 -0800, Tom Machinski wrote:
[...]
As for what's wrong with the if not any solution, Benjamin Kaplan's
post hits the nail
On Fri, 01 Jan 2010 00:26:09 -0500, Benjamin Kaplan wrote:
On Thu, Dec 31, 2009 at 11:47 PM, Peng Yu pengyu...@gmail.com wrote:
I observe that python library primarily use exception for error
handling rather than use error code.
In the article API Design Matters by Michi Henning
On Dec 31 2009, 4:30 pm, Steven D'Aprano st...@remove-this-
cybersource.com.au wrote:
... 1/0
... except ZeroDivisionError, e:
... e.args = e.args + ('fe', 'fi', 'fo', 'fum')
... raise
When I added print e.args it showed the old args. Maybe I was trying
too hard - this is why I
On Dec 31 2009, 4:30 pm, Steven D'Aprano st...@remove-this-
cybersource.com.au wrote:
For the record you can get the exception type from type(e):
raise type(e)(whatever you want)
but that creates a new exception, not re-raising the old one.
Except if a type constructs with some other number
On 1/1/2010 3:47 PM, Peng Yu wrote:
I observe that python library primarily use exception for error
handling rather than use error code.
In the article API Design Matters by Michi Henning
Communications of the ACM
Vol. 52 No. 5, Pages 46-56
10.1145/1506409.1506424
The gettext module uses the convention of defining a function named
_ that maps text into its translation.
This conflicts with the automatic interactive interpreter assignment
of expressions to a variable with that same name.
While if you are careful, you can avoid that assignment while
On Fri, Jan 1, 2010 at 9:49 AM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
Exceptions are *exceptional*, not errors or unexpected. They are
exceptional because they aren't the normal case, but that doesn't mean
they are surprising or unexpected. Are you surprised that your for
Steven D'Aprano wrote:
On Fri, 01 Jan 2010 02:43:21 -0800, Jonathan Gardner wrote:
On Jan 1, 12:43 am, a...@pythoncraft.com (Aahz) wrote:
In article mailman.300.1262323578.28905.python-l...@python.org,
Benjamin Kaplan benjamin.kap...@case.edu wrote:
In Python, throwing exceptions for
On Fri, 01 Jan 2010 11:02:28 -0500, Benjamin Kaplan wrote:
I was trying to point out that in
Python, you don't test errors for your typical conditions, but for ones
that you know still exist but don't plan on occurring often.
I'm sorry, but that makes no sense to me at all. I don't understand
Hi;
I'm trying to avoid the mortal sin of blank excepts. I intentionally threw
this error:
Traceback (most recent call last):
File /var/www/html/angrynates.com/cart/createAssociations2.py, line 137,
in ?
createAssociations2()
File /var/www/html/angrynates.com/cart/createAssociations2.py,
J Peyret wrote:
On Dec 31 2009, 2:06 pm, Steve Howell showel...@yahoo.com wrote:
FYI:
http://twitter.com/gvanrossum
Python is a truly awesome programming language. Not only is Guido a
genius language designer, but he is also a great project leader. What
an accomplishment. Congratulations
Victor Subervi wrote:
However, ProgrammingError is not an error. How do I discover the real
error, so I can write the appropriate except statement?
You're not making any sense. How did you determine that ProgrammingError
is not an error or that it's not the real error? Show us the code you
ran,
Victor Subervi wrote:
Hi;
I'm trying to avoid the mortal sin of blank excepts. I intentionally
threw this error:
Traceback (most recent call last):
File /var/www/html/angrynates.com/cart/createAssociations2.py
http://angrynates.com/cart/createAssociations2.py, line 137, in ?
JKPeck wrote:
The gettext module uses the convention of defining a function named
_ that maps text into its translation.
This conflicts with the automatic interactive interpreter assignment
of expressions to a variable with that same name.
While if you are careful, you can avoid that
You do understand that exceptions aren't just for errors? They are raised
under specific circumstances. Whether that circumstance is an error or
not is entirely up to the caller.
I think that's a fairly narrow definition of the word error, and
probably also the source of confusion in this
On Fri, Jan 1, 2010 at 12:10 PM, MRAB pyt...@mrabarnett.plus.com wrote:
Victor Subervi wrote:
Hi;
I'm trying to avoid the mortal sin of blank excepts. I intentionally threw
this error:
Traceback (most recent call last):
File /var/www/html/angrynates.com/cart/createAssociations2.py
On Jan 1, 9:03 am, MRAB pyt...@mrabarnett.plus.com wrote:
J Peyret wrote:
On Dec 31 2009, 2:06 pm, Steve Howell showel...@yahoo.com wrote:
FYI:
http://twitter.com/gvanrossum
Python is a truly awesome programming language. Not only is Guido a
genius language designer, but he is also a
On Jan 1, 10:06 am, Peter Otten __pete...@web.de wrote:
JKPeck wrote:
The gettext module uses the convention of defining a function named
_ that maps text into its translation.
This conflicts with the automatic interactive interpreter assignment
of expressions to a variable with that same
On Fri, Jan 1, 2010 at 1:32 PM, Victor Subervi victorsube...@gmail.com wrote:
On Fri, Jan 1, 2010 at 12:10 PM, MRAB pyt...@mrabarnett.plus.com wrote:
Victor Subervi wrote:
Hi;
I'm trying to avoid the mortal sin of blank excepts. I intentionally
threw this error:
Traceback (most recent
Benjamin Kaplan wrote:
On Fri, Jan 1, 2010 at 1:32 PM, Victor Subervi victorsube...@gmail.com wrote:
On Fri, Jan 1, 2010 at 12:10 PM, MRAB pyt...@mrabarnett.plus.com wrote:
Victor Subervi wrote:
Hi;
I'm trying to avoid the mortal sin of blank excepts. I intentionally
threw this error:
Waldemar,
Thank your for sharing your technique - works great with 32-bit Python
2.6.4.
Has anyone tried this with a 64-bit version of Python?
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
I'm looking for the best practice way for a multi-threaded python web
server application to read/write to a shared file or a SQLite database.
What do I need to do (if anything) to make sure my writes to a regular
file on disk or to a SQLite database are atomic in nature when multiple
clients post
I put together a page about significant whitespace (and the lack thereof).
You're invited to check it out:
http://stromberg.dnsalias.org/~dstromberg/significant-whitespace.html
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Jan 1, 2010 at 2:02 PM, Dan Stromberg drsali...@gmail.com wrote:
I put together a page about significant whitespace (and the lack thereof).
You're invited to check it out:
http://stromberg.dnsalias.org/~dstromberg/significant-whitespace.html
For those of us who weren't around during
pyt...@bdurham.com schrieb:
I'm looking for the best practice way for a multi-threaded python web
server application to read/write to a shared file or a SQLite database.
What do I need to do (if anything) to make sure my writes to a regular
file on disk or to a SQLite database are atomic in
On Jan 1, 6:04 am, Krishnakant hackin...@gmail.com wrote:
On Fri, 2010-01-01 at 03:25 -0800, J Peyret wrote:
On Dec 31 2009, 2:06 pm, Steve Howell showel...@yahoo.com wrote:
FYI:
http://twitter.com/gvanrossum
Python is a truly awesome programming language. Not only is Guido a
Howdy,
A script running as a regular user sometimes wants
to run sudo commands.
It gets the password with getpass.
pw = getpass.getpass()
I've fiddled a bunch with stuff like
proc = subprocess.Popen('sudo touch /etc/foo'.split(), stdin=subprocess.PIPE)
proc.communicate(input=pw)
getting
Kent Tenney schrieb:
Howdy,
A script running as a regular user sometimes wants
to run sudo commands.
It gets the password with getpass.
pw = getpass.getpass()
I've fiddled a bunch with stuff like
proc = subprocess.Popen('sudo touch /etc/foo'.split(), stdin=subprocess.PIPE)
In article mailman.319.1262384371.28905.python-l...@python.org,
Chris Rebert c...@rebertia.com wrote:
On Fri, Jan 1, 2010 at 2:02 PM, Dan Stromberg drsali...@gmail.com wrote:
I put together a page about significant whitespace (and the lack thereof).
You're invited to check it out:
the method involves editing python26.dll in order to remove
dependency references and then dropping msvcr90.dll in the same
directory as the py2exe produced executable.
Clever idea Waldemar, thanks for that, but for the moment, using the
dll as a win32 assembly (ie. with a manifest file, as
On Fri, 01 Jan 2010 14:19:28 -0800, Chris Rebert wrote:
For those of us who weren't around during the heyday of FORTRAN, can
anyone describe this apparently much-reviled significant whitespace
feature that continues to make some programmers unjustly fearful about
Python's use of indentation?
On Thu, Dec 31, 2009 at 11:24 PM, Chris Rebert c...@rebertia.com wrote:
On Thu, Dec 31, 2009 at 8:47 PM, Peng Yu pengyu...@gmail.com wrote:
I observe that python library primarily use exception for error
handling rather than use error code.
In the article API Design Matters by Michi Henning
I suspect that if one installs v2.4 and 2.5, or any two versions, that
one will dominate, or there will be a conflict. I suppose it would not
be possible to choose which one should be used. Comments?
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 2, 11:37 am, W. eWatson wolftra...@invalid.com wrote:
I suspect that if one installs v2.4 and 2.5, or any two versions, that
one will dominate, or there will be a conflict. I suppose it would not
be possible to choose which one should be used. Comments?
I suspect that you're not the
The convention (more used among Unix variants but I guess the same
thing applies to Windows if you're setting the system path) is that
running python from the command line will give you the most recently
installed one. If you want to specify a version, it would be
python24 or python25. Each
On Fri, Jan 1, 2010 at 8:37 PM, W. eWatson wolftra...@invalid.com wrote:
I suspect that if one installs v2.4 and 2.5, or any two versions, that one
will dominate, or there will be a conflict. I suppose it would not be
possible to choose which one should be used. Comments?
--
Dan Stromberg wrote:
I put together a page about significant whitespace (and the lack thereof).
You're invited to check it out:
http://stromberg.dnsalias.org/~dstromberg/significant-whitespace.html
You might also want to mention that programmers tend to indent anyway
for clarity.
--
In article
3db95947-1e35-4bd1-bd4c-37df646f9...@v25g2000yqk.googlegroups.com,
John Machin sjmac...@lexicon.net wrote:
On Jan 2, 10:29 am, Roy Smith r...@panix.com wrote:
To address your question more directly, here's a couple of ways Fortran
treated whitespace which would surprise the
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Diez B. Roggisch wrote:
AFAIK, sqlite ensures process-serialization via locking, and threads
synchronize themselves as well.
SQLite versions prior to 3.5 did not support using the same connection or
cursors in different threads. (You needed to
On Saturday 02 January 2010 00:02:36 Dan Stromberg wrote:
I put together a page about significant whitespace (and the lack thereof).
The only thing about Python's style that worries me is that it can't be
compressed like javascript can*, and perhaps that will prevent it becoming a
browser-side
On Fri, Jan 1, 2010 at 9:56 PM, Donn donn.in...@gmail.com wrote:
On Saturday 02 January 2010 00:02:36 Dan Stromberg wrote:
I put together a page about significant whitespace (and the lack thereof).
The only thing about Python's style that worries me is that it can't be
compressed like
In article 7p2juvfu8...@mid.individual.net,
Gregory Ewing greg.ew...@canterbury.ac.nz wrote:
MRAB wrote:
In simple cases you might be replacing with the same string every time,
but other cases you might want the replacement to contain substrings
captured by the regex.
But you can give it a
In article 4b3dcfab.3030...@v.loewis.de,
Martin v. Loewis mar...@v.loewis.de wrote:
Notice that in cases where the failure may be expected, Python
also offers variants that avoid the exception:
- if you look into a dictionary, expecting that a key may not
be there, a regular access, d[k], may
On Dec 31 2009, 5:13 pm, davidj411 davidj...@gmail.com wrote:
I am not sure why this behavior is this way.
at beginning of script, i want to create a bunch of empty lists and
use each one for its own purpose.
however, updating one list seems to update the others.
a = b = c = []
On 1/1/2010 8:57 PM, Benjamin Kaplan wrote:
As far as Windows file associations go, I suppose the most recent
install would dominate though you could always reset the associations
yourself.
The Windows installer asks whether one wants the about-to-be-installed
version to capture the
New submission from Arfrever Frehtes Taifersar Arahesis
arfrever@gmail.com:
distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option()
currently only recognizes gcc or gcc-${version (e.g. gcc-4.4.2),
but it doesn't recognize ${configuration_name}-gcc (e.g. x86_64-pc-
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:
This bug tracker removes parts of splitted, long lines when the
previous line was ending with '-' :( .
There should be:
but it doesn't recognize ${configuration_name}-gcc
(e.g. x86_64-pc-linux-gnu-gcc) or
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +lemburg
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7615
___
___
Python-bugs-list mailing
Benjamin Peterson benja...@python.org added the comment:
Fixed in r77212.
--
nosy: +benjamin.peterson
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6943
Benjamin Peterson benja...@python.org added the comment:
Applied in r77215.
--
nosy: +benjamin.peterson
resolution: - accepted
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6491
Mark Dickinson dicki...@gmail.com added the comment:
Applied to trunk in r77218. The DeprecationWarning for the 'L' format
needs to be merged to py3k.
--
versions: +Python 3.2
___
Python tracker rep...@bugs.python.org
New submission from Artem vazovsky@gmail.com:
In optparse documentation, in the end of first chapter there is an
example which shows how optparse can print usage summary for user. In
the last row of this example text color is accidentally changed from
black to blue. Most probably the source
Mark Dickinson dicki...@gmail.com added the comment:
Merged relevant bits to py3k in r77220.
--
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
New submission from djc dirk...@ochtman.nl:
imaplib still calls os.popen2(), which has been deprecated in 2.6. It
should probably use subprocess instead, even in 2.6, IMO.
See http://bugs.gentoo.org/show_bug.cgi?id=282859
--
components: Library (Lib)
messages: 97121
nosy: djc
severity:
Florent Xicluna la...@yahoo.fr added the comment:
It fails if the test is run in background, and there's another process
in foreground.
Example 1:
~ $ (./python Lib/test/regrtest.py test_ioctl ) tail -f /dev/null
test_ioctl
test test_ioctl failed -- multiple errors occurred; run in verbose
Changes by Florent Xicluna la...@yahoo.fr:
--
title: test_ioctl fails when run in background - test_ioctl may fail when run
in background
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7564
Nick Coghlan ncogh...@gmail.com added the comment:
Note that one of the reasons for the slightly wishy-washy phrasing in
the docs is to give other implementations a bit more freedom in the way
way they handle these error cases.
Agreed that the main reason is the one Antoine gave though - the
Benjamin Peterson benja...@python.org added the comment:
Fixed in r77222.
--
nosy: +benjamin.peterson
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7619
cadf chargodd...@gmail.com added the comment:
Here's a patch addressing the behavior described.
--
keywords: +patch
nosy: +cadf
Added file: http://bugs.python.org/file15718/shlex_posix.diff
___
Python tracker rep...@bugs.python.org
76 matches
Mail list logo