Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
40d9a683
Commit
40d9a683
authored
5 years ago
by
Awais Qureshi
Browse files
Options
Downloads
Patches
Plain Diff
PROD-692
Fixing python3
parent
c4796b12
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cms/djangoapps/contentstore/tasks.py
+4
-3
4 additions, 3 deletions
cms/djangoapps/contentstore/tasks.py
with
4 additions
and
3 deletions
cms/djangoapps/contentstore/tasks.py
+
4
−
3
View file @
40d9a683
...
...
@@ -12,6 +12,7 @@ from datetime import datetime
from
math
import
ceil
from
tempfile
import
NamedTemporaryFile
,
mkdtemp
import
six
from
celery
import
group
from
celery.task
import
task
from
celery.utils.log
import
get_task_logger
...
...
@@ -749,8 +750,8 @@ def import_olx(self, user_id, course_key_string, archive_path, archive_name, lan
# Locate the uploaded OLX archive (and download it from S3 if necessary)
# Do everything in a try-except block to make sure everything is properly cleaned up.
data_root
=
path
(
settings
.
GITHUB_REPO_ROOT
)
subdir
=
base64
.
urlsafe_b64encode
(
repr
(
courselike_key
))
course_dir
=
data_root
/
subdir
subdir
=
base64
.
urlsafe_b64encode
(
six
.
b
(
repr
(
courselike_key
))
)
course_dir
=
data_root
/
subdir
.
decode
(
'
utf-8
'
)
try
:
self
.
status
.
set_state
(
u
'
Unpacking
'
)
...
...
@@ -811,7 +812,7 @@ def import_olx(self, user_id, course_key_string, archive_path, archive_name, lan
try
:
tar_file
=
tarfile
.
open
(
temp_filepath
)
try
:
safetar_extractall
(
tar_file
,
(
course_dir
+
u
'
/
'
)
.
encode
(
u
'
utf-8
'
)
)
safetar_extractall
(
tar_file
,
(
course_dir
+
u
'
/
'
))
except
SuspiciousOperation
as
exc
:
LOGGER
.
info
(
u
'
Course import %s: Unsafe tar file - %s
'
,
courselike_key
,
exc
.
args
[
0
])
with
respect_language
(
language
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment