[Python-checkins] python/dist/src README,1.143,1.144 configure,1.298,1.299 configure.in,1.308,1.309 pyconfig.h.in,1.29,1.30

jackjansen@sourceforge.net jackjansen@sourceforge.net
Sun, 14 Apr 2002 13:13:11 -0700


Update of /cvsroot/python/python/dist/src
In directory usw-pr-cvs1:/tmp/cvs-serv1748

Modified Files:
	README configure configure.in pyconfig.h.in 
Log Message:
Mass checkin of universal newline support.
Highlights: import and friends will understand any of \r, \n and \r\n
as end of line. Python file input will do the same if you use mode 'U'.
Everything can be disabled by configuring with --without-universal-newlines.

See PEP278 for details. 


Index: README
===================================================================
RCS file: /cvsroot/python/python/dist/src/README,v
retrieving revision 1.143
retrieving revision 1.144
diff -C2 -d -r1.143 -r1.144
*** README	29 Mar 2002 16:28:30 -0000	1.143
--- README	14 Apr 2002 20:12:37 -0000	1.144
***************
*** 812,815 ****
--- 812,822 ----
  	memory management problems.  This allows printing a list of all
  	live objects when the interpreter terminates.
+ 	
+ --with(out)-universal-newlines: enable reading of text files with
+ 	foreign newline convention (default: enabled). In other words,
+ 	any of \r, \n or \r\n is acceptable as end-of-line character.
+ 	If enabled import and execfile will automatically accept any newline
+ 	in files. Python code can open a file with open(file, 'U') to
+ 	read it in universal newline mode.
  
  

Index: configure
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure,v
retrieving revision 1.298
retrieving revision 1.299
diff -C2 -d -r1.298 -r1.299
*** configure	14 Apr 2002 10:19:40 -0000	1.298
--- configure	14 Apr 2002 20:12:37 -0000	1.299
***************
*** 845,848 ****
--- 845,849 ----
    --with-pth                      use GNU pth threading libraries
    --with(out)-cycle-gc            disable/enable garbage collection
+   --with(out)-universal-newlines            disable/enable foreign newlines
    --with(out)-pymalloc            disable/enable specialized mallocs
    --with-wctype-functions         use wctype.h functions
***************
*** 10933,10936 ****
--- 10934,10960 ----
  echo "$as_me:$LINENO: result: $with_cycle_gc" >&5
  echo "${ECHO_T}$with_cycle_gc" >&6
+ 
+ # Check for universal newline support
+ echo "$as_me:$LINENO: checking for --with-universal-newline" >&5
+ echo $ECHO_N "checking for --with-universal-newline... $ECHO_C" >&6
+ 
+ # Check whether --with-universal-newlines or --without-universal-newlines was given.
+ if test "${with_universal_newlines+set}" = set; then
+   withval="$with_universal_newlines"
+ 
+ fi;
+ 
+ if test -z "$with_universal_newlines"
+ then with_universal_newlines="yes"
+ fi
+ if test "$with_universal_newlines" != "no"
+ then
+     cat >>confdefs.h <<\_ACEOF
+ #define WITH_UNIVERSAL_NEWLINES 1
+ _ACEOF
+ 
+ fi
+ echo "$as_me:$LINENO: result: $with_universal_newlines" >&5
+ echo "${ECHO_T}$with_universal_newlines" >&6
  
  # Check for Python-specific malloc support

Index: configure.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure.in,v
retrieving revision 1.308
retrieving revision 1.309
diff -C2 -d -r1.308 -r1.309
*** configure.in	14 Apr 2002 10:19:42 -0000	1.308
--- configure.in	14 Apr 2002 20:12:39 -0000	1.309
***************
*** 1446,1449 ****
--- 1446,1463 ----
  AC_MSG_RESULT($with_cycle_gc)
  
+ # Check for universal newline support
+ AC_MSG_CHECKING(for --with-universal-newline)
+ AC_ARG_WITH(universal-newlines,
+ [  --with(out)-universal-newlines            disable/enable foreign newlines])
+ 
+ if test -z "$with_universal_newlines"
+ then with_universal_newlines="yes"
+ fi
+ if test "$with_universal_newlines" != "no"
+ then
+     AC_DEFINE(WITH_UNIVERSAL_NEWLINES)
+ fi
+ AC_MSG_RESULT($with_universal_newlines)
+ 
  # Check for Python-specific malloc support
  AC_MSG_CHECKING(for --with-pymalloc)

Index: pyconfig.h.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** pyconfig.h.in	14 Apr 2002 10:19:43 -0000	1.29
--- pyconfig.h.in	14 Apr 2002 20:12:39 -0000	1.30
***************
*** 713,716 ****
--- 713,719 ----
  #undef WITH_CYCLE_GC
  
+ /* Define if you want to read files with foreign newlines. */
+ #undef WITH_UNIVERSAL_NEWLINES
+ 
  /* Define if you want to emulate SGI (IRIX 4) dynamic linking. This is
     rumoured to work on VAX (Ultrix), Sun3 (SunOS 3.4), Sequent Symmetry