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 serhiy.storchaka
Recipients arno-cs, loewis, serhiy.storchaka, sonderblade
Date 2012-11-07.16:43:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1352306593.27.0.383783315841.issue1776160@psf.upfronthosting.co.za>
In-reply-to
Content
This issue is related to parsing of "et#" format which is used only in listdir() and _getfullpathname() under Windows. PyArg_ParseTuple() throws TypeError exception for multiple conversion errors (in this case it is an overflow of a static buffer). There are several ways to solve this issue:

1. Do nothing, close the issue as "wont fix".  This is just the wrong exception in a very rare case only on 2.7 and only under Windows.  The issue will go away with 2.7.

2. Use under Windows dynamic buffer as under other platforms.  This will require not only dynamic memory allocation, but also reallocation for "\*.*" appending.

3. Do not use PyArg_ParseTuple().  Parse the singular argument manually.

4. If PyArg_ParseTuple() fails then check if the raised exception is TypeError and the error message matches "(buffer overflow)".  In this case raise the right exception.

5. Rewrite PyArg_ParseTuple() so that it will raise an appropriate type of exception (this will have to do anyway, but maybe later, in other issue).  In this case it will be OverflowError.  Then we can catch this error and raise the right exception.

Martin, what is your decision?
History
Date User Action Args
2012-11-07 16:43:13serhiy.storchakasetrecipients: + serhiy.storchaka, loewis, sonderblade, arno-cs
2012-11-07 16:43:13serhiy.storchakasetmessageid: <1352306593.27.0.383783315841.issue1776160@psf.upfronthosting.co.za>
2012-11-07 16:43:13serhiy.storchakalinkissue1776160 messages
2012-11-07 16:43:12serhiy.storchakacreate