Skip to content
This repository was archived by the owner on Sep 1, 2021. It is now read-only.
This repository was archived by the owner on Sep 1, 2021. It is now read-only.

Anchor requires key presence in container #6

@ius

Description

@ius

When building a Struct which contains an Anchor, not providing the anchor's label as a key in the Container instance yields an AttributeError.

#!/usr/bin/python2
from construct import *

struct = Struct(None, Anchor('foo_anchor'))
struct.build(Container())

Running the testcase yields: AttributeError: 'Container' object has no attribute 'foo_anchor'

As an anchor's value is solely determined by it's position in the construct, it shouldn't have to be specified in the Container?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions