We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53114b2 commit 8859ca3Copy full SHA for 8859ca3
pygmt/clib/session.py
@@ -379,10 +379,14 @@ def print_func(file_pointer, message): # noqa: ARG001
379
We'll capture the messages and print them to stderr so that they will show
380
up on the Jupyter notebook.
381
"""
382
- message = message.decode().strip()
+ # Have to use try..except due to upstream GMT bug in GMT <= 6.5.0.
383
+ # See https://github.com/GenericMappingTools/pygmt/issues/3205.
384
+ try:
385
+ message = message.decode().strip()
386
+ except UnicodeDecodeError:
387
+ return 0
388
self._error_log.append(message)
- # flush to make sure the messages are printed even if we have a
- # crash.
389
+ # Flush to make sure the messages are printed even if we have a crash.
390
print(message, file=sys.stderr, flush=True) # noqa: T201
391
return 0
392
0 commit comments