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

Spacy fails to deserialize empty document from binary format #459

Closed
bdaskalov opened this issue Jul 22, 2016 · 2 comments
Closed

Spacy fails to deserialize empty document from binary format #459

bdaskalov opened this issue Jul 22, 2016 · 2 comments
Labels
bug Bugs and behaviour differing from documentation

Comments

@bdaskalov
Copy link

bdaskalov commented Jul 22, 2016

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)

@honnibal honnibal added the bug Bugs and behaviour differing from documentation label Oct 21, 2016
@honnibal
Copy link
Member

honnibal commented Oct 23, 2016

Fixed, thanks!

@lock
Copy link

lock bot commented May 9, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation
Projects
None yet
Development

No branches or pull requests

2 participants