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.

classification
Title: Doc bug in PEP-0278
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jackjansen Nosy List: fdrake, jackjansen, logistix
Priority: normal Keywords:

Created on 2003-09-05 02:18 by logistix, last changed 2022-04-10 16:11 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pep0278.patch logistix, 2003-09-05 02:18 probably unneeded patch file
Messages (2)
msg18068 - (view) Author: Grant Olson (logistix) Date: 2003-09-05 02:18
PEP 278 suggests that the proper way to test for 
universal newline support is 'hasattr
(sys.stdout, "newline")'  However, this doesn't work too 
well when sys.stdout is overridden.  One big example of 
this is PythonWin's sys.stdout, which doesn't have an 
newlines attribute even when it is supported by 
python23.dll.

Testing 'hasattr(file, "newlines")' seems to be a more 
reliable way to test.
msg18069 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-05-06 12:28
Logged In: YES 
user_id=3066

Fixed.  I changed the test to use "hasattr(open,
'newlines')" to be compatible with older versions of Python
as well as avoiding the replacement problem you noted.

nondist/peps/pep-0278.txt revision 1.9
History
Date User Action Args
2022-04-10 16:11:00adminsetgithub: 39185
2003-09-05 02:18:45logistixcreate