You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem:
On the Builder, when I click "Pavlovia.org -> User -> Log in to Pavlovia...", I get the following error message.
Traceback (most recent call last):
File "/home/johnmcbride/.local/lib/python3.8/site-packages/psychopy/app/pavlovia_ui/menu.py", line 121, in onLogInPavlovia
logInPavlovia(parent=self.parent)
File "/home/johnmcbride/.local/lib/python3.8/site-packages/psychopy/app/pavlovia_ui/functions.py", line 93, in logInPavlovia
dlg = PavloviaMiniBrowser(parent=parent, loginOnly=True)
File "/home/johnmcbride/.local/lib/python3.8/site-packages/psychopy/app/pavlovia_ui/_base.py", line 79, in init
self.user = pavlovia.getCurrentSession().user
File "/home/johnmcbride/.local/lib/python3.8/site-packages/psychopy/projects/pavlovia.py", line 442, in user
if not hasattr(self.gitlab, "user") or self.gitlab.user.username is None:
AttributeError: 'NoneType' object has no attribute 'username'
I am new to using the Builder, so, this is my first time trying to log in to Pavlovia through the Builder. This problem occurred first while I was using psychopy version 2022.2; the problem persists after installing the latest (2023.1) version.
Upon inspection of "./psychopy/projects/pavlovia.py", it looks like line 442 might have a bug. When a PavloviaSession class is initialized without a token, self.gitlab.user is initialized as "None" (I checked that this is the case). Hence, line 442 "if not hasattr(self.gitlab, "user") or self.gitlab.user.username is None" will throw an error in this case.
In my case, the problem is solved by replacing lines 442-444 with the following: try: self._user = User(self.gitlab.user.username) except: return None
The text was updated successfully, but these errors were encountered:
Thanks for catching this and for doing the legwork to track it down! Your solution seems reasonable - only thing is that we try to avoid using except without catching a specific exception type, so I think except AttributeError is better in this case. I'll apply your fix and put in a PR now :)
TEParsons
added
💻 app/ui
PsychoPy app changes (often wxPython issues)
🐞 bug
Issue describes a bug (crash or error) or undefined behavior.
labels
Mar 15, 2023
Description of the problem:
On the Builder, when I click "Pavlovia.org -> User -> Log in to Pavlovia...", I get the following error message.
Traceback (most recent call last):
File "/home/johnmcbride/.local/lib/python3.8/site-packages/psychopy/app/pavlovia_ui/menu.py", line 121, in onLogInPavlovia
logInPavlovia(parent=self.parent)
File "/home/johnmcbride/.local/lib/python3.8/site-packages/psychopy/app/pavlovia_ui/functions.py", line 93, in logInPavlovia
dlg = PavloviaMiniBrowser(parent=parent, loginOnly=True)
File "/home/johnmcbride/.local/lib/python3.8/site-packages/psychopy/app/pavlovia_ui/_base.py", line 79, in init
self.user = pavlovia.getCurrentSession().user
File "/home/johnmcbride/.local/lib/python3.8/site-packages/psychopy/projects/pavlovia.py", line 442, in user
if not hasattr(self.gitlab, "user") or self.gitlab.user.username is None:
AttributeError: 'NoneType' object has no attribute 'username'
I am new to using the Builder, so, this is my first time trying to log in to Pavlovia through the Builder. This problem occurred first while I was using psychopy version 2022.2; the problem persists after installing the latest (2023.1) version.
Upon inspection of "./psychopy/projects/pavlovia.py", it looks like line 442 might have a bug. When a PavloviaSession class is initialized without a token, self.gitlab.user is initialized as "None" (I checked that this is the case). Hence, line 442 "if not hasattr(self.gitlab, "user") or self.gitlab.user.username is None" will throw an error in this case.
In my case, the problem is solved by replacing lines 442-444 with the following:
try: self._user = User(self.gitlab.user.username) except: return None
The text was updated successfully, but these errors were encountered: