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

TypeError: '>' not supported between instances of 'NoneType' and 'NoneType' #83

Open
zopyx opened this issue Jul 15, 2019 · 2 comments
Open
Labels

Comments

@zopyx
Copy link
Member

zopyx commented Jul 15, 2019

Plone 5.2RC5, GS 2.0

    setup_layer(options, layer, setup_layers)
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/zope.testrunner-5.0-py3.7.egg/zope/testrunner/runner.py", line 787, in setup_layer
    setup_layer(options, base, setup_layers)
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/zope.testrunner-5.0-py3.7.egg/zope/testrunner/runner.py", line 792, in setup_layer
    layer.setUp()
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/plone.app.testing-6.1.3-py3.7.egg/plone/app/testing/helpers.py", line 374, in setUp
    self.setUpZope(portal.getPhysicalRoot(), configurationContext)
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/src/ugent.vacancy/src/ugent/vacancy/tests/base.py", line 37, in setUpZope
    xmlconfig.file("configure.zcml", mod, context=configurationContext)
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/zope.configuration-4.3.1-py3.7.egg/zope/configuration/xmlconfig.py", line 659, in file
    context.execute_actions()
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/zope.configuration-4.3.1-py3.7.egg/zope/configuration/config.py", line 800, in execute_actions
    None, sys.exc_info()[2])
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/zope.configuration-4.3.1-py3.7.egg/zope/configuration/_compat.py", line 30, in reraise
    raise value.with_traceback(tb)
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/zope.configuration-4.3.1-py3.7.egg/zope/configuration/config.py", line 791, in execute_actions
    callable(*args, **kw)
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/Products.GenericSetup-2.0-py3.7.egg/Products/GenericSetup/registry.py", line 438, in registerStep
    if already and already['version'] > version:
zope.configuration.config.ConfigurationExecutionError: File "/home/ajung/sandboxes/ugent-portaal-plone-4x/src/ugent.ldap/src/ugent/ldap/configure.zcml", line 92.2-97.6
    <genericsetup:importStep
      name="ugent.ldap-setuphandlers"
      title="ugent.ldap Setuphandlers"
      description="Additional import step for package ugent.ldap"
      handler="ugent.ldap.setuphandlers.import_various"
      />

    TypeError: '>' not supported between instances of 'NoneType' and 'NoneType'

The version parameter and the already['version'] are both None.

Possibly a bad package configuration. However the error message is not directly helpful here.

(Pdb) args
self = <Products.GenericSetup.registry.ImportStepRegistry object at 0x7efc0eae2860>
id = 'ugent.ldap-setuphandlers'
version = None
handler = <function import_various at 0x7efc06d16158>
dependencies = ()
title = 'ugent.ldap Setuphandlers'
description = 'Additional import step for package ugent.ldap'
(Pdb) pp already
{'dependencies': (),
 'description': 'Additional import step for package ugent.ldap',
 'handler': 'ugent.ldap.setuphandlers.import_various',
 'id': 'ugent.ldap-setuphandlers',
 'invalid': False,
 'title': 'ugent.ldap Setuphandlers',
 'version': None}
(Pdb) 
@zopyx zopyx added the bug label Jul 15, 2019
@petschki
Copy link

petschki commented Aug 5, 2019

Somehow related (I think) when trying to show old upgradesteps from a package...

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 155, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 337, in publish_module
  Module ZPublisher.WSGIPublisher, line 255, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 61, in call_object
  Module Shared.DC.Scripts.Bindings, line 335, in __call__
  Module Shared.DC.Scripts.Bindings, line 372, in _bindAndExec
  Module Products.PageTemplates.PageTemplateFile, line 145, in _exec
  Module Products.PageTemplates.PageTemplate, line 85, in pt_render
  Module zope.pagetemplate.pagetemplate, line 135, in pt_render
  Module Products.PageTemplates.engine, line 88, in __call__
  Module z3c.pt.pagetemplate, line 173, in render
  Module chameleon.zpt.template, line 306, in render
  Module chameleon.template, line 209, in render
  Module chameleon.utils, line 75, in raise_with_traceback
  Module chameleon.template, line 187, in render
  Module 61103a7cb7cc1082cf74a74d0bac3d5e.py, line 690, in render
  Module Products.GenericSetup.tool, line 1002, in listUpgrades
  Module Products.GenericSetup.upgrade, line 270, in listUpgradeSteps
TypeError: '<' not supported between instances of 'dict' and 'dict'

 - Expression: " python:context.listUpgrades(profile_id, show_old=show_old"
 - Filename:   manage_upgrades
 - Location:   (line 69: col 27)
 - Arguments:  template: <ImplicitAcquisitionWrapper manage_upgrades at 0x111785318>
               here: <ImplicitAcquisitionWrapper portal_setup at 0x111785168>
               context: <ImplicitAcquisitionWrapper portal_setup at 0x111785168>
               container: <ImplicitAcquisitionWrapper portal_setup at 0x111785168>
               nothing: <NoneType - at 0x10aed2128>
               options: {...} (1)
               root: <ImplicitAcquisitionWrapper  at 0x1130cd6c0>
               request: <WSGIRequest - at 0x119c5d860>
               modules: <_SecureModuleImporter - at 0x10da597b8>
               user: <ImplicitAcquisitionWrapper - at 0x113b0b5e8>
               default: <object - at 0x10b009b40>
               repeat: {...} (0)
               loop: {...} (1)
               wrapped_repeat: <SafeMapping - at 0x119ab6088>
               target_language: <NoneType - at 0x10aed2128>
               translate: <function translate at 0x119a9f730>
               profile_id: collective.collectionfilter:default
               prof_with_upgrades: <list - at 0x119c71b48>
               prof_with_pending_upgrades: <list - at 0x1198b82c8>
               prof_uptodate: <list - at 0x119c71fc8>
               has_pending_upgrades: True
               show_old: 1

the upgradeSteps list looks like this:

(Pdb++) res
[((<Version('7')>, 0, True), {'id': '1354697375542359044', 'step': <Products.GenericSetup.upgrade.UpgradeDepends object at 0x10c95ba58>, 'title': 'New Target Collection registry value, Update Resources', 'source': ('7',), 'dest': ('8',), 'description': '', 'proposed': True, 'sortkey': 0}), 
  ((<LegacyVersion('')>, 0, True), {'id': '1403960353036550788', 'step': <Products.GenericSetup.upgrade.UpgradeStep object at 0x10c95ba20>, 'title': 'Reapply profile to fix bundle registration', 'source': None, 'dest': ('8',), 'description': '', 'proposed': True, 'sortkey': 0}), 
  ((<LegacyVersion('')>, 0, True), {'id': '2060881595769228994', 'step': <Products.GenericSetup.upgrade.UpgradeStep object at 0x10c913978>, 'title': 'Reapply profile to fix bundle registration', 'source': None, 'dest': ('7',), 'description': '', 'proposed': True, 'sortkey': 0}), 
  ((<Version('8')>, 0, True), {'id': '2538933861421866518', 'step': <Products.GenericSetup.upgrade.UpgradeDepends object at 0x10c95bef0>, 'title': 'Update Resources', 'source': ('8',), 'dest': ('9',), 'description': '', 'proposed': True, 'sortkey': 0}), 
  ((<Version('2')>, 0, True), [{'id': '8367781049433168419', 'step': <Products.GenericSetup.upgrade.UpgradeDepends object at 0x10c95b7f0>, 'title': 'Register bundle differently to avoid Select2 initialization error', 'source': ('2',), 'dest': ('3',), 'description': '', 'proposed': True, 'sortkey': 0}]),
  ((<Version('1')>, 0, True), {'id': '964901385060890629', 'step': <Products.GenericSetup.upgrade.UpgradeStep object at 0x10c913a20>, 'title': 'Portlet upgrade for new filter_type attribute', 'source': ('1',), 'dest': ('2',), 'description': '', 'proposed': True, 'sortkey': 0})]

but this has to be package related too, because other packages list old steps without error ...

@d-maurer
Copy link
Contributor

d-maurer commented Aug 6, 2019 via email

gogobd added a commit to gogobd/Products.GenericSetup that referenced this issue Apr 9, 2021
Fixing zopefoundation#83 by being more careful
@gogobd gogobd mentioned this issue Apr 9, 2021
gogobd added a commit to gogobd/Products.GenericSetup that referenced this issue Apr 9, 2021
gogobd added a commit that referenced this issue Jul 9, 2021
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

3 participants