Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode decode error when loading data for 1.19.2 on windows re #25 #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/history.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.45.0
* Update minecraft-data to 3.45.0
* UnicodeDecodeError when loading data for some minecraft versions on windows

## 3.20.0
* Update minecraft-data to 3.20.0

Expand Down
2 changes: 1 addition & 1 deletion minecraft_data/data
Submodule data updated 204 files
6 changes: 3 additions & 3 deletions minecraft_data/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def convert(_dir, version, edition ='pc'):
with open(os.path.join(_dir, 'dataPaths.json')) as f:
with open(os.path.join(_dir, 'dataPaths.json'), encoding='utf-8') as f:
datapaths = json.load(f)
data = _grabdata(_dir, datapaths[edition][version])
ret = {}
Expand Down Expand Up @@ -49,7 +49,7 @@ def commondata(_dir, edition = 'pc'):
common_path = os.path.join(_dir, edition, 'common')
for common_file in os.listdir(common_path):
key = common_file.split('.', 1)[0]
with open(os.path.join(common_path, common_file)) as f:
with open(os.path.join(common_path, common_file), encoding='utf-8') as f:
data = json.load(f)
ret.update({key: data})
return ret
Expand All @@ -60,7 +60,7 @@ def _grabdata(_dir, datapaths):
for category, folder in datapaths.items():
path = os.path.join(_dir, folder, f'{category}.json')
if os.path.isfile(path):
with open(path) as fp:
with open(path, encoding='utf-8') as fp:
data[category] = json.load(fp)
return data

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def package_files(directory):
description='Provide easy access to minecraft data in python',
license='MIT',
long_description=open('README.rst').read(),
version='3.20.0',
version='3.45.0',
maintainer='Vito Gamberini',
maintainer_email='[email protected]',
url='https://github.com/SpockBotMC/python-minecraft-data',
Expand Down