Skip to content

Commit

Permalink
Merge pull request #11 from Patreon/master
Browse files Browse the repository at this point in the history
We ran into a 'TypeError: Unicode-objects must be encoded before hashing" when using this in Python 3.6.  Adding 'utf-8' to the decode fixed it.
  • Loading branch information
micktwomey authored May 3, 2019
2 parents c554ad4 + 6c800e3 commit 1f505e6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pytest_circleci/__init__.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.2"
__version__ = "0.0.3"
2 changes: 1 addition & 1 deletion pytest_circleci/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def pytest_collection_modifyitems(session, config, items):
circle_node_total, circle_node_index = read_circleci_env_variables()
deselected = []
for index, item in enumerate(list(items)):
item_location = ':'.join(map(str, item.location)).encode()
item_location = ':'.join(map(str, item.location)).encode('utf-8')
item_hash = int(hashlib.sha1(item_location).hexdigest(), 16)
if (item_hash % circle_node_total) != circle_node_index:
deselected.append(item)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
classifiers=(
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2",
# "Programming Language :: Python :: 3", Not tested yet
"Programming Language :: Python :: 3",
),
)
2 changes: 1 addition & 1 deletion tox.ini
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py34
envlist = py27,py36,py37

[testenv]
deps =
Expand Down

0 comments on commit 1f505e6

Please sign in to comment.