Re: [pygettext] --package-name and --package-version unknown

2023-05-08 Thread aapost
On 5/5/23 04:39, c.bu...@posteo.jp wrote: That being said, the git repo linked earlier has accepted commits to that file earlier this year. So read in to that what you will *shrugs* -- https://mail.python.org/mailman/listinfo/python-list

Re: [pygettext] --package-name and --package-version unknown

2023-05-08 Thread aapost
On 5/5/23 04:39, c.bu...@posteo.jp wrote: Thanks for the answer. Am 05.05.2023 03:24 schrieb aapost: pygettext is deprecated since xgettext supports python now, so using xgettext is recommended. If this is the official case then it should be mentioned in the python docs. The 3.11 docs still

Re: [pygettext] --package-name and --package-version unknown

2023-05-05 Thread c . buhtz
Thanks for the answer. Am 05.05.2023 03:24 schrieb aapost: pygettext is deprecated since xgettext supports python now, so using xgettext is recommended. If this is the official case then it should be mentioned in the python docs. The 3.11 docs still tell about pygettext and xgettext and don't

Re: [pygettext] --package-name and --package-version unknown

2023-05-04 Thread aapost
uot; and "--package-version" for this but they are unknown for "pygettext". pygettext is deprecated since xgettext supports python now, so using xgettext is recommended. That being said, pygettext does not support the options, but it could be modified pretty easily.

Re: [pygettext] --package-name and --package-version unknown

2023-05-04 Thread Alan Gauld
On 04/05/2023 22:38, c.bu...@posteo.jp wrote: > Hello, > > am I right to assume that "pygettext" is part of the official Python3 > "package"? So it is OK to aks here? > No it doesn't appear to be. It is not listed in the standard library. It is mentioned in the documentation for gettext which i

[pygettext] --package-name and --package-version unknown

2023-05-04 Thread c . buhtz
s create in each po-file. How can I set the "Project-Id-Version"? With "xgettext" I would use the arguments "--package-name" and "--package-version" for this but they are unknown for "pygettext". Kind Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: (unknown)

2018-03-27 Thread Grant Edwards
On 2018-03-27, kevon harris wrote: > Unable to pull up IDLE after downloading Python 3.6.4 Ah. What happens when you push down instead of pull up? > Sent from Mail for Windows 10 Sent from mutt for Gentoo Linux -- https://mail.python.org/mailman/listinfo/python-list

Re: (unknown)

2018-03-27 Thread Terry Reedy
On 3/27/2018 3:27 AM, kevon harris wrote: Unable to pull up IDLE after downloading Python 3.6.4 What did you download? How did you install after downloading? Can you run 3.6 after installing? How did you try to run IDLE? Can you use Command Prompt? -- Terry Jan Reedy -- https://mail.python.or

fun with cwrap: Unknown type kind 114

2018-01-08 Thread Etienne Robillard
.show( 'in type to c_ast:', 'kind:', t.kind, repr(t.get_declaration().spelling)) File "/usr/local/lib/python2.7/dist-packages/cwrap/frontends/clang/clang/cindex.py", line 1467, in kind return TypeKind.from_id(self._kind_id) File "/usr/local/lib/pytho

Re: ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol

2017-12-18 Thread Piyush Verma
Hi Chris, Yes it is HTTPS server. I was debugging and found some relevant data which may help to identify the problem. In my Mac OS, I have two version of openssl version installed. default was /usr/bin/openssl, which i changed to brew installed one. (virtenv) $ /usr/bin/openssl version OpenSSL 0.

Re: ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol

2017-12-17 Thread Chris Angelico
On Mon, Dec 18, 2017 at 6:28 AM, Piyush Verma <114piy...@gmail.com> wrote: > Yes Dieter, I see that it is connecting with 443 port number and service is > running. Is this related to python version or mac? Can you confirm that it really is an HTTPS server, not just an HTTP server that's running on

Re: ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol

2017-12-17 Thread dieter
Piyush Verma <114piy...@gmail.com> writes: > Yes Dieter, I see that it is connecting with 443 port number and service is > running. Is this related to python version or mac? It might be. Python does not perform the SSL handling itself but delegates it to an external SSL library ("OpenSSL" on a *

Re: ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol

2017-12-17 Thread Piyush Verma
uot;/System/Library/Frameworks/Python.framework/Versions/2.7/ > lib/python2.7/ssl.py", > > line 808, in do_handshake > > self._sslobj.do_handshake() > > ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590) > > Are you sure, you try to connect to an H

Re: ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol

2017-12-16 Thread dieter
k/Versions/2.7/lib/python2.7/ssl.py", > line 808, in do_handshake > self._sslobj.do_handshake() > ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590) Are you sure, you try to connect to an HTTPS port? The error message tells you that the "ssl" handshake

ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol

2017-12-15 Thread Piyush Verma
808, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590) Regards, ~Piyush Facebook <https://www.facebook.com/piyushkv1> Twitter <https://twitter.com/SocializePiyush> -- https://mail.python.org/mailman/listinfo/python-list

Re: 0 equals False, was Re: (unknown)

2016-03-23 Thread Terry Reedy
On 3/23/2016 4:51 AM, Peter Otten wrote: The pythonic solution is "don't do this". The == operator cannot discriminate between 0, 0.0, and False, and 0j and Fraction(0, 1) and Decimal(0) or 1, 1.0, and True and 1+0j, Fraction(1, 1) and Decimal(1) Sets and dicts are based both based on (tr

Re: 0 equals False, was Re: (unknown)

2016-03-23 Thread gst
Le mercredi 23 mars 2016 04:52:02 UTC-4, Peter Otten a écrit : > Nick Eubank wrote: > > > Hello All, > > > > > > Found an odd behavior I'd never known about today, not sure if it's a bug > > or known. Python 3.4.4 (anaconda). > > True, False, 0, 1 can all be used as dictionary keys. > > > > Bu

Re: 0 equals False, was Re: (unknown)

2016-03-23 Thread INADA Naoki
Tips: Since True == 1, sum() can count Trues. >>> def count_even(seq): ... return sum(i%2 == 0 for i in seq) >>> count_even(range(100)) 50 -- https://mail.python.org/mailman/listinfo/python-list

0 equals False, was Re: (unknown)

2016-03-23 Thread Peter Otten
Nick Eubank wrote: > Hello All, > > > Found an odd behavior I'd never known about today, not sure if it's a bug > or known. Python 3.4.4 (anaconda). This is a feature. Old versions of Python did not have True and False, so they were added in a compatible way. > True, False, 0, 1 can all be us

Re: (unknown)

2016-03-11 Thread Mark Lawrence
On 11/03/2016 11:10, Swetha Reddy wrote: Hi, i just downloaded the python software. when i search for it in my downloads, a folder called python 3.5.1 ( 32 bit ) Setup is seen. But when i try to open it, it has only three options : Modify, Repair and uninstall. there are no other files of python

Re: (unknown)

2016-02-13 Thread Oscar Benjamin
On 12 February 2016 at 21:39, Mark Lawrence wrote: > On 12/02/2016 20:16, Manas Soni wrote: >> >> >> I have downloaded python and when I click on it, it asks me to repair >> which I do, it then says successful however when I click on it again it >> won’t let me on it >> Sent from Mail for Windows

Re: (unknown)

2016-02-12 Thread Mark Lawrence
On 12/02/2016 20:16, Manas Soni wrote: I have downloaded python and when I click on it, it asks me to repair which I do, it then says successful however when I click on it again it won’t let me on it Sent from Mail for Windows 10 Please search the archives as this has been asked and answere

Re: (unknown)

2015-06-20 Thread Ned Deily
In article <6264c933-0ed4-4055-baad-01b322bb6dd4@Calculus-Fantasticus-2.local>, Scott wrote: > We've been using a simple container implementation of a mathematical relation > (https://simple.wikipedia.org/wiki/Relation_(mathematics)) (i.e. an > invertible M:M mapping) for some time. [...] > Be

Re: How to receive a data file of unknown length using a python socket?

2015-04-22 Thread sandyethadka
On Sunday, 19 July 2009 03:03:48 UTC+5:30, twgray wrote: > I am attempting to send a jpeg image file created on an embedded > device over a wifi socket to a Python client running on a Linux pc > (Ubuntu). All works well, except I don't know, on the pc client side, > what the file size is? The fo

Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host

2012-08-15 Thread nepaul
15/08/12 15:30:26, nepaul wrote: > > > >> The code: > > > >> import MySQLDB > > > >> strCmd = "user = 'root', passwd = '123456', db = 'test', host = > > >> 'localhost'" > > > >>

Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host

2012-08-15 Thread nepaul
7;root', passwd = '123456', db = 'test', host = > >> 'localhost'" > > >> > > >> > > >> > > >> _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host > >> 'user = 'root', > > >> pass

Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host

2012-08-15 Thread Alain Ketterlin
Hans Mulder writes: > On 15/08/12 15:30:26, nepaul wrote: >> The code: >> import MySQLDB >> strCmd = "user = 'root', passwd = '123456', db = 'test', host = 'localhost'" >> >> >> >> _mysql_excepti

Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host

2012-08-15 Thread Iuri
MySQLDB > > > > > strCmd = "user = 'root', passwd = '123456', db = 'test', host = > 'localhost'" > > > > > > > > > > _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host > '

Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host

2012-08-15 Thread Hans Mulder
On 15/08/12 15:30:26, nepaul wrote: > The code: > import MySQLDB > strCmd = "user = 'root', passwd = '123456', db = 'test', host = 'localhost'" > > > > _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server

Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host

2012-08-15 Thread nepaul
在 2012年8月15日星期三UTC+8下午10时23分24秒,Mark Lawrence写道: > On 15/08/2012 14:30, nepaul wrote: > > > The code: > > > import MySQLDB > > > strCmd = "user = 'root', passwd = '123456', db = 'test', host = 'localhost'" > >

Re: _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host

2012-08-15 Thread Mark Lawrence
On 15/08/2012 14:30, nepaul wrote: The code: import MySQLDB strCmd = "user = 'root', passwd = '123456', db = 'test', host = 'localhost'" _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host 'user = 'root'

_mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host

2012-08-15 Thread nepaul
The code: import MySQLDB strCmd = "user = 'root', passwd = '123456', db = 'test', host = 'localhost'" _mysql_exceptions.OperationalError: (2005, "Unknown MySQL server host 'user = 'root', passwd = '123456',

Re: Is there any way to decode String using unknown codec?

2012-06-28 Thread howmuchistoday
T 2012년 6월 28일 목요일 오전 11시 20분 28초 UTC+9, Benjamin Kaplan 님의 말: > On Wed, Jun 27, 2012 at 6:14 PM, wrote: > > Hi > > I'm a Korean and when I use modules like sys, os, &c, > > sometimes the interpreter show me broken strings like > > '\x13\xb3\x12\xc8'. > > It mustbe the Korean "alphabet" but I ca

Re: Is there any way to decode String using unknown codec?

2012-06-28 Thread Dieter Maurer
howmuchisto...@gmail.com writes: > I'm a Korean and when I use modules like sys, os, &c, > sometimes the interpreter show me broken strings like > '\x13\xb3\x12\xc8'. > It mustbe the Korean "alphabet" but I can't decode it to the rightway. > I tried to decode it using codecs like cp949,mbcs,utf-8

Re: Is there any way to decode String using unknown codec?

2012-06-28 Thread MRAB
On 28/06/2012 02:14, howmuchisto...@gmail.com wrote: Hi I'm a Korean and when I use modules like sys, os, &c, sometimes the interpreter show me broken strings like '\x13\xb3\x12\xc8'. It mustbe the Korean "alphabet" but I can't decode it to the rightway. I tried to decode it using codecs like cp9

Re: Is there any way to decode String using unknown codec?

2012-06-27 Thread Benjamin Kaplan
On Wed, Jun 27, 2012 at 6:14 PM, wrote: > Hi > I'm a Korean and when I use modules like sys, os, &c, > sometimes the interpreter show me broken strings like > '\x13\xb3\x12\xc8'. > It mustbe the Korean "alphabet" but I can't decode it to the rightway. > I tried to decode it using codecs like cp94

Is there any way to decode String using unknown codec?

2012-06-27 Thread howmuchistoday
Hi I'm a Korean and when I use modules like sys, os, &c, sometimes the interpreter show me broken strings like '\x13\xb3\x12\xc8'. It mustbe the Korean "alphabet" but I can't decode it to the rightway. I tried to decode it using codecs like cp949,mbcs,utf-8 but It failed. The only way I found is ev

Re: try - except. How to identify errors unknown in advance?

2011-11-16 Thread Dan Sommers
On Wed, 16 Nov 2011 17:57:27 +0100, Frederic Rentsch wrote: > I'd like to log MySQL errors. If I do: > > try: (command) > except MySQLdb.OperationalError, e: print e > > I may get something like: > > (1136, "Column count doesn't match value count at row 1") > > If I don't kno

Re: try - except. How to identify errors unknown in advance?

2011-11-16 Thread Terry Reedy
On 11/16/2011 11:57 AM, Frederic Rentsch wrote: If I don't know in advance which error to expect, but on the contrary want to find out which error occurred, I can catch any error by omitting the name: except: (handle) But now I don't have access to the error message 'e'. I'm sure there

Re: try - except. How to identify errors unknown in advance?

2011-11-16 Thread MRAB
On 16/11/2011 17:09, Chris Kaynor wrote: On Wed, Nov 16, 2011 at 8:57 AM, Frederic Rentsch wrote: Hi all, I'd like to log MySQL errors. If I do: try: (command) except MySQLdb.OperationalError, e: print e I may get something like: (1136, "Column count doesn't match

Re: try - except. How to identify errors unknown in advance?

2011-11-16 Thread Christian Heimes
Am 16.11.2011 19:39, schrieb Frederic Rentsch: >> py>import sys >> py>try: >> py> raise RuntimeError >> py> except: >> py> print sys.exc_info() >> py> >> (, RuntimeError(), > at 0x02371588>) > > Chris, Thanks very much! Great help! How about using the excellent logging framework instead o

Re: try - except. How to identify errors unknown in advance?

2011-11-16 Thread Frederic Rentsch
On Wed, 2011-11-16 at 09:09 -0800, Chris Kaynor wrote: > On Wed, Nov 16, 2011 at 8:57 AM, Frederic Rentsch > wrote: > > Hi all, > > > > > > I'd like to log MySQL errors. If I do: > > > >try: (command) > >except MySQLdb.OperationalError, e: print e > > > > I may get something like:

Re: try - except. How to identify errors unknown in advance?

2011-11-16 Thread Chris Kaynor
On Wed, Nov 16, 2011 at 8:57 AM, Frederic Rentsch wrote: > Hi all, > > > I'd like to log MySQL errors. If I do: > >        try: (command) >        except MySQLdb.OperationalError, e: print e > > I may get something like: > >        (1136, "Column count doesn't match value count at row 1") > > If I

try - except. How to identify errors unknown in advance?

2011-11-16 Thread Frederic Rentsch
Hi all, I'd like to log MySQL errors. If I do: try: (command) except MySQLdb.OperationalError, e: print e I may get something like: (1136, "Column count doesn't match value count at row 1") If I don't know in advance which error to expect, but on the contrary want to f

Re: try... except with unknown error types

2011-09-10 Thread Peter Otten
Chris Torek wrote: > >>> import socket > >>> isinstance(socket.error, IOError) > False Here you test if the socket.error *class* is an instance of IOError; this would print True if IOError were socket.error's metaclass. However: >>> isinstance(socket.error(), IOError) True or more directly: >

Re: try... except with unknown error types

2011-09-10 Thread Nobody
On Wed, 31 Aug 2011 21:01:34 +, Chris Torek wrote: > Still, it sure would be nice to have a static analysis > tool that could answer questions about potential exceptions. :-) ) That's an impossibility in a dynamic language. If you call f.read() where f was passed in as a parameter, the excep

Re: try... except with unknown error types

2011-09-09 Thread Stefan Krah
Chris Torek wrote: > (I have also never been sure whether something is going to raise > an IOError or an OSError for various OS-related read or write > operation failures -- such as exceeding a resource limit, for > instance -- so most places that do I/O operations on OS files, I > catch both. St

Re: try... except with unknown error types

2011-08-31 Thread John Nagle
On 8/21/2011 5:30 PM, Steven D'Aprano wrote: Chris Angelico wrote: A new and surprising mode of network failure would be indicated by a new subclass of IOError or EnvironmentError. /s/would/should/ I don't see why you expect this, when *existing* network-related failures aren't: import so

Re: try... except with unknown error types

2011-08-31 Thread Chris Torek
In article , Terry Reedy wrote: >I would expect that catching socket.error (or even IOError) should catch >all of those. > >"exception socket.error >A subclass of IOError ... Except that, as Steven D'Aprano almost noted elsethread, it isn't (a subclass of IOError -- the note was that it is not

Re: try... except with unknown error types

2011-08-23 Thread Paul Rubin
gene heskett writes: > OTOH, ChrisA, I have it on good authority that no program is ever finished, > until someone shoots the programmer. :) The way I heard it was "software is never finished until the last user is dead". -- http://mail.python.org/mailman/listinfo/python-list

