➜

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: file tell() report incorrect file position on Windows (but Linux is OK)
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: io.TextIOWrapper.tell() report 65bit number when mix readline() + tell()
View: 26016
Assigned To: terry.reedy Nosy List: eric.smith, liugang93, martin.panter, terry.reedy
Priority: normal Keywords:

Created on 2016-11-26 04:00 by liugang93, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
1.txt liugang93, 2016-11-26 04:00 the file content:31 0D 32 0D 33 0D ... (hex view)
1.txt liugang93, 2016-11-26 04:06 file content is: 31 0D 32 0D 33 0D ... (hex view)
Messages (4)
msg281752 - (view) Author: liugang (liugang93) Date: 2016-11-26 04:00
D:\Python35\python.exe "D:\PyCharm Community Edition 2016.3\helpers\pydev\pydevconsole.py" 8871 8872
PyDev console: starting.
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['C:\\Users\\liugang10\\PycharmProjects\\untitled', 'C:/Users/liugang10/PycharmProjects/untitled'])
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
>>> f = open('e:\\1.txt')
>>> f.readline()
'1\n'
>>> f.tell()
340282367000166625996085689099021713410
>>> f.readline()
'2\n'
>>> f.tell()
340282367000166625996085689099021713412
msg281753 - (view) Author: liugang (liugang93) Date: 2016-11-26 04:06
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> f = open('e:\\1.txt')
>>> f.readline()
'1\n'
>>> f.tell()
340282367000166625996085689099021713410
>>> f.readline()
'2\n'
>>> f.tell()
340282367000166625996085689099021713412
>>>
msg281754 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-11-26 04:59
Is this a duplicate of Issue 26016?
msg281806 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2016-11-27 00:55
Yes, it's a duplicate.

The only valid operation on the value of calling tell() from a text-mode file is to pass it to seek(). As long as that works, there's no bug here.
History
Date User Action Args
2022-04-11 14:58:40adminsetgithub: 72990
2016-11-27 00:55:21eric.smithsetstatus: open -> closed

superseder: io.TextIOWrapper.tell() report 65bit number when mix readline() + tell()

nosy: + eric.smith
messages: + msg281806
resolution: duplicate
stage: resolved
2016-11-26 04:59:44martin.pantersetnosy: + martin.panter
messages: + msg281754
2016-11-26 04:06:51liugang93setfiles: + 1.txt

messages: + msg281753
title: file tell() report incorrect file position (Windows, Linux is OK) -> file tell() report incorrect file position on Windows (but Linux is OK)
2016-11-26 04:00:09liugang93create