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 amaury.forgeotdarc
Recipients amaury.forgeotdarc, barry, dlitz, jmfauth, ocean-city, pitrou, vstinner
Date 2008-10-07.10:49:47
SpamBayes Score 1.7946961e-09
Marked as misclassified No
Message-id <1223376588.58.0.565943993071.issue2384@psf.upfronthosting.co.za>
In-reply-to
Content
Your patch does the correct thing, however an explanation of the -1
value would be welcome. Something like:
/* The file has been reopened; parsing will restart from 
 * the beginning of the file, we have to reset the line number.
 * But this function has been called from inside tok_nextc() which 
 * will increment lineno before it returns. So we set it -1 so that
 * the next call to tok_nextc() will start with tok->lineno == 0.
 */

Or we could change the place of the tok->lineno++ in tok_nextc() so that
it is called before the call to decoding_fgets(); other changes will be
needed.

Then, I think that your test is not correct: What is the meaning of the
following line?
    sys.exit(traceback.tb_lineno(sys.exc_info()[2]))
(the module "traceback" has no attribute "tp_lineno")
I presume that you intended something like:
    traceback.print_exc()
    sys.exit(sys.exc_info()[2].tb_lineno)
and test at some point that "process.returncode == lineno"
History
Date User Action Args
2008-10-07 10:49:49amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, barry, pitrou, vstinner, ocean-city, jmfauth, dlitz
2008-10-07 10:49:48amaury.forgeotdarcsetmessageid: <1223376588.58.0.565943993071.issue2384@psf.upfronthosting.co.za>
2008-10-07 10:49:47amaury.forgeotdarclinkissue2384 messages
2008-10-07 10:49:47amaury.forgeotdarccreate