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: octal literals beginning with 8 don't raise a SyntaxError
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, lukas
Priority: normal Keywords: patch

Created on 2008-04-24 16:31 by lukas, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
octal_literals.diff lukas, 2008-04-24 16:31 the patch
Messages (2)
msg65729 - (view) Author: Lukas Meuser (lukas) Date: 2008-04-24 16:31
Octal literals containing an 8 or a 9 should raise a SyntaxError, but 8 ist 
accepted as the first character of such a literal (e.g., 0o8 or 0o876, but 
not 0o678). Those literals evaluate to 0.0.
The fix for this is trivial, a patch against current SVN (r62479) is 
attached.
msg65735 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-04-24 18:12
Corrected as r62480.
I changed your patch a little bit: it seemed more logical to use 
   (c < '0' || c >= '8')
As it is the exact counterpart of 
   ('0' <= c && c < '8')
used a few lines below.

Thanks for the report!
History
Date User Action Args
2022-04-11 14:56:33adminsetgithub: 46933
2008-04-24 18:12:14amaury.forgeotdarcsetstatus: open -> closed
resolution: fixed
messages: + msg65735
nosy: + amaury.forgeotdarc
2008-04-24 16:31:18lukascreate