Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
225eb5ed
Commit
225eb5ed
authored
Jul 29, 2018
by
Nikita Titov
Committed by
Tsukasa OMOTO
Jul 29, 2018
Browse files
[python] open files with utf8 encoding during installation (#1548)
parent
c30ace21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
python-package/setup.py
python-package/setup.py
+3
-2
No files found.
python-package/setup.py
View file @
225eb5ed
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
from
__future__
import
absolute_import
from
__future__
import
absolute_import
import
distutils
import
distutils
import
io
import
logging
import
logging
import
os
import
os
import
shutil
import
shutil
...
@@ -242,8 +243,8 @@ if __name__ == "__main__":
...
@@ -242,8 +243,8 @@ if __name__ == "__main__":
if
os
.
path
.
isfile
(
os
.
path
.
join
(
CURRENT_DIR
,
os
.
path
.
pardir
,
'VERSION.txt'
)):
if
os
.
path
.
isfile
(
os
.
path
.
join
(
CURRENT_DIR
,
os
.
path
.
pardir
,
'VERSION.txt'
)):
distutils
.
file_util
.
copy_file
(
os
.
path
.
join
(
CURRENT_DIR
,
os
.
path
.
pardir
,
'VERSION.txt'
),
distutils
.
file_util
.
copy_file
(
os
.
path
.
join
(
CURRENT_DIR
,
os
.
path
.
pardir
,
'VERSION.txt'
),
os
.
path
.
join
(
CURRENT_DIR
,
'lightgbm'
,
'VERSION.txt'
))
os
.
path
.
join
(
CURRENT_DIR
,
'lightgbm'
,
'VERSION.txt'
))
version
=
open
(
os
.
path
.
join
(
CURRENT_DIR
,
'lightgbm'
,
'VERSION.txt'
)).
read
().
strip
()
version
=
io
.
open
(
os
.
path
.
join
(
CURRENT_DIR
,
'lightgbm'
,
'VERSION.txt'
)
,
encoding
=
'utf-8'
).
read
().
strip
()
readme
=
open
(
os
.
path
.
join
(
CURRENT_DIR
,
'README.rst'
)).
read
()
readme
=
io
.
open
(
os
.
path
.
join
(
CURRENT_DIR
,
'README.rst'
)
,
encoding
=
'utf-8'
).
read
()
sys
.
path
.
insert
(
0
,
CURRENT_DIR
)
sys
.
path
.
insert
(
0
,
CURRENT_DIR
)
...
...
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