This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nirs
Recipients nirs
Date 2007-09-07.02:00:01
SpamBayes Score 0.006959762
Marked as misclassified No
Message-id <1189130404.46.0.902963366118.issue1126@psf.upfronthosting.co.za>
In-reply-to
Content
The docs (http://docs.python.org/dev/3.0/library/stdtypes.html#sequence-
types-str-bytes-list-tuple-buffer-range) warn that .fileno and .istty 
should not be implemented by a file like object.

This require client to check if the file object has the attribute before 
they call the method, instead of treating all files the same.

    if hasattr(foo, 'istty'):
        if foo.istty():
            # ...

Instead of:

    if foo.istty():
        # ...

istty can easily return False. fileno can return invalid file descriptor 
number (-1?).
History
Date User Action Args
2007-09-07 02:00:06nirssetspambayes_score: 0.00695976 -> 0.006959762
recipients: + nirs
2007-09-07 02:00:04nirssetspambayes_score: 0.00695976 -> 0.00695976
messageid: <1189130404.46.0.902963366118.issue1126@psf.upfronthosting.co.za>
2007-09-07 02:00:04nirslinkissue1126 messages
2007-09-07 02:00:02nirscreate