In the maple version: overhangio/openedx:13.2.2
(prod & staging)
I’m trying to import a staff graded points spreadsheet, but I always get the message:
File "/openedx/venv/lib/python3.8/site-packages/botocore/handlers.py", line 209, in conditionally_calculate_md5,
calculate_md5(params, **kwargs),
File "/openedx/venv/lib/python3.8/site-packages/botocore/handlers.py", line 187, in calculate_md5,
binary_md5 = _calculate_md5_from_file(body),
File "/openedx/venv/lib/python3.8/site-packages/botocore/handlers.py", line 201, in _calculate_md5_from_file,
md5.update(chunk),
TypeError: Unicode-objects must be encoded before hashing,
Versions used of the responsible libraries:
boto 2.39.0
boto3 1.4.8
botocore 1.8.17
staff-graded-xblock 1.6.0
super-csv 2.1.1
The strange thing is that, in the same file that is exported by OpenedX, within the plugin itself, I just change the New points
column to 1, as in the example:
user_id,username,full_name,student_uid,enrolled,track,cohort,block_id,title,date_last_graded,who_last_graded,Previous Points,New Points
125753,zeuser,zename,,True,audit,,block-v1:migration_test+CALIF+2024_07+type@staffgradedxblock+block@e83ee91ab56c4386a9358feab3ae7238,Staff Graded Points,,,,1
I had done a test of taking this same file, converting it to utf8 on some random website, however, I got the following result:
<csv.DictReader object at 0x7fb2cb7c5ee0>,
columns:::::: ['\ufeffuser_id', 'username', 'full_name', 'student_uid', 'enrolled', 'track', 'cohort', 'block_id', 'title', 'date_last_graded', 'who_last_graded', 'Previous Points', 'New Points'],
Missing column: user_id
Error: super-csv/super_csv/csv_processor.py at 2.1.1 · openedx/super-csv · GitHub
In another environment (dev), the encoding problem does not occur, and the following result is returned after uploading within the CMS, however, the course progress is also not counted:
{
"total": 0,
"processed": 0,
"saved": 0,
"error_rows": [],
"error_messages": [],
"percentage": "0.0%",
"can_commit": false,
"result_id": null,
"saved_error_id": null,
"waiting": false
}
Notes:
- All environments run the same image
- The difference between the environments is the amount of resources
Link for reference [python - How to correct TypeError: Unicode-objects must be encoded before hashing? - Stack Overflow]
Plugin responsible for “staff_graded”: [GitHub - openedx/staff_graded-xblock: Staff Graded Points XBlock]
Dependency on the “staff grade” plugin in open edX: [edx-platform/requirements/edx/base.txt at open-release/maple.master · openedx/edx-platform · GitHub]
Entry gate during upload: [staff_graded-xblock/staff_graded/staff_graded.py at master · openedx/staff_graded-xblock · GitHub]
What am I doing wrong?
Why is the plugin internally unable to handle the received encoding?
I appreciate any help or advice in advance.