Skip to content

webrepl_cli.py fails with Python 2.7 #3

Closed
@wendlers

Description

@wendlers

When trying to run "./webrepl_cli.py", and the default Python executable is Python 2.7, the following error is shown:

$ python -V
Python 2.7.10
$ webrepl/webrepl_cli.py test.py 192.168.0.123:/test.py
('put', '192.168.0.123', 8266)
('test.py', '->', '/test.py')
Traceback (most recent call last):
  File "webrepl/webrepl_cli.py", line 204, in <module>
    main()
  File "webrepl/webrepl_cli.py", line 198, in main
    put_file(ws, src_file, dst_file)
  File "webrepl/webrepl_cli.py", line 93, in put_file
    dest_fname = bytes(SANDBOX + remote_file, "utf-8")
TypeError: str() takes at most 1 argument (2 given)[/quote]

I think the problem is, that "byte" on Python 2.7 does not allow the second parameter for the encoding.

Something that works on both might be:

dest_fname = bytes((SANDBOX + remote_file).encode("utf-8"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions