From: Georg Brandl Date: Fri, 20 Jan 2006 09:14:41 +0000 (+0000) Subject: Bug #1396471: Document that Windows' ftell() can return invalid X-Git-Tag: v2.4.3c1~128 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90394a56282159e9aa53322df8a5647f008d1d42;p=thirdparty%2FPython%2Fcpython.git Bug #1396471: Document that Windows' ftell() can return invalid values for text files with UNIX-style line endings. --- diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex index c7b56cc0bdae..9bea8abf489d 100644 --- a/Doc/lib/libstdtypes.tex +++ b/Doc/lib/libstdtypes.tex @@ -625,7 +625,7 @@ characters is assumed. \begin{methoddesc}[string]{find}{sub\optional{, start\optional{, end}}} Return the lowest index in the string where substring \var{sub} is found, such that \var{sub} is contained in the range [\var{start}, -\var{end}). Optional arguments \var{start} and \var{end} are +\var{end}]. Optional arguments \var{start} and \var{end} are interpreted as in slice notation. Return \code{-1} if \var{sub} is not found. \end{methoddesc} @@ -1598,6 +1598,10 @@ flush the read-ahead buffer. \begin{methoddesc}[file]{tell}{} Return the file's current position, like \code{stdio}'s \cfunction{ftell()}. + + \note{On Windows, \method{tell()} can return illegal values (after an + \cfunction{fgets()}) when reading files with \UNIX{}-style line-endings. + Use binary mode (\code{'rb'}) to circumvent this problem.} \end{methoddesc} \begin{methoddesc}[file]{truncate}{\optional{size}} diff --git a/Misc/NEWS b/Misc/NEWS index 69029834980b..1b456424d8f7 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -346,6 +346,9 @@ Build Documentation ------------- +- Bug #1396471: Document that Windows' ftell() can return invalid + values for text files with UNIX-style line endings. + - Bug #1274828: Document os.path.splitunc(). - Bug #1190204: Clarify which directories are searched by site.py.