Projet

Général

Profil

Bug #36860

Attempted relative import in non-package sur site en pickle

Ajouté par Frédéric Péters il y a plus de 4 ans. Mis à jour il y a plus de 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
11 octobre 2019
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Au chargement d'un rôle,

/usr/lib/python2.7/dist-packages/wcs/ctl/shell.pyc in <module>()
----> 1 Role.select()

/usr/lib/python2.7/dist-packages/wcs/qommon/storage.pyc in select(cls, clause, order_by, ignore_errors, ignore_migration, limit, offset, iterator, **kwargs)
    286         if limit or offset:
    287             objects = _take(objects, limit, offset)
--> 288         return list(objects)
    289 
    290     @classmethod

/usr/lib/python2.7/dist-packages/wcs/qommon/storage.pyc in <genexpr>((k,))
    257         keys = cls.keys()
    258         objects = (cls.get(k, ignore_errors=ignore_errors,
--> 259             ignore_migration=ignore_migration, **kwargs) for k in keys)
    260         if ignore_errors:
    261             objects = (x for x in objects if x is not None)

/usr/lib/python2.7/dist-packages/wcs/qommon/storage.pyc in get(cls, id, ignore_errors, ignore_migration, **kwargs)
    327         return cls.get_filename(filename, ignore_errors=ignore_errors,
    328                                 ignore_migration=ignore_migration,
--> 329                                 **kwargs)
    330 
    331     @classmethod

/usr/lib/python2.7/dist-packages/wcs/qommon/storage.pyc in get_filename(cls, filename, ignore_errors, ignore_migration, **kwargs)
    387         try:
    388             fd = open(filename)
--> 389             o = cls.storage_load(fd, **kwargs)
    390         except IOError:
    391             if ignore_errors:

/usr/lib/python2.7/dist-packages/wcs/qommon/storage.pyc in storage_load(cls, fd)
    381         else:
    382             unpickler = pickle.Unpickler
--> 383         return unpickler(fd).load()
    384 
    385     @classmethod

/usr/lib/python2.7/pickle.pyc in load(self)
    862             while 1:
    863                 key = read(1)
--> 864                 dispatch[key](self)
    865         except _Stop, stopinst:
    866             return stopinst.value

/usr/lib/python2.7/pickle.pyc in load_global(self)
   1094         module = self.readline()[:-1]
   1095         name = self.readline()[:-1]
-> 1096         klass = self.find_class(module, name)
   1097         self.append(klass)
   1098     dispatch[GLOBAL] = load_global

/usr/lib/python2.7/dist-packages/wcs/publisher.pyc in find_class(self, module, name)
     57         elif module in ('formdata', 'formdef', 'users', 'workflows'):
     58             module = 'wcs.%s' % module
---> 59         __import__(module)
     60         mod = sys.modules[module]
     61         klass = getattr(mod, name)

/usr/lib/python2.7/dist-packages/wcs/roles.py in <module>()
     17 from quixote import get_publisher
     18 
---> 19 from .qommon import _, misc
     20 from .qommon.storage import StorableObject
     21 

ValueError: Attempted relative import in non-package

Fichiers

Révisions associées

Révision 2b9bfd93 (diff)
Ajouté par Frédéric Péters il y a plus de 4 ans

misc: convert old roles module location when unpickling (#36860)

Révision 6d3559fa (diff)
Ajouté par Frédéric Péters il y a plus de 4 ans

misc: convert old roles module location when unpickling (#36860)

Historique

#1

Mis à jour par Frédéric Péters il y a plus de 4 ans

Puis ça devra sans doute partir en hotfix. (en attendant j'applique quand même déjà manuellement ça sur la prod)

#2

Mis à jour par Benjamin Dauvergne il y a plus de 4 ans

  • Statut changé de Solution proposée à Solution validée
#3

Mis à jour par Frédéric Péters il y a plus de 4 ans

  • Statut changé de Solution validée à Solution déployée
commit 2b9bfd93c96c04663fdd7aaad725a77fc37d9335
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Fri Oct 11 16:08:28 2019 +0200

    misc: convert old roles module location when unpickling (#36860)

Formats disponibles : Atom PDF