Re: try... except with unknown error types

2011-08-23 Thread Chris Angelico
On Tue, Aug 23, 2011 at 9:43 AM, gene heskett wrote: > OTOH, ChrisA, I have it on good authority that no program is ever finished, > until someone shoots the programmer.  :) > Correct, although I've had projects that were killed by changes to requirements - such as my fantastic system for writing

Re: try... except with unknown error types

2011-08-23 Thread gene heskett
of new exceptions invented; > > > > Right, the number is finite, but the issue is that it's unknown. It's > > like never knowing whether you've fixed the last bug in a program. > > Yeah. Oh, I know when I've fixed the last bug in a program. It's th

Re: try... except with unknown error types

2011-08-23 Thread Steven D'Aprano
On Mon, 22 Aug 2011 04:26 am Paul Rubin wrote: > The Erlang approach is tempting. Don't catch the exception at all--just > let the process crash, and restart it. But that's a more heavyweight > operation in Python. You might be interested in this paper: http://usenix.org/events/hotos03/tech/fu

Re: try... except with unknown error types

2011-08-23 Thread Chris Angelico
On Tue, Aug 23, 2011 at 8:21 AM, Paul Rubin wrote: > Chris Angelico writes: >> Ehh, granted. Definitely a case of "should". But certainly, there >> won't be an infinite number of new exceptions invented; > > Right, the number is finite, but the issue is t

Re: try... except with unknown error types

2011-08-23 Thread Paul Rubin
Chris Angelico writes: > Ehh, granted. Definitely a case of "should". But certainly, there > won't be an infinite number of new exceptions invented; Right, the number is finite, but the issue is that it's unknown. It's like never knowing whether you've fixed

Re: try... except with unknown error types

2011-08-21 Thread Steven D'Aprano
On Mon, 22 Aug 2011 10:41 am Chris Angelico wrote: > On Mon, Aug 22, 2011 at 1:30 AM, Steven D'Aprano > wrote: >> /s/would/should/ >> >> I don't see why you expect this, when *existing* network-related failures >> aren't > > Ehh, granted. Definitely a case of "should". But certainly, there > won

Re: try... except with unknown error types

2011-08-21 Thread Roy Smith
In article <4e51a205$0$29974$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > http://www.codinghorror.com/blog/2011/04/working-with-the-chaos-monkey.html I *love* being the Chaos Monkey! A few jobs ago, I had already turned in my resignation and was a short-timer, counting down t

Re: try... except with unknown error types

2011-08-21 Thread Chris Angelico
On Mon, Aug 22, 2011 at 1:30 AM, Steven D'Aprano wrote: > /s/would/should/ > > I don't see why you expect this, when *existing* network-related failures > aren't Ehh, granted. Definitely a case of "should". But certainly, there won't be an infinite number of new exceptions invented; most of the r

Re: try... except with unknown error types

2011-08-21 Thread Steven D'Aprano
Chris Angelico wrote: > A new and surprising mode of network failure would be indicated by a > new subclass of IOError or EnvironmentError. /s/would/should/ I don't see why you expect this, when *existing* network-related failures aren't: >>> import socket >>> issubclass(socket.error, Environ

Re: try... except with unknown error types

2011-08-21 Thread Steven D'Aprano
Paul Rubin wrote: > Steven D'Aprano writes: >>> But there's no way to know what that minimum is. Python libraries throw >>> all sorts of exceptions that their documentation doesn't mention. >> >> Yes, you're absolutely correct. But it's also irrelevant. Most of those >> exceptions should not be

Re: try... except with unknown error types

2011-08-21 Thread Roy Smith
In article <7xty9ahb84@ruckus.brouhaha.com>, Paul Rubin wrote: > It's a retail application that would cause some business disruption and > a pissed off customer if the program went down. Also it's in an > embedded box on a customer site. It's not in Antarctica or anything > like that, but

Re: try... except with unknown error types

2011-08-21 Thread Terry Reedy
On 8/21/2011 2:26 PM, Paul Rubin wrote: Steven D'Aprano writes: But there's no way to know what that minimum is. Python libraries throw all sorts of exceptions that their documentation doesn't mention. Yes, you're absolutely correct. But it's also irrelevant. Most of those exceptions should

Re: try... except with unknown error types

2011-08-21 Thread Ethan Furman
Paul Rubin wrote: Steven D'Aprano writes: But there's no way to know what that minimum is. Python libraries throw all sorts of exceptions that their documentation doesn't mention. Yes, you're absolutely correct. But it's also irrelevant. Most of those exceptions should not be caught, even if

Re: try... except with unknown error types

2011-08-21 Thread Chris Angelico
On Sun, Aug 21, 2011 at 7:26 PM, Paul Rubin wrote: > I'm not sure what to do instead.  The exceptions I'm currently dealing > with happen when certain network operations go wrong (e.g. network or > remote host is down, connection fails, etc.)  The remedy in each case is > to catch the exception, l

Re: try... except with unknown error types

2011-08-21 Thread Paul Rubin
Steven D'Aprano writes: >> But there's no way to know what that minimum is. Python libraries throw >> all sorts of exceptions that their documentation doesn't mention. > > Yes, you're absolutely correct. But it's also irrelevant. Most of those > exceptions should not be caught, even if you know w

Re: try... except with unknown error types

2011-08-20 Thread John Nagle
On 8/19/2011 1:24 PM, John Gordon wrote: In<4e4ec405$0$29994$c3e8da3$54964...@news.astraweb.com> Steven D'Aprano writes: You can catch all exceptions by catching the base class Exception: Except that is nearly always poor advice, because it catches too much: it hides bugs in code, as well

Re: try... except with unknown error types

2011-08-20 Thread Steven D'Aprano
Paul Rubin wrote: > Steven D'Aprano writes: >>> You can catch all exceptions by catching the base class Exception: >> >> Except that is nearly always poor advice, because it catches too much: it >> hides bugs in code, as well as things which should be caught. >> You should always catch the absolu

Re: try... except with unknown error types

2011-08-20 Thread Paul Rubin
Steven D'Aprano writes: >> You can catch all exceptions by catching the base class Exception: > > Except that is nearly always poor advice, because it catches too much: it > hides bugs in code, as well as things which should be caught. > You should always catch the absolute minimum you need to cat

Re: try... except with unknown error types

2011-08-19 Thread Seebs
On 2011-08-19, Steven D'Aprano wrote: > Even if you don't think it's the ethical thing to do, consider that someday > you might be maintaining code written by the OP :) A common further conclusion people reach is "but then I will be able to get a job fixing it!" Trust me, this is NOT where you w

Re: try... except with unknown error types

2011-08-19 Thread Stephen Hansen
On 8/19/11 12:09 PM, Yingjie Lin wrote: > try: > response = urlopen(urljoin(uri1, uri2)) > except urllib2.HTTPError: > print "URL does not exist!" > > Though "urllib2.HTTPError" is the error type reported by Python, Python > doesn't recognize it as an error type name. > I tried using

Re: try... except with unknown error types

2011-08-19 Thread Mel
xDog Walker wrote: > On Friday 2011 August 19 12:09, Yingjie Lin wrote: [ ... ] >> Does anyone know what error type I should put after the except statement? >> or even better: is there a way not to specify the error types? Thank you. > > You probably need to import urllib2 before you can use urlli

Re: try... except with unknown error types

2011-08-19 Thread Steven D'Aprano
John Gordon wrote: > In <4e4ec405$0$29994$c3e8da3$54964...@news.astraweb.com> Steven D'Aprano > writes: > >> > You can catch all exceptions by catching the base class Exception: > >> Except that is nearly always poor advice, because it catches too much: it >> hides bugs in code, as well as thin

Re: try... except with unknown error types

2011-08-19 Thread John Gordon
In <4e4ec405$0$29994$c3e8da3$54964...@news.astraweb.com> Steven D'Aprano writes: > > You can catch all exceptions by catching the base class Exception: > Except that is nearly always poor advice, because it catches too much: it > hides bugs in code, as well as things which should be caught. >

Re: try... except with unknown error types

2011-08-19 Thread Steven D'Aprano
John Gordon wrote: > In Yingjie Lin > writes: > >> try: >> response = urlopen(urljoin(uri1, uri2)) >> except urllib2.HTTPError: >> print "URL does not exist!" > >> Though "urllib2.HTTPError" is the error type reported by Python, Python >> doesn't recognize it as an error type name. I tried usi

Re: try... except with unknown error types

2011-08-19 Thread Yingjie Lin
Hi Zero, I see! This is very helpful. Thank you. - Yingjie On Aug 19, 2011, at 3:30 PM, Zero Piraeus wrote: > : > > On 19 August 2011 15:09, Yingjie Lin wrote: >> >> I have been using try...except statements in the situations where I can >> expect a certain type of errors might occur.

Re: try... except with unknown error types

2011-08-19 Thread Zero Piraeus
: On 19 August 2011 15:09, Yingjie Lin wrote: > > I have been using try...except statements in the situations where I can > expect a certain type of errors might occur. > But sometimes I don't exactly know the possible error types, or sometimes I > just can't "spell" the error types correctly.

Re: try... except with unknown error types

2011-08-19 Thread xDog Walker
On Friday 2011 August 19 12:09, Yingjie Lin wrote: > Hi Python users, > > I have been using try...except statements in the situations where I can > expect a certain type of errors might occur. But sometimes I don't exactly > know the possible error types, or sometimes I just can't "spell" the erro

Re: try... except with unknown error types

2011-08-19 Thread John Gordon
In Yingjie Lin writes: > try: > response = urlopen(urljoin(uri1, uri2)) > except urllib2.HTTPError: > print "URL does not exist!" > Though "urllib2.HTTPError" is the error type reported by Python, Python > doesn't recognize it as an error type name. I tried using "HTTPError" > alon

try... except with unknown error types

2011-08-19 Thread Yingjie Lin
Hi Python users, I have been using try...except statements in the situations where I can expect a certain type of errors might occur. But sometimes I don't exactly know the possible error types, or sometimes I just can't "spell" the error types correctly. For example, try: response

Re: Unknown function operation deciphering, exercise in readability by program reasoning

2010-12-05 Thread small Pox
On Dec 4, 11:37 pm, Madhu wrote: > * jvt <5e1f79ab-5432-4f18-b896-362b7406c...@i18g2000yqn.googlegroups.com> : > Wrote on Sat, 4 Dec 2010 19:34:53 -0800 (PST): > > | > | I think this is correct: > | > | > | (defun unknown-function (sym0) > |   (let (sym1 sym

Re: Unknown function operation deciphering, exercise in readability by program reasoning

2010-12-05 Thread small Pox
On Dec 5, 9:13 am, "rupertlssm...@googlemail.com" wrote: > On Dec 5, 3:34 am, jvt wrote: > > > I think this is correct: > > > (defun unknown-function (sym0) > >   (let (sym1 sym2) > >         (while (or sym2 sym0) > >        

Re: Unknown function operation deciphering, exercise in readability by program reasoning

2010-12-05 Thread rupertlssm...@googlemail.com
g a debugger or profiler > > > > @3@  Editing allowed to make simpler variables > > > Maybe if you had done that yourself before posting it then I would have > > tried to understand it.  As it is, no way. > > > > (defun unknown-function (nano-thermite-911-FBI-fat

Re: Unknown function operation deciphering, exercise in readability by program reasoning

2010-12-04 Thread jvt
ad done that yourself before posting it then I would have > tried to understand it.  As it is, no way. > > > > > > > > > > > (defun unknown-function (nano-thermite-911-FBI-fat-per-diem-bustards- > > kept-their-odious-mouth-shut-on-anthrax-and-911-lie) > &

Re: Unknown function operation deciphering, exercise in readability by program reasoning

2010-12-04 Thread Barb Knox
uot;desk checking" (a lost art from the oldene dayes)? > @2@ No profiling using a debugger or profiler > > @3@ Editing allowed to make simpler variables Maybe if you had done that yourself before posting it then I would have tried to understand it. As it is, no way. > (def

Unknown function operation deciphering, exercise in readability by program reasoning

2010-12-03 Thread small Pox
Rules : @1@ No execution of the function, only checking syntax @2@ No profiling using a debugger or profiler @3@ Editing allowed to make simpler variables (defun unknown-function (nano-thermite-911-FBI-fat-per-diem-bustards- kept-their-odious-mouth-shut-on-anthrax-and-911-lie) (let

Re: let optionparse.Optionparser ignore unknown command line switches.

2010-08-02 Thread Michele Simionato
On Aug 1, 1:08 pm, News123 wrote: > I wondered, whether there's a simple/standard way to let > the Optionparser just ignore unknown command line switches. > > thanks in advance for any ideas I will plug in my own work on plac: http://pypi.python.org/pypi/plac Your problem w

Re: let optionparse.Optionparser ignore unknown command line switches.

2010-08-02 Thread News123
ondered, whether there's a simple/standard way to let >>>>> the Optionparser just ignore unknown command line switches. >> >>>> In order to illustrate, what I try to achieve: >> >>>> import optparse >>>> parser = optparse.OptionParser()

Re: let optionparse.Optionparser ignore unknown command line switches.

2010-08-01 Thread Jon Clements
On 1 Aug, 16:43, News123 wrote: > On 08/01/2010 05:34 PM, Steven W. Orr wrote: > > > > > On 08/01/10 07:27, quoth News123: > >> On 08/01/2010 01:08 PM, News123 wrote: > >>> I wondered, whether there's a simple/standard way to let > >>> th

Re: let optionparse.Optionparser ignore unknown command line switches.

2010-08-01 Thread News123
On 08/01/2010 05:34 PM, Steven W. Orr wrote: > On 08/01/10 07:27, quoth News123: >> On 08/01/2010 01:08 PM, News123 wrote: >>> I wondered, whether there's a simple/standard way to let >>> the Optionparser just ignore unknown command line switches. >>> >

Re: let optionparse.Optionparser ignore unknown command line switches.

2010-08-01 Thread Steven W. Orr
On 08/01/10 07:27, quoth News123: > On 08/01/2010 01:08 PM, News123 wrote: >> I wondered, whether there's a simple/standard way to let >> the Optionparser just ignore unknown command line switches. >> > > In order to illustrate, what I try to achieve:

Re: let optionparse.Optionparser ignore unknown command line switches.

2010-08-01 Thread News123
On 08/01/2010 01:08 PM, News123 wrote: > I wondered, whether there's a simple/standard way to let > the Optionparser just ignore unknown command line switches. > In order to illustrate, what I try to achieve: import optparse parser = optparse.OptionParser() parser.add_optio

let optionparse.Optionparser ignore unknown command line switches.

2010-08-01 Thread News123
I wondered, whether there's a simple/standard way to let the Optionparser just ignore unknown command line switches. thanks in advance for any ideas -- http://mail.python.org/mailman/listinfo/python-list

Re: How to open and read an unknown extension file

2010-04-09 Thread varnikat t
And I am using python and GLADE for GUI On Fri, Apr 9, 2010 at 6:30 PM, varnikat t wrote: > Hey thanks a lot to all of youNow i understood the concept and can use > it the right way > > I have another doubt regarding using radio buttons > > I am using two radio buttons for user to se

Re: How to open and read an unknown extension file

2010-04-09 Thread varnikat t
Hey thanks a lot to all of youNow i understood the concept and can use it the right way I have another doubt regarding using radio buttons I am using two radio buttons for user to select either of the two options: Landscape Portrait When i run the program it shows both radio buttons

Re: How to open and read an unknown extension file

2010-04-08 Thread Tim Chase
On 04/08/2010 12:22 PM, varnikat t wrote: it gives me this error TypeError: coercing to Unicode: need string or buffer, list found Thanks for the help.it detects now using glob.glob("*.*.txt") Can u suggest how to open and read file this way? *if glob.glob("*.*.txt"): file=open(gl

Re: How to open and read an unknown extension file

2010-04-08 Thread Kushal Kumaran
On Thu, Apr 8, 2010 at 10:39 PM, varnikat t wrote: > Hey, > Thanks for the help.it detects now using glob.glob("*.*.txt") > Can u suggest how to open and read file this way? > > if glob.glob("*.*.txt"): >             file=open(glob.glob("*.*.txt")) >             self.text_view.get_buffer().set_tex

Re: How to open and read an unknown extension file

2010-04-08 Thread varnikat t
it gives me this error TypeError: coercing to Unicode: need string or buffer, list found On Thu, Apr 8, 2010 at 10:48 PM, varnikat t wrote: > > > > > Hey, > Thanks for the help.it detects now using glob.glob("*.*.txt") > Can u suggest how to open and read file this way? > > *if glob.glob("*.*.

How to open and read an unknown extension file

2010-04-08 Thread varnikat t
Hey, Thanks for the help.it detects now using glob.glob("*.*.txt") Can u suggest how to open and read file this way? *if glob.glob("*.*.txt"): file=open(glob.glob("*.*.txt")) self.text_view.get_buffer().set_text(file.read()) else: file=open(glob.glob("*

Re: How to open and read an unknown extension file

2010-04-08 Thread Steven Howe
On 04/08/2010 08:57 AM, Chris Colbert wrote: On Thu, Apr 8, 2010 at 11:42 AM, Kushal Kumaran wrote: On Thu, Apr 8, 2010 at 9:00 PM, varnikat t wrote: I am trying to do this if os.path.exists("*.*.txt"): file=open("*.*.txt") self.text_view.get_buffer().set_

Re: How to open and read an unknown extension file

2010-04-08 Thread Chris Colbert
On Thu, Apr 8, 2010 at 11:42 AM, Kushal Kumaran wrote: > On Thu, Apr 8, 2010 at 9:00 PM, varnikat t wrote: >> I am trying to do this >> if os.path.exists("*.*.txt"): >>             file=open("*.*.txt") >>             self.text_view.get_buffer().set_text(file.read()) >> else: >>             file=o

  1   2   3   >