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

UnicodeEncodeError: 'ascii' codec can't encode character '\u2019' in position 1050: ordinal not in range(128) #124

Open
lee212 opened this issue Jun 18, 2020 · 2 comments
Assignees

Comments

@lee212
Copy link
Contributor

lee212 commented Jun 18, 2020

Traceback (most recent call last):
  File "extasy-analytics-gromacs.py", line 304, in <module>
    appman.run()
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/entk/appman/appmanager.py", line 437, in run
    self.terminate()
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/entk/appman/appmanager.py", line 479, in terminate
    self._rmgr._terminate_resource_request()
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/entk/execman/rp/resource_manager.py", line 230, in _terminate_resource_request
    self._session.close(cleanup=cleanup, download=get_profiles)
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/pilot/session.py", line 288, in close
    self.fetch_json    (tgt='%s/%s' % (tgt, self.uid))
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/pilot/session.py", line 693, in fetch_json
    session=self)
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/pilot/utils/session.py", line 414, in fetch_json
    ru.write_json(json_docs, dst)
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/utils/json_io.py", line 62, in write_json
    json.dump(data, f, sort_keys=True, indent=4, ensure_ascii=False)
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/json/__init__.py", line 180, in dump
    fp.write(chunk)
UnicodeEncodeError: 'ascii' codec can't encode character '\u2019' in position 1050: ordinal not in range(128)

My stack:

  python               : 3.6.10
  pythonpath           : /sw/summit/xalt/1.2.0/site:/sw/summit/xalt/1.2.0/libexec
  virtualenv           : workflow-2
  radical.entk         : 1.4.0
  radical.pilot        : 1.4.1
  radical.saga         : 1.4.0
  radical.utils        : 1.4.0

And the session data is at: https://github.com/radical-experiments/extasy_profiling/blob/master/data/raw_gromacs/re.session.login5.hrlee.018425.0020.tar.gz

And the script is at: https://github.com/radical-experiments/extasy_profiling/blob/master/script/extasy-analytics-gromacs.py
it runs like:

python extasy-analysis-gromacs.py --Wconfig settings/settings_extasy_chignolin_example.wcfg

Please see the README for configuration

@lee212
Copy link
Contributor Author

lee212 commented Jun 19, 2020

Output message from another session:

Update: pipeline.0000.stage.0002.task.0710 state: EXECUTED
Update: pipeline.0000.stage.0002.task.0710 state: DONE
close unit manager                                                            ok
wait for 1 pilot(s)
              0                                                               ok
closing session re.session.login5.hrlee.018430.0004                            \
close pilot manager                                                            \
wait for 1 pilot(s)
              0                                                               ok
                                                                              ok
Error: 'ascii' codec can't encode character '\u2019' in position 1050: ordinal not in range(128)
Traceback (most recent call last):
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/entk/appman/appmanager.py", line 426, in run
    self._run_workflow()
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/entk/appman/appmanager.py", line 736, in _run_workflow
    if not self._task_manager.check_heartbeat() and \
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "extasy-analytics-gromacs.py", line 304, in <module>
    appman.run()
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/entk/appman/appmanager.py", line 437, in run
    self.terminate()
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/entk/appman/appmanager.py", line 479, in terminate
    self._rmgr._terminate_resource_request()
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/entk/execman/rp/resource_manager.py", line 230, in _terminate_resource_request
    self._session.close(cleanup=cleanup, download=get_profiles)
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/pilot/session.py", line 288, in close
    self.fetch_json    (tgt='%s/%s' % (tgt, self.uid))
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/pilot/session.py", line 693, in fetch_json
    session=self)
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/pilot/utils/session.py", line 414, in fetch_json
    ru.write_json(json_docs, dst)
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/site-packages/radical/utils/json_io.py", line 62, in write_json
    json.dump(data, f, sort_keys=True, indent=4, ensure_ascii=False)
  File "/ccs/home/hrlee/.conda/envs/workflow-2/lib/python3.6/json/__init__.py", line 180, in dump
    fp.write(chunk)
UnicodeEncodeError: 'ascii' codec can't encode character '\u2019' in position 1050: ordinal not in range(128)

@mturilli
Copy link
Contributor

@lee212 thank you for reporting this. I am still not able to reproduce it. Could you try to do a:

print('\u2019')

In the shell that gives you this error? I am wondering whether it is an issue with the terminal unicode settings.

@mturilli mturilli self-assigned this Jun 23, 2020
@mturilli mturilli added this to the July 2020 release milestone Jun 23, 2020
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