Skip to content

Commit a8139a5

Browse files
committed
Merge pull request #478 from basho/features/lrb/encoding-gh-476
Use default Python file encoding during test / release process
2 parents e882bc2 + 5e5c550 commit a8139a5

File tree

5 files changed

+38
-5
lines changed

5 files changed

+38
-5
lines changed

Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
.PHONY: pb_clean pb_compile pb_build release release_sdist
1+
.PHONY: pb_clean pb_compile pb_build release release_sdist test_sdist
2+
3+
unexport LANG
4+
unexport LC_ADDRESS
5+
unexport LC_COLLATE
6+
unexport LC_CTYPE
7+
unexport LC_IDENTIFICATION
8+
unexport LC_MEASUREMENT
9+
unexport LC_MESSAGES
10+
unexport LC_MONETARY
11+
unexport LC_NAME
12+
unexport LC_NUMERIC
13+
unexport LC_PAPER
14+
unexport LC_TELEPHONE
15+
unexport LC_TIME
216

317
PANDOC_VERSION := $(shell pandoc --version)
418

@@ -13,6 +27,9 @@ pb_compile: pb_clean
1327
@protoc -Iriak_pb/src --python_out=riak/pb riak_pb/src/*.proto
1428
@python setup.py build_messages
1529

30+
test_sdist:
31+
@python setup.py sdist
32+
1633
release_sdist:
1734
ifeq ($(VERSION),)
1835
$(error VERSION must be set to build a release and deploy this package)

buildbot/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ $(error RIAK_DIR is not set)
33
endif
44

55
unexport PYENV_VERSION
6+
unexport LANG
7+
unexport LC_ADDRESS
8+
unexport LC_COLLATE
9+
unexport LC_CTYPE
10+
unexport LC_IDENTIFICATION
11+
unexport LC_MEASUREMENT
12+
unexport LC_MESSAGES
13+
unexport LC_MONETARY
14+
unexport LC_NAME
15+
unexport LC_NUMERIC
16+
unexport LC_PAPER
17+
unexport LC_TELEPHONE
18+
unexport LC_TIME
619

720
PROJDIR = $(realpath $(CURDIR)/..)
821
TOOLS_DIR = $(PROJDIR)/tools/devrel

riak/security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def _cached_cert(self, key, loader):
254254
if not isinstance(key_file, list):
255255
key_file = [key_file]
256256
for filename in key_file:
257-
with open(filename, 'r') as f:
257+
with open(filename, 'rb') as f:
258258
cert_list.append(loader(OpenSSL.SSL.FILETYPE_PEM,
259259
f.read()))
260260
# If it is not a list, just store the first element

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
install_requires.append('python3_protobuf >=2.4.1, <2.6.0')
2222
requires.append('python3_protobuf(>=2.4.1, <2.6.0)')
2323

24+
with codecs.open('README.md', 'r', 'utf-8') as f:
25+
readme_md = f.read()
26+
2427
try:
2528
import pypandoc
2629
long_description = pypandoc.convert('README.md', 'rst')
2730
with codecs.open('README.rst', 'w', 'utf-8') as f:
2831
f.write(long_description)
2932
except(IOError, ImportError):
30-
with codecs.open('README.md', 'r', 'utf-8') as f:
31-
long_description = f.read()
33+
long_description = readme_md
3234

3335
setup(
3436
name='riak',

version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def get_version():
8080

8181
else:
8282
# Extract the version from the PKG-INFO file.
83-
with open(join(d, 'PKG-INFO')) as f:
83+
import codecs
84+
with codecs.open(join(d, 'PKG-INFO'), 'r', 'utf-8') as f:
8485
version = version_re.search(f.read()).group(1)
8586

8687
return version

0 commit comments

Comments
 (0)