No python module documentation on py3 builds?

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

No python module documentation on py3 builds?

Post by reox »

I get this error when opening the automated python documentation in the webbrowser:

Code: Select all

module 'string' has no attribute 'join'
Is this an issue caused by py3? Do I need to add something to the cmake cmdline to make it work?

Code: Select all

OS: Debian GNU/Linux buster/sid
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16146 (Git)
Build type: Release
Branch: master
Hash: 3cf15c014bec8a7a7fa56fdf0adf1402c724d788
Python version: 3.7.3rc1
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Austria (de_AT)
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: No python module documentation on py3 builds?

Post by looo »

wmayer
Founder
Posts: 20323
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: No python module documentation on py3 builds?

Post by wmayer »

git commit 34715640322b

Code: Select all

''.join(indices)
This is not correct because by default the second argument of string.join is a character with a single space, not an empty string.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: No python module documentation on py3 builds?

Post by looo »

sorry :oops: and thanks for having a look.
wmayer
Founder
Posts: 20323
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: No python module documentation on py3 builds?

Post by wmayer »

looo wrote: Mon Mar 18, 2019 1:17 pm sorry :oops: and thanks for having a look.
No problem. Before I have seen your PR I have fixed it already.
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: No python module documentation on py3 builds?

Post by reox »

wmayer wrote: Mon Mar 18, 2019 11:23 am git commit 34715640322b
I can confirm it works now! Thanks!

edit: no wait, there is something else. When I visit http://localhost:7465/FreeCADGui.html I get this error:

Code: Select all

the signature for "getSoDBVersion" should exist
indeed, checking on the python console:

Code: Select all

>>> help(FreeCADGui.getSoDBVersion)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/bin/../lib/python3.7/_sitebuiltins.py", line 103, in __call__
    return pydoc.help(*args, **kwds)
  File "/usr/lib/python3.7/pydoc.py", line 1900, in __call__
    self.help(request)
  File "/usr/lib/python3.7/pydoc.py", line 1959, in help
    else: doc(request, 'Help on %s:', output=self._output)
  File "/usr/lib/python3.7/pydoc.py", line 1679, in doc
    pager(render_doc(thing, title, forceload))
  File "/usr/lib/python3.7/pydoc.py", line 1672, in render_doc
    return title % desc + '\n\n' + renderer.document(object, name)
  File "/usr/lib/python3.7/pydoc.py", line 391, in document
    if inspect.isroutine(object): return self.docroutine(*args)
  File "/usr/lib/python3.7/pydoc.py", line 1389, in docroutine
    signature = inspect.signature(object)
  File "/usr/lib/python3.7/inspect.py", line 3083, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "/usr/lib/python3.7/inspect.py", line 2833, in from_callable
    follow_wrapper_chains=follow_wrapped)
  File "/usr/lib/python3.7/inspect.py", line 2238, in _signature_from_callable
    sig = obj.__signature__
SystemError: the signature for "getSoDBVersion" should exist
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: No python module documentation on py3 builds?

Post by looo »

Sounds like we should provide a __signature__.
Post Reply