Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic python modules documentation index page broken #14148

Closed
2 tasks done
krushia opened this issue May 19, 2024 · 13 comments · Fixed by #14248
Closed
2 tasks done

Automatic python modules documentation index page broken #14148

krushia opened this issue May 19, 2024 · 13 comments · Fixed by #14248
Labels
Bug This issue or PR is related to a bug Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD

Comments

@krushia
Copy link

krushia commented May 19, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

Help > Automatic python modules documentation Opens browser to sad page.

FreeCAD Documentation
HTMLDoc.heading() takes from 2 to 3 positional arguments but 4 were given

2024-05-18 23 30 20 localhost 8f0808525d99

Full version info

OS: Gentoo Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37358 (Git) AppImage
Build type: Release
Branch: main
Hash: 3a0152b076dd7791c9724c286963d74b5814e24f
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: English/United States (en_US)
Installed mods: 
  * parts_library
  * Curves 0.6.36
  * A2plus 0.4.64a
  * DynamicData 2.62.0
  * Assembly4 0.50.12 (Disabled)
  * Alternate_OpenSCAD 1.0.0 (Disabled)
  * CurvedShapes 1.0.9
  * fasteners 0.5.20
  * SearchBar 1.0.2
  * Nodes 0.1.36 (Disabled)
  * 3D_Printing_Tools
  * workfeature
  * MnesarcoUtils 0.2.5
  * OpenTheme 2024.5.3
  * Manipulator 1.5.7
  * Assembly3 0.12.2
  * lattice2 1.0.0
  * Launcher
  * CommandPanel
  * CubeMenu
  * Reinforcement
  * PieMenu 1.5.0
  * MeshRemodel 1.9.23

Subproject(s) affected?

None

Anything else?

Breaks in same way on native (non-AppImage) 0.21.2 Install.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@maxwxyz
Copy link
Collaborator

maxwxyz commented May 19, 2024

It opens the system browser on my side, everything working as expected with yesterdays weekly. Please report back if this issue still persists.

@maxwxyz maxwxyz closed this as completed May 19, 2024
@krushia
Copy link
Author

krushia commented May 19, 2024

I am using yesterday's weekly.

@maxwxyz
Copy link
Collaborator

maxwxyz commented May 19, 2024

could it be related to general issues with the Appimage?

@maxwxyz maxwxyz reopened this May 19, 2024
@maxwxyz maxwxyz added Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD Missing: confirmation Missing confirmation from other testers Packaging: AppImage AppImage related labels May 19, 2024
@krushia
Copy link
Author

krushia commented May 19, 2024

"heading = pydoc.html.heading("
"'<big><big><strong>Python: Index of Modules</strong></big></big>',"
"'#ffffff', '#7799ee')\n"

Assuming this is the problem, I'm not seeing the 3 arguments here match up with the pydoc function:

https://github.com/python/cpython/blob/30c687cdf8f7073302e92b2b125553d518a94eac/Lib/pydoc.py#L606

@maxwxyz Are you sure this works on your end? Are you on Windows?

@maxwxyz
Copy link
Collaborator

maxwxyz commented May 19, 2024

I'm on Windows, yes.

@krushia krushia changed the title Automatic python modules documentation is broken Automatic python modules documentation index page broken May 19, 2024
@krushia
Copy link
Author

krushia commented May 19, 2024

It seems that specifically the '/' page is broken. http://localhost:7465/

@maxwxyz Can you check that specific URL after summoning Help > Automatic python modules documentation? If that specific page works for you, then there might be a deeper bug between QByteArray and Python. It really shouldn't work with the code I'm seeing.

@maxwxyz
Copy link
Collaborator

maxwxyz commented May 19, 2024

I've wiped my install and downloaded the latest weekly again and now I can reproduce. http://localhost:7465/

@maxwxyz maxwxyz added Bug This issue or PR is related to a bug Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD and removed Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD Missing: confirmation Missing confirmation from other testers Packaging: AppImage AppImage related labels May 19, 2024
@krushia
Copy link
Author

krushia commented May 19, 2024

This is a super easy fix, so I'd like to take a shot at it. Trying to get a working dev environment setup now.

@maxwxyz
Copy link
Collaborator

maxwxyz commented May 20, 2024

Let me know if you have issues, otherwise I can create a PR before the freeze.

@wwmayer
Copy link
Contributor

wwmayer commented May 23, 2024

Works fine with
OS: Ubuntu 22.04.4 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37462 (Git)
Build type: debug
Branch: main
Hash: d126352
Python 3.10.12, Qt 5.15.3, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.1
Locale: German/Germany (de_DE)

Could be related to the Python version. What's the output if you type this into the Python console:

import pydoc
help(pydoc.html.heading)

Here it gives

Help on method heading in module pydoc:

heading(title, fgcol, bgcol, extras='') method of __main__.FreeCADDoc instance
    Format a page heading.

@maxwxyz
Copy link
Collaborator

maxwxyz commented May 23, 2024

@wwmayer Not OP but this is the result when I click the command:
grafik

This is the result:
grafik

@wwmayer
Copy link
Contributor

wwmayer commented May 23, 2024

I have checked the heading() function and two arguments have been dropped. I am working on this right now...

wwmayer added a commit to wwmayer/FreeCAD that referenced this issue May 23, 2024
Fixes FreeCAD#14148: Automatic python modules documentation index page broken
@wwmayer
Copy link
Contributor

wwmayer commented May 24, 2024

The above PR fixes the reported problem but compared to older Python version the HTML output looks a bit poor. Looking at the git history of the pydoc.py module I found this commit https://github.com/python/cpython/commit/c91b6f57f3f75b482e4a9d30ad2afe37892a8ceb that made the move to HTML5

So, in a possible follow-up PR the HTML output could be beautified by using HTML5/css.

wwmayer added a commit that referenced this issue May 24, 2024
Fixes #14148: Automatic python modules documentation index page broken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This issue or PR is related to a bug Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants