(newbye) exceptions list for python3 classes

2013-06-24 Thread chrem

Hi,

what is the best way to find out all exceptions for a class?
E.g. I want to find out all exceptions related to the zipfile (I'm 
searching for the Bad password exception syntax).


thanks for your help or feedback,
Christophe
--
http://mail.python.org/mailman/listinfo/python-list


Re: (newbye) exceptions list for python3 classes

2013-06-24 Thread chrem

Le 24/06/13 23:35, chrem a écrit :

Hi,

what is the best way to find out all exceptions for a class?
E.g. I want to find out all exceptions related to the zipfile (I'm
searching for the Bad password exception syntax).

thanks for your help or feedback,
Christophe


without exception, it shown:
RuntimeError: ('Bad password for file', 0x100756690>)


then I tried:
except zipfile.BadPassword:
print("Password does not match")
but it returned:
AttributeError: 'module' object has no attribute 'BadPassword'




--
http://mail.python.org/mailman/listinfo/python-list


Re: (newbye) exceptions list for python3 classes

2013-06-25 Thread chrem

Le 24/06/13 23:43, chrem a écrit :

Le 24/06/13 23:35, chrem a écrit :

Hi,

what is the best way to find out all exceptions for a class?
E.g. I want to find out all exceptions related to the zipfile (I'm
searching for the Bad password exception syntax).

thanks for your help or feedback,
Christophe


without exception, it shown:
RuntimeError: ('Bad password for file', )

then I tried:
 except zipfile.BadPassword:
 print("Password does not match")
but it returned:
AttributeError: 'module' object has no attribute 'BadPassword'





Thanks alex23, Dave Angel and Ben Funney for your precious feedbacks !
--
http://mail.python.org/mailman/listinfo/python-list