Bugs item #1653416, was opened at 2007-02-06 17:23 Message generated for change (Comment added) made by eolebigot You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1653416&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Interpreter Core Group: Python 2.5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: E.-O. Le Bigot (eolebigot) Assigned to: Nobody/Anonymous (nobody) Summary: print >> f, "Hello" produces no error: normal? Initial Comment: When using print >> f, "Hello" on a file f opened for reading, no exception is raised. Is this normal? This situation has to be contrasted with f.write("Hello") which raises an exception. Details with Python 2.5 (r25:51908, Sep 24 206) on OS X 10.4.8 / darwin 8.8.0: In [1]: f=open("start.01") In [2]: f.write("Hello") <type 'exceptions.IOError'>: [Errno 9] Bad file descriptor In [3]: print >> f, "Hello" In [4]: f.close() NB: file f is not modified, despite the "print" statement yielding no error, above. ---------------------------------------------------------------------- >Comment By: E.-O. Le Bigot (eolebigot) Date: 2007-02-06 18:45 Message: Logged In: YES user_id=1440667 Originator: YES Interesting point, about Linux. The incorrect behavior is even seen in the default python 2.3 that ships with Mac OS X! ---------------------------------------------------------------------- Comment By: Georg Brandl (gbrandl) Date: 2007-02-06 18:31 Message: Logged In: YES user_id=849994 Originator: NO If this happens, it's a bug. Though it doesn't seem to occur under Linux here. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1653416&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com