Skip to content

Spacy fails to deserialize empty document from binary format #459

Closed

Description

@bdaskalov

Spacy throws the following exception when deserializaing an empty document from binary format:


SystemError Traceback (most recent call last)
in ()
5 b = empty_doc.to_bytes()
6 d = Doc(english.vocab)
----> 7 d.from_bytes(b)

/home/boris/work/happ/customers/ubs/venv/lib/python3.5/site-packages/spacy/tokens/doc.pyx in spacy.tokens.doc.Doc.from_bytes (spacy/tokens/doc.cpp:10859)()

SystemError: <built-in method unpack_into of spacy.serialize.packer.Packer object at 0x7f0ea30af638> returned NULL without setting an error

Can be reproduced on spacy 0.101.0 using the following code:

import spacy
from spacy.tokens import Doc
english = spacy.en.English()
empty_doc = english("")
b = empty_doc.to_bytes()
d = Doc(english.vocab)
d.from_bytes(b)

Activity

  1. added
    bugBugs and behaviour differing from documentation
    on Oct 21, 2016
  2. added 2 commits that reference this issue on Oct 23, 2016
  3. honnibal commented on Oct 23, 2016

    @honnibal
    Member

    Fixed, thanks!

  4. lock commented on May 9, 2018

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  5. locked as resolved and limited conversation to collaborators on May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBugs and behaviour differing from documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions