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

experiment-cli -a raises a TypeError #4

Closed
cladmi opened this issue Sep 25, 2014 · 3 comments
Closed

experiment-cli -a raises a TypeError #4

cladmi opened this issue Sep 25, 2014 · 3 comments

Comments

@cladmi
Copy link
Member

cladmi commented Sep 25, 2014

$ experiment-cli get -a -i 7959
Traceback (most recent call last):
  File "/home/harter/work/iot-lab/parts/cli-tools/experiment-cli", line 4, in <module>
    experiment_parser.main()
  File "/home/harter/work/iot-lab/parts/cli-tools/iotlabcli/experiment_parser.py", line 405, in main
    get_experiment(parser_options, request, parser)
  File "/home/harter/work/iot-lab/parts/cli-tools/iotlabcli/experiment_parser.py", line 311, in get_experiment
    data = request.get_experiment_archive(experiment_id)
  File "/home/harter/work/iot-lab/parts/cli-tools/iotlabcli/rest.py", line 190, in get_experiment_archive
    return self.method('experiments/%s?data' % expid)
  File "/home/harter/work/iot-lab/parts/cli-tools/iotlabcli/rest.py", line 57, in method
    return req.text
  File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 824, in text
    content = str(self.content, encoding, errors='replace')
TypeError: unicode() argument 2 must be string, not None

Should investigate on versions and all.

@fambon
Copy link
Collaborator

fambon commented Sep 26, 2014

Fails with production 1.3.1, with different stacktrace though.

fambon@carolus:~$ experiment-cli -v
1.3.1
fambon@carolus:~$ which experiment-cli 
/usr/local/bin/experiment-cli

fambon@carolus:~$ experiment-cli get -a -i 9735
Traceback (most recent call last):
  File "/usr/local/bin/experiment-cli", line 5, in <module>
    pkg_resources.run_script('iotlabcli==1.3.1', 'experiment-cli')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1401, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/iotlabcli-1.3.1-py2.7.egg/EGG-INFO/scripts/experiment-cli", line 4, in <module>
    import pkg_resources
  File "build/bdist.linux-x86_64/egg/iotlabcli/experiment_parser.py", line 397, in main
  File "build/bdist.linux-x86_64/egg/iotlabcli/experiment_parser.py", line 306, in get_experiment
  File "build/bdist.linux-x86_64/egg/iotlabcli/helpers.py", line 101, in write_experiment_archive
UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in position 1: ordinal not in range(128)

fambon@carolus:~$ 

@cladmi
Copy link
Member Author

cladmi commented Sep 27, 2014

I think the result depends of the archive content.
Using 'req.content' instead of 'req.text' in 'rest.py' looks to solve the issue and still work for others requests. Will test it a bit more.

@cladmi cladmi closed this as completed in fa9f9e3 Sep 27, 2014
@cladmi
Copy link
Member Author

cladmi commented Sep 27, 2014

Tested on some other commands, was working for me, let us know if any other commands stopped working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants