Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SickRage-1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
SickRage-1
Commits
12f1a5dd
Commit
12f1a5dd
authored
Jan 5, 2016
by
labrys
Browse files
Options
Downloads
Patches
Plain Diff
Revert codecs.open to io.open
parent
d46fda0f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
SickBeard.py
+2
-1
2 additions, 1 deletion
SickBeard.py
sickbeard/logger.py
+3
-3
3 additions, 3 deletions
sickbeard/logger.py
with
5 additions
and
4 deletions
SickBeard.py
+
2
−
1
View file @
12f1a5dd
...
@@ -52,6 +52,7 @@ from __future__ import print_function
...
@@ -52,6 +52,7 @@ from __future__ import print_function
import
codecs
import
codecs
import
datetime
import
datetime
import
getopt
import
getopt
import
io
import
locale
import
locale
import
os
import
os
import
shutil
import
shutil
...
@@ -419,7 +420,7 @@ class SickRage(object):
...
@@ -419,7 +420,7 @@ class SickRage(object):
logger
.
log
(
'
Writing PID: %s to %s
'
%
(
pid
,
self
.
pid_file
))
logger
.
log
(
'
Writing PID: %s to %s
'
%
(
pid
,
self
.
pid_file
))
try
:
try
:
with
codecs
.
open
(
self
.
pid_file
,
'
w
'
)
as
f_pid
:
with
io
.
open
(
self
.
pid_file
,
'
w
'
)
as
f_pid
:
f_pid
.
write
(
'
%s
\n
'
%
pid
)
f_pid
.
write
(
'
%s
\n
'
%
pid
)
except
EnvironmentError
as
error_message
:
except
EnvironmentError
as
error_message
:
logger
.
log_error_and_exit
(
'
Unable to write PID file: %s Error: %s [%s]
'
%
(
self
.
pid_file
,
error_message
.
strerror
,
error_message
.
errno
))
logger
.
log_error_and_exit
(
'
Unable to write PID file: %s Error: %s [%s]
'
%
(
self
.
pid_file
,
error_message
.
strerror
,
error_message
.
errno
))
...
...
This diff is collapsed.
Click to expand it.
sickbeard/logger.py
+
3
−
3
View file @
12f1a5dd
...
@@ -24,7 +24,7 @@ Custom Logger for SickRage
...
@@ -24,7 +24,7 @@ Custom Logger for SickRage
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
codecs
import
io
import
os
import
os
import
re
import
re
import
sys
import
sys
...
@@ -250,13 +250,13 @@ class Logger(object): # pylint: disable=too-many-instance-attributes
...
@@ -250,13 +250,13 @@ class Logger(object): # pylint: disable=too-many-instance-attributes
log_data
=
None
log_data
=
None
if
ek
(
os
.
path
.
isfile
,
self
.
log_file
):
if
ek
(
os
.
path
.
isfile
,
self
.
log_file
):
with
codecs
.
open
(
self
.
log_file
,
encoding
=
'
utf-8
'
)
as
log_f
:
with
io
.
open
(
self
.
log_file
,
encoding
=
'
utf-8
'
)
as
log_f
:
log_data
=
log_f
.
readlines
()
log_data
=
log_f
.
readlines
()
for
i
in
range
(
1
,
int
(
sickbeard
.
LOG_NR
)):
for
i
in
range
(
1
,
int
(
sickbeard
.
LOG_NR
)):
f_name
=
'
%s.%i
'
%
(
self
.
log_file
,
i
)
f_name
=
'
%s.%i
'
%
(
self
.
log_file
,
i
)
if
ek
(
os
.
path
.
isfile
,
f_name
)
and
(
len
(
log_data
)
<=
500
):
if
ek
(
os
.
path
.
isfile
,
f_name
)
and
(
len
(
log_data
)
<=
500
):
with
codecs
.
open
(
f_name
,
encoding
=
'
utf-8
'
)
as
log_f
:
with
io
.
open
(
f_name
,
encoding
=
'
utf-8
'
)
as
log_f
:
log_data
+=
log_f
.
readlines
()
log_data
+=
log_f
.
readlines
()
log_data
=
[
line
for
line
in
reversed
(
log_data
)]
log_data
=
[
line
for
line
in
reversed
(
log_data
)]
...
...
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