Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue15069

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Dictionary Creation Fails with integer key
Type:compile errorStage:
Components:macOSVersions:Python 3.2
process
Status:closedResolution:not a bug
Dependencies:Superseder:
Assigned To: ronaldoussorenNosy List: amaury.forgeotdarc, pata@jegcpa.com, r.david.murray, ronaldoussoren
Priority:normalKeywords:

Created on2012-06-14 16:41 bypata@jegcpa.com, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
serialposix.pypata@jegcpa.com,2012-06-14 16:41pyserial
Messages (3)
msg162805 -(view)Author: Pat (pata@jegcpa.com)Date: 2012-06-14 16:41
Attempting to import pyserial. In module serialposix.py a dict declaration starting on line 64;    baudrate_constants = {        0:       0000000,        50:      0000001,        75:      0000002,       110:      0000003, ...etc Traceback (most recent call last):  File "<stdin>", line 1, in <module>  File "serialposix.py", line 64    50:      0000001,                   ^SyntaxError: invalid tokenMacOSX 10.6.8 32bit x86 python 3.2.3 (v3.2.3:3d0686d90f55, Apr 10 2012, 11:09:56)
msg162806 -(view)Author: Amaury Forgeot d'Arc (amaury.forgeotdarc)*(Python committer)Date: 2012-06-14 16:47
You are importing with Python3 a module written for Python2.pyserial-2.6 comes with a "setup.py" script that will do the conversion, you should run it and not try to import the source code directly.
msg162810 -(view)Author: R. David Murray (r.david.murray)*(Python committer)Date: 2012-06-14 17:39
And yes, a number with leading zeros is an invalid token in Python3, because in Python2 it was an octal number, and now we spell octal as, eg, 0o0001.
History
DateUserActionArgs
2022-04-11 14:57:31adminsetgithub: 59274
2012-06-14 17:39:39r.david.murraysetnosy: +r.david.murray
messages: +msg162810
2012-06-14 16:47:48amaury.forgeotdarcsetstatus: open -> closed

nosy: +amaury.forgeotdarc
messages: +msg162806

resolution: not a bug
2012-06-14 16:41:06pata@jegcpa.comcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp