Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dictionary Creation Fails with integer key #59274

Closed
patajegcpacom mannequin opened this issue Jun 14, 2012 · 3 comments
Closed

Dictionary Creation Fails with integer key #59274

patajegcpacom mannequin opened this issue Jun 14, 2012 · 3 comments
Assignees
Labels
build The build process and cross-build OS-mac

Comments

@patajegcpacom
Copy link
Mannequin

patajegcpacom mannequin commented Jun 14, 2012

BPO 15069
Nosy @ronaldoussoren, @amauryfa, @bitdancer
Files
  • serialposix.py: pyserial
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ronaldoussoren'
    closed_at = <Date 2012-06-14.16:47:48.622>
    created_at = <Date 2012-06-14.16:41:06.237>
    labels = ['OS-mac', 'build', 'invalid']
    title = 'Dictionary Creation Fails with integer key'
    updated_at = <Date 2012-06-14.17:39:39.905>
    user = 'https://bugs.python.org/patajegcpacom'

    bugs.python.org fields:

    activity = <Date 2012-06-14.17:39:39.905>
    actor = 'r.david.murray'
    assignee = 'ronaldoussoren'
    closed = True
    closed_date = <Date 2012-06-14.16:47:48.622>
    closer = 'amaury.forgeotdarc'
    components = ['macOS']
    creation = <Date 2012-06-14.16:41:06.237>
    creator = 'pata@jegcpa.com'
    dependencies = []
    files = ['26007']
    hgrepos = []
    issue_num = 15069
    keywords = []
    message_count = 3.0
    messages = ['162805', '162806', '162810']
    nosy_count = 4.0
    nosy_names = ['ronaldoussoren', 'amaury.forgeotdarc', 'r.david.murray', 'pata@jegcpa.com']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue15069'
    versions = ['Python 3.2']

    @patajegcpacom
    Copy link
    Mannequin Author

    patajegcpacom mannequin commented Jun 14, 2012

    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 token

    MacOSX 10.6.8 32bit x86 python 3.2.3 (v3.2.3:3d0686d90f55, Apr 10 2012, 11:09:56)

    @patajegcpacom patajegcpacom mannequin added OS-mac build The build process and cross-build labels Jun 14, 2012
    @amauryfa
    Copy link
    Member

    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.

    @bitdancer
    Copy link
    Member

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build OS-mac
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants