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

caching: pickle.load() fails #32

Open
ZelenyMartin opened this issue Apr 9, 2021 · 1 comment
Open

caching: pickle.load() fails #32

ZelenyMartin opened this issue Apr 9, 2021 · 1 comment
Labels

Comments

@ZelenyMartin
Copy link
Collaborator

Conditions

Cache level 3 needs to be enabled in ~/.nitrate:

[cache]
level = 3

Test suite fail

python -m nitrate.tests
Output from test suite (needs to be run as whole test suite - no just the CasePlan test case - it does not fail)

CasePlan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sort key update ... ERROR

======================================================================
ERROR: Sort key update
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mzeleny/Work/git/python-nitrate/venv/lib64/python3.8/site-packages/nitrate/tests.py", line 1230, in test_sortkey_update
    cache.load()
  File "/home/mzeleny/Work/git/python-nitrate/venv/lib64/python3.8/site-packages/nitrate/cache.py", line 298, in load
    data = pickle.load(input_file)
TypeError: __new__() missing 1 required positional argument: 'object'

----------------------------------------------------------------------
Ran 1 test in 1.360s

FAILED (errors=1)

Production using fail

Traceback (most recent call last):
  File "./progress-generator.py", line 296, in <module>
    main()
  File "./progress-generator.py", line 282, in main
    dontRemoveCompose.append(updateComposeDetailPage(processedConfig['TCMS_STATUSES'], wikiPage, compose, tag))
  File "./progress-generator.py", line 223, in updateComposeDetailPage
    tcmsPart, exitCode = getTcmsInfo(tcmsStatuses, compose, tag)
  File "./progress-generator.py", line 126, in getTcmsInfo
    TRs=nitrate.TestRun.search(build__name=build, tag__name__contains=tag)
  File "/usr/lib/python3.8/site-packages/nitrate/mutable.py", line 538, in search
    return [TestRun(hash)
  File "/usr/lib/python3.8/site-packages/nitrate/mutable.py", line 538, in <listcomp>
    return [TestRun(hash)
  File "/usr/lib/python3.8/site-packages/nitrate/base.py", line 311, in __new__
    Cache()
  File "/usr/lib/python3.8/site-packages/nitrate/cache.py", line 194, in __new__
    cls._instance.__init__(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/nitrate/cache.py", line 203, in __init__
    self.enter(filename)
  File "/usr/lib/python3.8/site-packages/nitrate/cache.py", line 388, in enter
    self.load()
  File "/usr/lib/python3.8/site-packages/nitrate/cache.py", line 298, in load
    data = pickle.load(input_file)
TypeError: __new__() missing 1 required positional argument: 'object'
@ZelenyMartin
Copy link
Collaborator Author

Closest case found: https://bugs.python.org/issue18359

If some class objects have extra arguments in the new constructor , pickle fail to serialize it.

I tried also other python modules like json, marshal and shelve but without success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant