[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2020-03-18 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2016-05-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixing seems fine with me. -- ___ Python tracker ___ ___

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2016-05-15 Thread Larry Hastings
Larry Hastings added the comment: Martin said: > Josh: it's not as simple as just changing the type code and variable type. > Systems used to require all kinds of types in the length parameter of read(2) > and fread(3), including int, long, and size_t. If it was int, passing size_t > would

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2016-05-15 Thread Larry Hastings
Larry Hastings added the comment: Updated patch based on feedback from Serihy. Thanks for the ping. -- Added file: http://bugs.python.org/file42860/larry.make.file_read.use.size_t.2.diff ___ Python tracker

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2016-05-15 Thread Larry Hastings
Larry Hastings added the comment: Summary: read Matt's original message on the bug. Status: still broken. Some people think it should be left that way. Proposed fix: it's straightforward to fix. You wrote a patch, I modified yours a little. The patch is short and easy to read. --

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2016-05-14 Thread STINNER Victor
STINNER Victor added the comment: I'm lost in this old issue. Can someone please try to summarize it? What is the problem? What is the proposed fix? What is the status? -- ___ Python tracker

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2016-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-09-11 Thread Larry Hastings
Larry Hastings added the comment: Ping? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21199 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-09-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I added comments to test on Rietveld. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21199 ___

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-16 Thread STINNER Victor
STINNER Victor added the comment: On Windows, the type of the size parameter of read() is an unsigned int, not long nor size_t (...) Oh, I read the wrong function. In fact, file_read() of Python 2.7 calls fread() and fread() uses size_t types, even on Windows. To make sure that we are

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-16 Thread STINNER Victor
STINNER Victor added the comment: If you want to announce that Python 2.7.x supports large objects on Windows 64 bits, be prepared to have to fix Python in various different places. You can compare which modules define PY_SSIZE_T_CLEAN in Python 2.7 and 3.x. For example, it looks like bz2 and

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-16 Thread Larry Hastings
Larry Hastings added the comment: Here's my version of the patch. It does the same thing Victor's patch does, but removes a now-completely-irrelevant stanza of code, and adds a test. I'm on 64-bit Linux, so the test was always going to work anyway. So I tested the test by changing file_read

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-15 Thread Larry Hastings
Larry Hastings added the comment: I don't think we can fix this. file_read returns a str, and str can have at most SSIZE_T_MAX entries. So, file_read could read size_t characters, but it couldn't return them. -- ___ Python tracker

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't think we can fix this. file_read returns a str, and str can have at most SSIZE_T_MAX entries. So, file_read could read size_t characters, but it couldn't return them. But at least it could read more than LONG_MAX characters. --

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-15 Thread Matt Mackall
Matt Mackall added the comment: Actually, no, all the size_t types are 64-bit on Windows 64: https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models To confirm this, I found someone nearby with a 64-bit Windows and he had no trouble allocating a 3G string with a = b'a' * 30.

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-15 Thread Larry Hastings
Larry Hastings added the comment: D'oh, yeah, you guys are right. SSIZE_T_MAX LONG_MAX, so that's an improvement. We just can't do the full size_t range. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21199

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-15 Thread STINNER Victor
STINNER Victor added the comment: On Windows, the type of the size parameter of read() is an unsigned int, not long nor size_t: http://msdn.microsoft.com/en-us/library/1570wh78.aspx FileIO.read() of Python 3 uses a size_t type but also: #ifdef MS_WINDOWS if (size INT_MAX) size =

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-14 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21199 ___ ___ Python-bugs-list

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-14 Thread Brett Cannon
Brett Cannon added the comment: We discussed this bug at the sprint and we all agreed that it should be fixed. It's an oversight and a bug that this behaviour is different between Windows and other platforms due to how 64-bit Windows treats longs. -- nosy: +brett.cannon

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-13 Thread Martin v . Löwis
Martin v. Löwis added the comment: FWIW, using l for file_read goes back to http://hg.python.org/cpython/diff/f44a56e697fb/Objects/fileobject.c from Fri, 09 May 1997 22:27:31 + -- nosy: +loewis ___ Python tracker rep...@bugs.python.org

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-13 Thread Josh Rosenberg
Josh Rosenberg added the comment: So it predates the existence of type code 'n', which would be the appropriate type code, but no one updated it. Antoine: Inability to perform a 2GB+ read properly is not something that should be worked around on a case by case basis. There is one

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-13 Thread Martin v . Löwis
Martin v. Löwis added the comment: Josh: it's not as simple as just changing the type code and variable type. Systems used to require all kinds of types in the length parameter of read(2) and fread(3), including int, long, and size_t. If it was int, passing size_t would lead to silent

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Antoine: Inability to perform a 2GB+ read properly is not something that should be worked around on a case by case basis. Really we are talking about Python 2.7 here. Anyone having this problem *has* to work it around in order for their code to work on

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-10 Thread Matt Mackall
New submission from Matt Mackall: Python's file_read uses an 'l' type to parse its args which results in a 31-bit size limit on reads on 64-bit Windows. It should instead use an ssize_t. Related Mercurial bug: http://bz.selenic.com/show_bug.cgi?id=4215 -- components: IO messages:

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-10 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21199 ___ ___

[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-04-10 Thread Larry Hastings
Larry Hastings added the comment: Benjamin: given the brave new world of 2.7 living even longer, Guido said this sort of bug fix was fair game. Will you accept a patch for this in 2.7? -- assignee: - larry nosy: +benjamin.peterson ___ Python