Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
c27805b4
Commit
c27805b4
authored
Apr 10, 2018
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix Updater python3
Bugfix Updater in case of error
parent
ee4ec8b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
helper.py
cps/helper.py
+3
-2
No files found.
cps/helper.py
View file @
c27805b4
...
...
@@ -13,6 +13,7 @@ import os
import
traceback
import
re
import
unicodedata
from
io
import
BytesIO
try
:
from
StringIO
import
StringIO
...
...
@@ -386,7 +387,7 @@ class Updater(threading.Thread):
r
=
requests
.
get
(
'https://api.github.com/repos/janeczku/calibre-web/zipball/master'
,
stream
=
True
)
fname
=
re
.
findall
(
"filename=(.+)"
,
r
.
headers
[
'content-disposition'
])[
0
]
self
.
status
=
2
z
=
zipfile
.
ZipFile
(
String
IO
(
r
.
content
))
z
=
zipfile
.
ZipFile
(
Bytes
IO
(
r
.
content
))
self
.
status
=
3
tmp_dir
=
gettempdir
()
z
.
extractall
(
tmp_dir
)
...
...
@@ -481,7 +482,7 @@ class Updater(threading.Thread):
if
change_permissions
:
try
:
os
.
chown
(
dst_file
,
permission
.
st_uid
,
permission
.
st_gid
)
except
Exception
:
except
(
Exception
)
as
e
:
# ex = sys.exc_info()
old_permissions
=
os
.
stat
(
dst_file
)
logging
.
getLogger
(
'cps.web'
)
.
debug
(
'Fail change permissions of '
+
str
(
dst_file
)
+
'. Before: '
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment