]> granicus.if.org Git - python/commitdiff
Revert r41662 and the part of 41552 that originally caused the problem
authorNeal Norwitz <nnorwitz@gmail.com>
Thu, 15 Dec 2005 05:25:09 +0000 (05:25 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Thu, 15 Dec 2005 05:25:09 +0000 (05:25 +0000)
(calling ftell(stdin) doesn't seem defined).  So we won't test errors
from ftell unless we can do it portably.

Lib/test/test_file.py
Misc/NEWS
Objects/fileobject.c
configure
configure.in
pyconfig.h.in

index ade7a6fb96b6321dbeb1b0440f8fc3e2cfc0e913..bde3202e8c0bdc6130b2ad496a5c1b6f8d8c280d 100644 (file)
@@ -107,13 +107,6 @@ except IOError:
 else:
     print "should not be able to seek on sys.stdin"
 
-try:
-    sys.stdin.tell()
-except IOError:
-    pass
-else:
-    print "should not be able to tell on sys.stdin"
-
 try:
     sys.stdin.truncate()
 except IOError:
index c8e8981a724812f67da9198d138184860a40b391..d675706b54ca5b34a6901323868cb7221c8cb08c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,9 +12,6 @@ What's New in Python 2.5 alpha 1?
 Core and builtins
 -----------------
 
-- Added a workaround for file.tell() to raise IOError when the file
-  is a tty on every platforms as documented in our library reference.
-
 - Patch #1350409: Work around signal handling bug in Visual Studio 2005.
 
 - Bug #1281408: Py_BuildValue now works correct even with unsigned longs
index 1de520b1629baeb3ef9e33fc724a79333fb422ef..259a4234239b4c9b85f03cb5192e63089fa32ebc 100644 (file)
@@ -482,13 +482,6 @@ _portable_fseek(FILE *fp, Py_off_t offset, int whence)
 static Py_off_t
 _portable_ftell(FILE* fp)
 {
-#ifdef HAVE_BROKEN_FTELL
-       /* ftell doesn't fail for tty fds on FreeBSD and some others */
-       if (isatty(fileno(fp))) {
-               errno = ESPIPE;
-               return -1;
-       }
-#endif
 #if !defined(HAVE_LARGEFILE_SUPPORT)
        return ftell(fp);
 #elif defined(HAVE_FTELLO) && SIZEOF_OFF_T >= 8
index 83078e76e3696d73c94bb8185d4b9bc7c86739b9..29007995383e839ff8acfe796410a33f8444bcc4 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 41662 .
+# From configure.in Revision: 39267 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59 for python 2.5.
 #
@@ -20118,67 +20118,6 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for broken ftell()" >&5
-echo $ECHO_N "checking for broken ftell()... $ECHO_C" >&6
-if test "${ac_cv_broken_ftell+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-if test "$cross_compiling" = yes; then
-  ac_cv_broken_ftell=no
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#include <stdio.h>
-int main()
-{
-       long val = ftell(stdin);
-       if (val != -1)
-               exit(0);
-       exit(1);
-}
-
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_broken_ftell=yes
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_broken_ftell=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-
-echo "$as_me:$LINENO: result: $ac_cv_broken_ftell" >&5
-echo "${ECHO_T}$ac_cv_broken_ftell" >&6
-if test "$ac_cv_broken_ftell" = yes
-then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_BROKEN_FTELL 1
-_ACEOF
-
-fi
-
 # Before we can test tzset, we need to check if struct tm has a tm_zone
 # (which is not required by ISO C or UNIX spec) and/or if we support
 # tzname[]
index 0550e4fa8d1d7b65bfd1ce834aab87a0bfd2f35e..75a33a1f7c3fbcb4ec6a0a20d76fa4a5371115a6 100644 (file)
@@ -2955,28 +2955,6 @@ then
       [Define if poll() sets errno on invalid file descriptors.])
 fi
 
-AC_MSG_CHECKING(for broken ftell())
-AC_CACHE_VAL(ac_cv_broken_ftell, [
-AC_TRY_RUN([
-#include <stdio.h>
-int main()
-{
-       long val = ftell(stdin);
-       if (val != -1)
-               exit(0);
-       exit(1);
-}
-],
-ac_cv_broken_ftell=yes,
-ac_cv_broken_ftell=no,
-ac_cv_broken_ftell=no)])
-AC_MSG_RESULT($ac_cv_broken_ftell)
-if test "$ac_cv_broken_ftell" = yes
-then
-  AC_DEFINE(HAVE_BROKEN_FTELL, 1,
-  [Define if ftell() set errno on tty files.])
-fi
-
 # Before we can test tzset, we need to check if struct tm has a tm_zone 
 # (which is not required by ISO C or UNIX spec) and/or if we support
 # tzname[]
index 2d4fabf150f5fde79fbcbc83e805c7f3898d5725..47723debfd7487866794ea080d45c154bdac72cd 100644 (file)
@@ -46,9 +46,6 @@
 /* Define to 1 if you have the <bluetooth.h> header file. */
 #undef HAVE_BLUETOOTH_H
 
-/* Define if ftell() set errno on tty files. */
-#undef HAVE_BROKEN_FTELL
-
 /* Define if nice() returns success/failure instead of the new priority. */
 #undef HAVE_BROKEN_NICE