-
Notifications
You must be signed in to change notification settings - Fork 0
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
create logs in temp directory #51
Conversation
@lindakladivova Any progress? |
I think that this PR already fixes the issue in the way that it creates the default log directory in the Temporary directory. There is actually the @log_adresar.setter but the problem is that for some reason Sphinx only read the documentation for the @Property method, not the @property.setter one at all (please see https://stackoverflow.com/questions/71713284/types-of-setter-arguments-not-showing-in-sphinx-documentation). I have added the logger info message to the setter and extended the documentation. |
Btw WSDP test services are in maintenance till the 28th so pytest fails (https://www.cuzk.cz/Aplikace-DP-do-KN/Aplikace-DP-do-KN/Archiv-DP.aspx). |
f7429ac
to
dc70942
Compare
@lindakladivova I tested PR in Python 3.11. There is a warning which should be nice to avoid before merging: warning:/usr/lib/python3.11/tempfile.py:1034: ResourceWarning: Implicitly cleaning up
_warnings.warn(warn_message, ResourceWarning)
traceback: File "/home/martin/git/ctu-geoforall-lab/qgis-vfk-plugin/../qgis-vfk-plugin/mainApp.py", line 259, in runDownloadingPosidents
ctios = CtiOS([
File "/home/martin/git/ctu-geoforall-lab/qgis-vfk-plugin/../qgis-vfk-plugin/pywsdp/modules/CtiOS/__init__.py", line 50, in __init__
super().__init__(creds, trial=trial)
File "/home/martin/git/ctu-geoforall-lab/qgis-vfk-plugin/../qgis-vfk-plugin/pywsdp/base/__init__.py", line 42, in __init__
self._log_adresar = self._set_default_log_dir()
File "/home/martin/git/ctu-geoforall-lab/qgis-vfk-plugin/../qgis-vfk-plugin/pywsdp/base/__init__.py", line 105, in _set_default_log_dir
log_dir = tempfile.TemporaryDirectory().name
File "/usr/lib/python3.11/weakref.py", line 590, in __call__
return info.func(*info.args, **(info.kwargs or {}))
File "/usr/lib/python3.11/tempfile.py", line 1034, in _cleanup
_warnings.warn(warn_message, ResourceWarning) |
Probably the best way how to avoid this is not to use |
9b7688d
to
853bead
Compare
853bead
to
09bc083
Compare
@lindakladivova I tested PR and it's ready to be merged. Please create |
Creating logs in installation dependent directory
__file__/../..
may cause problems due to missing write permissions. Using pywsdp library in QGIS plugin on Windows leads to error message below:This draft PR creates logs in temporary directory instead of installation dependent path.
Tasks before merging: