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
Problem:
PsychoPy 2022.1.3 does not open .psyexp files for projects that have been pushed to Pavlovia before. I am running PsychoPy on Windows 11, but given the solution to this bug (see below), I assume that the issue should occur on all platforms.
Error Log:
This is the stacktrace from the "last_app_load.log" file when trying to open a respective psyexp file:
Traceback (most recent call last):
File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\exceptions.py", line 304, in wrapped_f
return f(*args, **kwargs)
File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\mixins.py", line 112, in get
server_data = self.gitlab.http_get(path, **kwargs)
File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\client.py", line 662, in http_get
result = self.http_request(
File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\client.py", line 628, in http_request
raise gitlab.exceptions.GitlabHttpError(
gitlab.exceptions.GitlabHttpError: 404: 404 Project Not Found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Program Files\PsychoPy\Lib\site-packages\psychopy\app\psychopyApp.py", line 102, in <module>
main()
File "C:\Program Files\PsychoPy\Lib\site-packages\psychopy\app\psychopyApp.py", line 98, in main
start_app()
File "C:\Program Files\PsychoPy\Lib\site-packages\psychopy\app\psychopyApp.py", line 26, in start_app
app = startApp(showSplash=showSplash)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\__init__.py", line 85, in startApp
_psychopyApp = PsychoPyApp(
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\_psychopyApp.py", line 215, in __init__
self.onInit(testMode=testMode, **kwargs)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\_psychopyApp.py", line 386, in onInit
self.showBuilder(fileList=exps)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\_psychopyApp.py", line 599, in showBuilder
self.newBuilderFrame(fileName=fileName)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\_psychopyApp.py", line 584, in newBuilderFrame
self.builder = BuilderFrame(None, -1,
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py", line 208, in __init__
self.fileOpen(filename=fileName, closeCurrent=False)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py", line 735, in fileOpen
self.project = pavlovia.getProject(filename)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py", line 1253, in getProject
project = session.gitlab.projects.get(name)
File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\v4\objects\projects.py", line 782, in get
return cast(Project, super().get(id=id, lazy=lazy, **kwargs))
File "C:\Program Files\PsychoPy\lib\site-packages\gitlab\exceptions.py", line 306, in wrapped_f
raise error(e.error_message, e.response_code, e.response_body) from e
gitlab.exceptions.GitlabGetError: 404: 404 Project Not Found
Reason:
I identified two bugs that caused the issue for me.
BUG 1:
too restrictive re.match pattern in pavlovia.py
SOLUTION FOR BUG 1:
In file: C:\Program Files\PsychoPy\Lib\site-packages\psychopy\projects\pavlovia.py
WITH url = re.match("https:\/\/gitlab\.pavlovia\.org\/[\w\.]*\/[\w\.]*\.git", stdout)
REASON FOR ERROR:
My username contains a dot (frank.papenmeier), which was not covered by \w
BUG 2:
if projects.json in AppData\Roaming\psychopy3\pavlovia\ does not contain the project, getting the project info via gitlab fails, because user is not logged in, resulting in the "404 Project Not Found" error message
SOLUTION FOR BUG 2:
In file: C:\Program Files\PsychoPy\Lib\site-packages\psychopy\projects\pavlovia.py
ADD AFTER LINE 1252 (and thus right before the following command "project = session.gitlab.projects.get(name)" that would otherwise fail:
if not session.user:
nameSpace = name.split('/')[0]
if nameSpace in knownUsers: # Log in if user is known
login(nameSpace, rememberMe=True)
thus the corrected code at the respective section looks as follows:
if nameSearch is not None:
name = nameSearch.group(0)
if not session.user:
nameSpace = name.split('/')[0]
if nameSpace in knownUsers: # Log in if user is known
login(nameSpace, rememberMe=True)
project = session.gitlab.projects.get(name)
return PavloviaProject(project.id)
I took the code block for logging into Pavlovia from an older version of pavlovia.py. This version also contained multiple additional ways of looking through further known users, which I thought is not required and thus left out.
The text was updated successfully, but these errors were encountered:
TEParsons
added a commit
to TEParsons/psychopy
that referenced
this issue
May 9, 2022
Problem:
PsychoPy 2022.1.3 does not open .psyexp files for projects that have been pushed to Pavlovia before. I am running PsychoPy on Windows 11, but given the solution to this bug (see below), I assume that the issue should occur on all platforms.
Error Log:
This is the stacktrace from the "last_app_load.log" file when trying to open a respective psyexp file:
Reason:
I identified two bugs that caused the issue for me.
BUG 1:
too restrictive re.match pattern in pavlovia.py
SOLUTION FOR BUG 1:
In file: C:\Program Files\PsychoPy\Lib\site-packages\psychopy\projects\pavlovia.py
LINE 1201
REPLACE
url = re.match("https:\/\/gitlab\.pavlovia\.org\/\w*\/\w*\.git", stdout)
WITH
url = re.match("https:\/\/gitlab\.pavlovia\.org\/[\w\.]*\/[\w\.]*\.git", stdout)
REASON FOR ERROR:
My username contains a dot (frank.papenmeier), which was not covered by \w
BUG 2:
if projects.json in AppData\Roaming\psychopy3\pavlovia\ does not contain the project, getting the project info via gitlab fails, because user is not logged in, resulting in the "404 Project Not Found" error message
SOLUTION FOR BUG 2:
In file: C:\Program Files\PsychoPy\Lib\site-packages\psychopy\projects\pavlovia.py
ADD AFTER LINE 1252 (and thus right before the following command "project = session.gitlab.projects.get(name)" that would otherwise fail:
thus the corrected code at the respective section looks as follows:
I took the code block for logging into Pavlovia from an older version of pavlovia.py. This version also contained multiple additional ways of looking through further known users, which I thought is not required and thus left out.
The text was updated successfully, but these errors were encountered: