Fix tgcf-web command compatibility with Python 3.12 #636
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before Creating a pull request, please read the contributing guidelines thoroughly.
Below is a suggested pull request description in English:
Title:
Fix tgcf-web command compatibility with Python 3.12
Description:
This patch addresses an issue with the tgcf-web command when running on Python 3.12.
Problem:
The tgcf-web command previously used
importlib.resources.path()with an empty string to obtain the package directory, which caused aStopIterationerror in Python 3.12. Subsequent attempts to convert the returned object withos.fspath()or to usewu.__file__failed becausewu.__file__returnedNone.Implemented Solution:
run.pyfile itself using the__file__attribute.Testing:
After the change, the tgcf-web command executed successfully, launching the Streamlit server without any errors.
I have fully read and understood the terms and conditions laid down in the general Contributor License Agreement