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.

Author catalin.iacob
Recipients arigo, brian.curtin, catalin.iacob, pitrou, rhettinger, serhiy.storchaka, skrah
Date 2013-01-20.16:45:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1358700358.89.0.692643130361.issue16273@psf.upfronthosting.co.za>
In-reply-to
Content
Could it be that Raymond's file had Unix line endings?

I tried to reproduce this, picked a file on my disk and indeed I got a negative number, but that file has Unix line endings. This is documented at http://docs.python.org/2/library/stdtypes.html#file.tell so probably there's nothing to do then.

As for Armin's report in msg180145, even though it's not intuitive, this matches ftell's behavior on Windows, as documented in the Remarks section of http://msdn.microsoft.com/en-us/library/0ys3hc0b%28v=vs.100%29.aspx. The tell() method on fileobjects is explicitly documented as matching ftell behavior: "Return the file’s current position, like stdio‘s ftell()". So even though it's not intuitive at all, it's probably better to leave it as is. tell() returns the intuitive non zero position when opening with 'a' on Python3 and on Python 2.7 when using io.open so it's fixed for the future anyway.
History
Date User Action Args
2013-01-20 16:45:58catalin.iacobsetrecipients: + catalin.iacob, arigo, rhettinger, pitrou, brian.curtin, skrah, serhiy.storchaka
2013-01-20 16:45:58catalin.iacobsetmessageid: <1358700358.89.0.692643130361.issue16273@psf.upfronthosting.co.za>
2013-01-20 16:45:58catalin.iacoblinkissue16273 messages
2013-01-20 16:45:58catalin.iacobcreate