[issue2551126] AttributeError: 'str' object has no attribute 'local'

reda <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from reda:

I am using roundup 1.6.1 and i get the following exception with the Date property "chiffrageDelai":

<type 'exceptions.AttributeError'> : 'str' object has no attribute 'local'

Les informations de déboguage suivent

    Dans python expression "context.chiffrageDelai.pretty('%Y-%m-%d')"
    Lors de l'évaluation de l'expression à la ligne 485
    Variables actuelles :
    config 	<roundup.configuration.CoreConfig instance at 0x7fe2cd32ca70>
    context 	<HTMLItem(0x7fe2cad4a8d0) issue 30774>
    db 	<roundup.cgi.templating.HTMLDatabase instance at 0x7fe2cad595a8>
    default 	<roundup.cgi.PageTemplates.TALES.Default instance at 0x7fe2cd42d050>
    false 	0
    i18n 	<roundup.cgi.TranslationService.TranslationService instance at 0x7fe2cb47f248>
    loop 	<roundup.cgi.PageTemplates.TALES.SafeMapping instance at 0x7fe2cad595f0>
    nothing 	None
    options 	{'ok_message': [], 'error_message': ['Erreur de modification\xc2\xa0: Cl\xc3\xa9 doc incorrecte : sans']}
    repeat 	<roundup.cgi.PageTemplates.TALES.SafeMapping instance at 0x7fe2cad595f0>
    request 	<HTMLRequest {'_context': None, 'startwith': 0, 'show': <roundup.support.TruthDict instance at 0x7fe2cad59560>, 'classname': 'issue', 'special_char': '@', 'dispname': None, 'group': [], '_client': <roundup.cgi.client.Client instance at 0x7fe2cb45eb48>, 'template': 'item', 'input': <function input_html4 at 0x7fe2cd3d8398>, 'columns': [], 'sort': [], 'env': {'CONTENT_LENGTH': '4030', 'HTTP_AUTHORIZATION': None, 'SERVER_PORT': '8080', 'SERVER_NAME': 'xxxxxxx.com', 'HTTP_COOKIE': 'roundup_session_REX=MTYxNDk2NDQwMy41NjAuMDQwMDI5NjY0NzM0OA', 'HTTP_X_FORWARDED_FOR': '10.107.48.53', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3', 'HTTP_REFERER': 'https://xxxxxx.com/rex/issue30774', 'HTTP_X_FORWARDED_HOST': 'xxxxxxx.com', 'SCRIPT_NAME': '', 'REQUEST_METHOD': 'POST', 'HTTP_HOST': 'xxxxxx.com', 'PATH_INFO': 'issue30774', 'CONTENT_TYPE': 'multipart/form-data; boundary=---------------------------36321429803449636767669947981', 'TRACKER_NAME': 'rex', 'HTTP_ORIGIN': 'https://xxxxxxx.com'}, 'form': FieldStorage(None, None, [FieldStorage('@template', None, 'item'), FieldStorage('title', None, 'foating point error'), FieldStorage('priority', None, '2'), FieldStorage('type', None, '1'), FieldStorage('status', None, '5'), FieldStorage('produit', None, '3'), FieldStorage('version', None, '85'), FieldStorage('nosy', None, 'jerome'), FieldStorage('projet', None, '1'), FieldStorage('validReal', None, 'yes'), FieldStorage('versCible', None, '-1'), FieldStorage('assignedto', None, '728'), FieldStorage('intervenant', None, '3'), FieldStorage('etatIntervenant', None, '3'), FieldStorage('chiffrageCharge', None, '0.5'), FieldStorage('chiffrageDelai', None, '2021-03-25'), FieldStorage('realiseCharge', None, '0.5'), FieldStorage('realiseDelai', None, '2021-03-25'), FieldStorage('validation', None, 'test fourni'), FieldStorage('corrVexpl', None, 'no'), FieldStorage('fauxVexpl', None, ''), FieldStorage('corrVdev', None, 'no'), FieldStorage('fauxVdev', None, ''), FieldStorage('impactDoc', None, 'sans objet'), FieldStorage('nbJours', None, '0.5'), FieldStorage('@note', None, ''), FieldStorage('@file', '', ''), FieldStorage('@file@comment', None, ''), FieldStorage('@lastactivity', None, '2021-03-26.15:30:00'), FieldStorage('@csrf', None, '8df2abf461f1eb851382cd3a88b0b3b6e35eca8519bed2356315b5088bcda918'), FieldStorage('@action', None, 'edit'), FieldStorage('submit_button', None, 'Soumettre les changements')]), 'nodeid': '30774', 'base': 'https://xxxxxxx.com/rex/', 'user': <HTMLItem(0x7fe2cad4a690) user 728>, 'search_text': None, 'pagesize': 50, 'language': ['fr', 'fr_FR', 'en_US', 'en'], 'filterspec': {}, 'filter': [], 'client': <roundup.cgi.client.Client instance at 0x7fe2cb45eb48>}>
    template 	<roundup.cgi.engine_zopetal.RoundupPageTemplate instance at 0x7fe2cb783050>
    templates 	<roundup.cgi.engine_zopetal.Loader instance at 0x7fe2cd426ea8>
    tracker 	<roundup.instance.Tracker instance at 0x7fe2cd32c9e0>
    true 	1
    utils 	<roundup.cgi.templating.TemplatingUtils instance at 0x7fe2cad59518>
    admin 	True
    attrs 	{'tal:condition': 'python:context.chiffrageDelai.isset()', 'name': 'chiffrageDelai', 'tal:attributes': "value python:context.chiffrageDelai.pretty('%Y-%m-%d')"}
    columns_emises 	'priority,type,id,creation,title,creator,produit,version,status'
    columns_enregistres 	'priority,type,id,creation,title,creator,produit,version,assignedto,status'
    columns_showall 	'priority,type,id,creation,title,creator,produit,version,assignedto,status'
    creator 	False
    edit_chif_pipe 	True
    edit_etat_pipe 	True
    edit_issue 	True
    edit_pipe 	True
    edit_real_pipe 	True
    fixer 	True
    inter 	False
    is_edf 	True
    status_notresolved 	'-1,1,2,3,4,5,6,7'
    view_chif_pipe 	True
    view_real_pipe 	True
    Un problème est apparu dans votre modèle « issue.item.html ».

Historique complet :

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/client.py", line 1647, in renderContext
    result = pt.render(self, None, None, **args)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/engine_zopetal.py", line 92, in render
    getEngine().getContext(c), output, tal=1, strictinsert=0)()
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 192, in __call__
    self.interpret(self.program)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 236, in interpret
    handlers[opcode](self, args)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 666, in do_useMacro
    self.interpret(macro)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 236, in interpret
    handlers[opcode](self, args)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 411, in do_optTag_tal
    self.do_optTag(stuff)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 396, in do_optTag
    return self.no_tag(start, program)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 391, in no_tag
    self.interpret(program)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 236, in interpret
    handlers[opcode](self, args)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 689, in do_defineSlot
    self.interpret(slot)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 236, in interpret
    handlers[opcode](self, args)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 632, in do_condition
    self.interpret(block)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 236, in interpret
    handlers[opcode](self, args)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 632, in do_condition
    self.interpret(block)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 236, in interpret
    handlers[opcode](self, args)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 632, in do_condition
    self.interpret(block)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 236, in interpret
    handlers[opcode](self, args)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 632, in do_condition
    self.interpret(block)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 236, in interpret
    handlers[opcode](self, args)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 293, in do_startTag
    ok, name, s = attrAction(self, item)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/TAL/TALInterpreter.py", line 359, in attrAction_tal
    evalue = self.engine.evaluateText(item[3])
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/PageTemplates/TALES.py", line 231, in evaluateText
    text = self.evaluate(expr)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/PageTemplates/TALES.py", line 225, in evaluate
    return expression(self)
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/PageTemplates/PythonExpr.py", line 67, in __call__
    return f()
  File "<string>", line 2, in f
  File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/templating.py", line 1958, in pretty
    return self._value.local(offset).pretty(format)

How can i fix this ?

----------
components: Web interface
messages: 7173
nosy: reda
severity: major
status: new
title: AttributeError: 'str' object has no attribute 'local'
versions: 1.6

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551126>
_________________________________________________


_______________________________________________
Roundup-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/roundup-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.