On Thu, Jun 21, 2012 at 11:16 PM, Antoine Pitrou <solip...@pitrou.net> wrote: > On Thu, 21 Jun 2012 15:04:17 +0200 > Christian Heimes <li...@cheimes.de> wrote: >> >> How about adding keyword support to OSError and derive the strerror from >> errno if the second argument is not given? > > That's not the original behaviour: > > Python 3.2.2+ (3.2:9ef20fbd340f, Oct 15 2011, 21:22:07) > [GCC 4.5.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> e = OSError(5) >>>> e.errno >>>> e.strerror >>>> str(e) > '5' > > > I don't mind making this particular compatibility-breaking change, > though.
+1 from me. Existing code that just passes errno will now get strerror set automatically, and existing code *can't* just be passing the errno and filename, since OSError doesn't yet support keyword arguments. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com