[Python-checkins] cpython: Mention OSError instead of IOError in the docs.

Andrew Svetlov andrew.svetlov at gmail.com
Wed Dec 19 12:46:07 CET 2012


Done in #e5958a4e52ef

On Wed, Dec 19, 2012 at 9:24 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Wed, Dec 19, 2012 at 7:16 AM, andrew.svetlov <python-checkins at python.org>
> wrote:
>>
>> http://hg.python.org/cpython/rev/a6ea6f803017
>> changeset:   80934:a6ea6f803017
>> user:        Andrew Svetlov <andrew.svetlov at gmail.com>
>> date:        Tue Dec 18 23:16:44 2012 +0200
>> summary:
>>   Mention OSError instead of IOError in the docs.
>>
>> files:
>>   Doc/faq/library.rst |  4 ++--
>>   1 files changed, 2 insertions(+), 2 deletions(-)
>>
>>
>> diff --git a/Doc/faq/library.rst b/Doc/faq/library.rst
>> --- a/Doc/faq/library.rst
>> +++ b/Doc/faq/library.rst
>> @@ -209,7 +209,7 @@
>>             try:
>>                 c = sys.stdin.read(1)
>>                 print("Got character", repr(c))
>> -           except IOError:
>> +           except OSError:
>>                 pass
>>     finally:
>>         termios.tcsetattr(fd, termios.TCSAFLUSH, oldterm)
>> @@ -222,7 +222,7 @@
>>     :func:`termios.tcsetattr` turns off stdin's echoing and disables
>> canonical
>>     mode.  :func:`fcntl.fnctl` is used to obtain stdin's file descriptor
>> flags
>>     and modify them for non-blocking mode.  Since reading stdin when it is
>> empty
>> -   results in an :exc:`IOError`, this error is caught and ignored.
>> +   results in an :exc:`OSError`, this error is caught and ignored.
>
>
> With any of these changes in the docs, please don't forget to include
> appropriate "versionchanged" directives. Many people using the Python 3 docs
> at "docs.python.org/3/" will still be on Python 3.2, and thus relying on the
> presence of such directives to let them know that while the various
> OS-related exception names are now just aliases for OSError in 3.3+, the
> distinctions still matter in 3.2.
>
> Cheers,
> Nick.
>
>
> --
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>



-- 
Thanks,
Andrew Svetlov


More information about the Python-checkins mailing list