Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix #12340 - Reload site to pick up new expressions package
- Loading branch information
738838a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the PyQgsAppStartup test fails since this commit.
(We should really get a green state again... it's a pain to find commits breaking stuff at the moment)
738838a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
738838a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
738838a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not even sure why it's failing because doing it manually on the command line works as expected.
738838a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
738838a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
738838a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
738838a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
738838a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this fix... I do not understand why import + reload of site module should help. The site module is imported automatically when python starts and the docs do not suggest it is meant to be explicitly imported... It also imports sitecustomize module which may be doing some distro specific initialization (and some distros may not like to do it twice?). Finally I find the reload() function not very straightforward - this is a good reading: http://pyunit.sourceforge.net/notes/reloading.html
Maybe it would be enough to clear sys.path_importer_cache for the user's python directory?
738838a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I will have a look into a better solution.