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

always use urljoin #1929

Closed
ReimarBauer opened this issue Aug 24, 2023 · 2 comments · Fixed by #2240
Closed

always use urljoin #1929

ReimarBauer opened this issue Aug 24, 2023 · 2 comments · Fixed by #2240
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers msui
Milestone

Comments

@ReimarBauer
Copy link
Member

ReimarBauer commented Aug 24, 2023

We have various places where + is used instead of urljoin
r = requests.get(self.mscolab_server_url + '/operations

That needs to become refactored

A side effect, when there is no Url, tests show this in python 3.11

tests/_test_msui/test_mscolab_admin_window.py::Test_MscolabAdminWindow::test_add_permissions
  /home/reimar/MASTER/MSS/conftest.py:222: UserWarning: An unhandled message box popped up during your test!
  PyQt5.QtWidgets.QMessageBox.critical(): [call(None, 'fatal error', 'Fatal error in MSS 8.2.0 on Linux-6.2.0-10018-tuxedo-x86_64-with-glibc2.35\nPython 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:08:17) [GCC 12.2.0]\n\nPlease report bugs in MSS to https://github.com/Open-MSS/MSS\n\nInformation about the fatal error:\n\nTraceback (most recent call last):\n  File "/home/reimar/MASTER/MSS/mslib/msui/mscolab.py", line 1395, in render_new_permission\n    r = requests.get(self.mscolab_server_url + \'/user\', data=data, timeout=(2, 10))\n                     ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~\nTypeError: unsupported operand type(s) for +: \'NoneType\' and \'str\'\n')]
    warnings.warn(f"An unhandled message box popped up during your test!\n{summary}")
@ReimarBauer ReimarBauer added the enhancement New feature or request label Aug 24, 2023
@ReimarBauer ReimarBauer added this to the 9.0.0 milestone Aug 24, 2023
@ReimarBauer ReimarBauer added the good first issue Good for newcomers label Feb 23, 2024
@Myrausman
Copy link
Contributor

Can you please assign this issue to me? Also, do I need to modify f'{mscolab_server_url}/test_authorized'?

@ReimarBauer
Copy link
Member Author

Yes also the f' string syntax should use urljoin.
Later when we use os.path/fs.path join methods for files and urljoin for urls it becomes less error-prone.

It gets also much easier to collect all urls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers msui
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants