Re: I love assert

2014-11-30 Thread Steven D'Aprano
Ethan Furman wrote: > On 11/28/2014 05:30 PM, Steven D'Aprano wrote: >> alister wrote: >> >>> And as may wiser people than me have already highlighted Assertions can >>> be switched off in python which means they cannot be relied upon in >>> production code invalidating the authors suggestion tha

Re: Suds Python 2.4.3 Proxy

2014-11-30 Thread Chris Angelico
On Sun, Nov 30, 2014 at 2:01 AM, Jerry Rocteur wrote: > This works GREAT on 2.7 but when I run it on 2.4 I get: > > File "/usr/lib64/python2.4/urllib2.py", line 580, in proxy_open > if '@' in host: > TypeError: iterable argument required It might be worth looking at some actual 2.4 document

Getting errors from Imaplib

2014-11-30 Thread Beatrix Willius from Moth Software
Hi, first poster here. I still consider myself pretty much a Python newbie. Let's say I have the following very simple Python code: import imaplib host = 'imap.gmail.com' try: imap_connection = imaplib.IMAP4(host) print('success') except imaplib.IMAP4.error: print('authentication fa

Re: Getting errors from Imaplib

2014-11-30 Thread Chris Angelico
On Sun, Nov 30, 2014 at 7:36 PM, Beatrix Willius from Moth Software wrote: > > Let's say I have the following very simple Python code: > > import imaplib > > host = 'imap.gmail.com' > try: > imap_connection = imaplib.IMAP4(host) > print('success') > except imaplib.IMAP4.error: > print(

Re: Help needed

2014-11-30 Thread Denis McMahon
On Sat, 29 Nov 2014 11:35:18 -0800, Gautam R Bharadwaj wrote: > Here is the code in python, this code arranges the alphabets in > descending order and now I want to encode each alphabet with 0 and next > alphabet with 1, then 00,01,10,11,000,001 and so on. Please help me with > that. > >

Re: Suds Python 2.4.3 Proxy

2014-11-30 Thread Mark Lawrence
On 30/11/2014 09:10, Chris Angelico wrote: On Sun, Nov 30, 2014 at 2:01 AM, Jerry Rocteur wrote: This works GREAT on 2.7 but when I run it on 2.4 I get: File "/usr/lib64/python2.4/urllib2.py", line 580, in proxy_open if '@' in host: TypeError: iterable argument required It might be w

Re: Getting errors from Imaplib

2014-11-30 Thread Beatrix Willius from Moth Software
Hi Chris, no, pinging Yahoo doesn't work. But this is an additional problem - perhaps I tested too often. This is one of my accounts for Imap testing and I only copied the value from Mail. For getting the error back this doesn't really matter. > import imaplib > > host = 'imap.mail.yahoo.com'

Re: I love assert

2014-11-30 Thread Ethan Furman
On 11/30/2014 12:18 AM, Steven D'Aprano wrote: > > Ah, wait, I see the reference. You're talking about the quote from James O > Coplien: > > "An even more professional approach is to leave the assertions > in the code when you ship, and to automatically file a bug report > on behalf

Re: Getting errors from Imaplib

2014-11-30 Thread Chris Angelico
On Mon, Dec 1, 2014 at 1:42 AM, Beatrix Willius from Moth Software wrote: > no, pinging Yahoo doesn't work. But this is an additional problem - perhaps I > tested too often. This is one of my accounts for Imap testing and I only > copied the value from Mail. > > For getting the error back this d

Re: [Python-Dev] Unicode decode exception

2014-11-30 Thread Chris Angelico
On Sun, Nov 30, 2014 at 7:07 PM, balaji marisetti wrote: > Hi, Hi. This list is for the development *of* Python, not development *with* Python, so I'm sending this reply also to python-list@python.org where it can be better handled. You'll probably want to subscribe here: https://mail.python.org

Re: Suds Python 2.4.3 Proxy

2014-11-30 Thread Ned Deily
In article , Chris Angelico wrote: > It might be worth looking at some actual 2.4 documentation. > Unfortunately that doesn't seem to be hosted on python.org any more > (though I might be wrong), https://python.org/ -> Documentation https://www.python.org/doc/ -> Documentation Releases by Ve

Re: Suds Python 2.4.3 Proxy

2014-11-30 Thread Chris Angelico
On Mon, Dec 1, 2014 at 8:14 AM, Ned Deily wrote: > In article > , > Chris Angelico wrote: >> It might be worth looking at some actual 2.4 documentation. >> Unfortunately that doesn't seem to be hosted on python.org any more >> (though I might be wrong), > > https://python.org/ -> Documentation >

Re: [Python-Dev] Unicode decode exception

2014-11-30 Thread balaji marisetti
The default encoding is "UTF-8". It works if I do: with open("filename", errors="ignore") as f: So I think Python2, by default, ignores all errors whereas Python3 doesn't On 1 December 2014 at 01:49, Chris Angelico wrote: > On Sun, Nov 30, 2014 at 7:07 PM, balaji marisetti > wrote: >>

Re: [Python-Dev] Unicode decode exception

2014-11-30 Thread Michael Torrie
On 11/30/2014 09:19 PM, balaji marisetti wrote: > The default encoding is "UTF-8". It works if I do: > > with open("filename", errors="ignore") as f: > > > So I think Python2, by default, ignores all errors whereas Python3 doesn't Do you mean that the file is supposed to be utf-8 but is

Re: Getting errors from Imaplib

2014-11-30 Thread Beatrix Willius from Moth Software
On 30.11.2014, at 21:11, Chris Angelico wrote: > > 2) Network failures and auth problems should be dealt with the same > way. Change one line of code: > except (imaplib.IMAP4.error, OSError): > > Now it'll cope with OSError the same way it copes with IMAP errors. > > Does that answer your quest