Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
weboob
weboob
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 178
    • Issues 178
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 52
    • Merge Requests 52
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • weboob
  • weboobweboob
  • Issues
  • #402

Closed
Open
Opened Jun 08, 2020 by Mathieu Clabaut@matclab
  • Report abuse
  • New issue
Report abuse New issue

lcl : str is not callable

Adding some debug information, the exception come from .local/share/weboob/modules/2.0/lcl/compat/weboob_browser_filters_standard.py line 86. The snippet is:

        try:
            v = Decimal(text)
            if self.sign:
                v *= self.sign(original_text)
           return v
        except InvalidOperation as e:
            return self.default_or_raise(NumberFormatError(e))
        else:
            if self.sign is not None:
                if callable(self.sign):
                    v *= self.sign(original_text)
                elif self.sign == '+':
                    return abs(v)
                elif self.sign == '-':
                    return -abs(v)
                else:
                    raise TypeError("'sign' should be a callable or a sign string")
            return v

And indeed the 3rd to 5th lines may raise an exception whereas the same code exists in the else section which properly take into account the case where self.sign is a string.

Commenting the following code seems to solve the problem:

        try:
            v = Decimal(text)
#            if self.sign:
#                v *= self.sign(original_text)
#           return v
        except InvalidOperation as e:
            return self.default_or_raise(NumberFormatError(e))
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: weboob/weboob#402