Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 835331 - media-gfx/freecad sets PYTHONPATH environment variable
Summary: media-gfx/freecad sets PYTHONPATH environment variable
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Bernd
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2022-03-15 09:58 UTC by Stephen Bosch
Modified: 2022-04-06 07:45 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Bosch 2022-03-15 09:58:28 UTC
media-gfx/freecad sets the PYTHONPATH environment variable globally. Some other packages, such as games-puzzle/brainworkshop, honour this variable. This can lead to fatal execution errors.

Reproducible: Always

Steps to Reproduce:
1. Install media-gfx/freecad-0.19.2-r6
2. Install games-puzzle/brainworkshop
3. Start games-puzzle/brainworkshop
Actual Results:  
Actual output and behaviour:

/usr/bin/brainworkshop:44: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import random, os, sys, imp, socket, webbrowser, time, math, traceback, datetime, errno
python3.9: /var/tmp/portage/media-gfx/freecad-0.19.2-r6/work/FreeCAD-0.19.2/src/Base/BaseClass.cpp:97: static void Base::BaseClass::initSubclass(Base::Type&, const char*, const char*, Base::Type::instantiationMethod): Assertion `parentType != Base::Type::badType()' failed.

Expected Results:  
Expected output and behaviour:

/usr/bin/brainworkshop:44: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import random, os, sys, imp, socket, webbrowser, time, math, traceback, datetime, errno

and brainworkshop starts normally.

If I unset PYTHONPATH:

$ unset PYTHONPATH

both freecad and brainworkshop start normally.

Is it really necessary to set this variable?
Comment 1 Bernd 2022-03-16 06:05:25 UTC
Thanks for the report.

In earlier versions, the variable was needed, or freecad would not start properly, but it looks like that's no longer the case. Running the internal test suite, leads to the same results with and without the variable set, so I assume it's indeed no longer needed.

I'm gonna remove it from the package.
Comment 2 Larry the Git Cow gentoo-dev 2022-03-19 16:15:05 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5927fa068889aa555a1f9657e27305eb11ffae37

commit 5927fa068889aa555a1f9657e27305eb11ffae37
Author:     Bernd Waibel <waebbl-gentoo@posteo.net>
AuthorDate: 2022-03-18 09:12:08 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-03-19 16:14:22 +0000

    media-gfx/freecad: drop environment file
    
    Setting PYTHONPATH seems no longer be needed and raises incompatibilities
    with other packages.
    
    Also, AddonManager plugin now needs webchannel and webengine support for pyside2,
    thus the USEDEP string has been updated to include USE flags for these.
    
    Bug: https://bugs.gentoo.org/835331
    Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
    Closes: https://github.com/gentoo/gentoo/pull/24636
    Signed-off-by: Sam James <sam@gentoo.org>

 media-gfx/freecad/files/99freecad                                     | 1 -
 .../freecad/{freecad-0.19.2-r6.ebuild => freecad-0.19.2-r7.ebuild}    | 2 --
 media-gfx/freecad/freecad-9999.ebuild                                 | 4 +---
 3 files changed, 1 insertion(+), 6 deletions(-)
Comment 3 Bernd 2022-04-06 07:45:04 UTC
Falsly used the Bug tag instead of CLosed in the above PR.
Closing the bug. Feel free to re-open, if you think that's wrong.