RE: missing required positional arguments
"Boylan, Ross" <[email protected]>
| Newsgroups | gmane.comp.web.zope.zodb |
|---|---|
| Message-ID | <[email protected]> |
FWIW, in the session I used to write the data >>> bb._codeRevision [(b'897', b'3bf22169ab09fc3eace1ce0b6077abad55bdbdbc', b'tip', b'default', b'Ross Boylan <ross@ross-sas>', b'tng-README.txt: handy guide to results', datetime.datetime(2016, 11, 16, 13, 28, 26))] >>> type(bb._codeRevision[0]) <class 'hglib.client.revision'> So the class name doesn't appear to be nested in the tng namespace. I'm going to set it back to None until I work this out. Ross ________________________________________ From: [email protected] [[email protected]] on behalf of Boylan, Ross [[email protected]] Sent: Wednesday, November 16, 2016 7:28 PM To: zodb [[email protected]] Subject: [ZODB] missing required positional arguments I'm having trouble pulling an instance back from the database (ZEO). It's a revision object from hglib package. My first try did not import hglib in the client; the second try did. Both got the same error; see below for fuller output. Maybe the type in the database is defined using some kind of nested class I can't easily access, maybe tng.hglib.revision? https://selenic.com/repo/python-hglib/file/tip/hglib/client.py defines class revision(tuple): def __new__(cls, rev, node, tags, branch, author, desc, date): return tuple.__new__(cls, (rev, node, tags, branch, author, desc, date)) Fuller history: Most of my code is in a package/module tng In an interactive session I did from tng import * as well as importing ZEO and other stuff, but NOT hglib. In the session I retrieved an object from the database, called a method on it that causes the revision to be set (inside my module is an import hglib), and committed. In another session I tried to read the object I just wrote. That session did from tng import *; as noted I tried with and without import hglib. Here's the error from that session: Couldn't load state for tng.Basics.BigBatch 0x044d Traceback (most recent call last): File "/home/ross/.local/lib/python3.4/site-packages/ZODB-5.0.0-py3.4.egg/ZODB/Connection.py", line 757, in setstate self._reader.setGhostState(obj, p) File "/home/ross/.local/lib/python3.4/site-packages/ZODB-5.0.0-py3.4.egg/ZODB/serialize.py", line 622, in setGhostState state = self.getState(pickle) File "/home/ross/.local/lib/python3.4/site-packages/ZODB-5.0.0-py3.4.egg/ZODB/serialize.py", line 615, in getState return unpickler.load() TypeError: __new__() missing 6 required positional arguments: 'node', 'tags', 'branch', 'author', 'desc', and 'date' [the entire error was printed twice for some reason] -- You received this message because you are subscribed to the Google Groups "zodb" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "zodb" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.