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 177
    • Issues 177
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 49
    • Merge Requests 49
  • 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
  • Wiki
  • porting python3

porting python3

Last edited by ntome Mar 23, 2018
Page history

The weboob core is compatible with both Python 2 and Python 3. Weboob commands can thus be run with Python 3. The limitation is that some modules are not compatible with Python 3 yet, so they must be ported.

A few tips for porting them to Python 2/Python 3 compatibility:

  • Browser 1 (weboob.deprecated.*) is not compatible with Python 3, use Browser 2 (weboob.browser.*)
  • It's strongly recommended to use from __future__ import unicode_literals, division, absolute_import
  • Don't import urllib, urlparse, use weboob.tools.compat which contains the functions you want
  • For dicts, don't use iteritems, itervalues but items, values
  • Be careful with bytes/unicode confusion. You can import basestring or unicode aliases from weboob.tools.compat

To test porting:

  • if your weboob installation isn't in Python 3 by default, run python3 $(which boobank) -b your_module, replace boobank by the weboob command you want to use and your_module by the module to port

  • run all sub-commands you would normally use with the module

  • declare the module name in tools/py3-compatible.modules (and git-add this modification to the porting commit)

  • run tools/pyflakes.sh -3

Clone repository
  • bank model
  • boobathon 201804
  • boobathon 201911
  • cli tools shell
  • cli tools
  • config files
  • draft maintainer setup
  • faq
  • fr
    • guide scraping
    • guide weboob
  • Home
  • installing weboob on synology (debian chroot method)
  • installing weboob on synology (opkg method)
  • lecture 2010 07 09
  • lecture 2012 12 29
More Pages