Message401193
| Author |
terry.reedy |
| Recipients |
Arfrever, alex, arigo, benjamin.peterson, georg.brandl, gvanrossum, iritkatriel, ita1024, jwilk, serhiy.storchaka, terry.reedy |
| Date |
2021年09月06日.23:29:59 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1630970999.39.0.699076087761.issue20115@roundup.psfhosted.org> |
| In-reply-to |
| Content |
The compile() doc currently says ""This function raises SyntaxError if the compiled source is invalid, and ValueError if the source contains null bytes." And indeed, in repository 3.9, 3.10, 3.11,
>>> compile('0円','','exec')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: source code string cannot contain null bytes
Ditto when run same in a file from IDLE or command line. The exception sometimes when the null is in a comment or string within the code.
>>> '0円'
'\x00'
>>> #0円
>>> compile('#0円','','single', 0x200)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: source code string cannot contain null bytes
>>> compile('"0円"','','single', 0x200)
ValueError: source code string cannot contain null bytes
I am puzzled because "0円" and #0円 in the IDLE shell are sent as strings containing the string or comment to compiled with the call above in codeop. There must be some difference in when 0円 is interpreted. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2021年09月06日 23:29:59 | terry.reedy | set | recipients:
+ terry.reedy, gvanrossum, arigo, georg.brandl, benjamin.peterson, jwilk, Arfrever, alex, ita1024, serhiy.storchaka, iritkatriel |
| 2021年09月06日 23:29:59 | terry.reedy | set | messageid: <1630970999.39.0.699076087761.issue20115@roundup.psfhosted.org> |
| 2021年09月06日 23:29:59 | terry.reedy | link | issue20115 messages |
| 2021年09月06日 23:29:59 | terry.reedy | create |
|