benbaptist / wrapper.py

Wrapper.py is a Minecraft server wrapper that adds additional features to a vanilla server, including backups, dashboard access, plugins, and more.
http://wrapper.benbaptist.com/
48 stars 2 forks source link

TypeError: __init__() got an unexpected keyword argument 'encoding' #15

Closed Nohet closed 3 years ago

Nohet commented 3 years ago

obraz When i try to start server, this error appears.

suresttexas00 commented 3 years ago

You are using the wrong repo. That is the old minecraft wrapper. It is not supported any longer.

The code you are actually running is from here (old version): https://github.com/benbaptist/minecraft-wrapper You are posting this issue here (this repo): https://github.com/benbaptist/wrapper.py

suresttexas00 commented 3 years ago

No guarantees.. but: you can change the code of wrapper\api\helpers.py: def getjsonfile(filename, directory=".", encodedas="UTF-8"):

Read a json file and return its contents as a dictionary.
:Args:
    :filename: filename without extension.
    :directory: by default, wrapper script directory.
    :encodedas: the encoding
:returns:
    :if successful: a dictionary
    :if unsuccessful:  None/{}
    :File not found: False (any requested directory would be created)
"""
if not os.path.exists(directory):
    mkdir_p(directory)
if os.path.exists("%s/%s.json" % (directory, filename)):
    with open("%s/%s.json" % (directory, filename)) as f:
        try:
            return json.loads(f.read(), encoding=encodedas)  <== CHANGE THIS; REMOVE 'encoding=encodeas'
        except ValueError:
            return None
        #  Exit yielding None (no data)
else:
    return False  # bad directory or filename

Looks like a problem/inconsitency with the windows python for your language/encoding version perhaps...

suresttexas00 commented 3 years ago

@benbaptist you may want to close this and (maybe?) re-open in the old wrapper repo.

benbaptist commented 3 years ago

Oh shoot! My apologies, I don't know how I missed this. Encoding errors are always fun in Python.

I'll close this for now, and if someone would like, they can re-open in the old repo.