Skip to content

New Python-only closure cell rewriting fails on Python 3.8-dev #538

Closed
@hynek

Description

@hynek

I need someone who understands the code better than I to tell me whether this is our problem or whether we should report this upstream.

The problem seems to be the instantiation of types.CodeType(*args) because it throws an:

TypeError('an integer is required (got type bytes)')

The contents of args is the following:

[1,
 0,
 2,
 1,
 19,
 b'|\x00\x89\x00d\x00S\x00',
 (None,
  <code object force_x_to_be_a_cell at 0x7fe71817fe70, file "/Users/hynek/Projects/attrs/.tox/py38/lib/python3.8/site-packages/attr/_compat.py", line 151>,
  'make_set_closure_cell.<locals>.set_first_cellvar_to.<locals>.force_x_to_be_a_cell'),
 (),
 ('value', 'force_x_to_be_a_cell'),
 '/Users/hynek/Projects/attrs/.tox/py38/lib/python3.8/site-packages/attr/_compat.py',
 'set_first_cellvar_to',
 144,
 b'\x00\x01\x04\x01\x04\x05',
 ('x',),
 ()]

I suspect it's either b'|\x00\x89\x00d\x00S\x00', or b'\x00\x01\x04\x01\x04\x05', or both. However, it's bytes on 3.7 too.

Halp @oremanj?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions