File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -379,10 +379,14 @@ def print_func(file_pointer, message): # noqa: ARG001
379
379
We'll capture the messages and print them to stderr so that they will show
380
380
up on the Jupyter notebook.
381
381
"""
382
- message = message .decode ().strip ()
382
+ # 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
383
388
self ._error_log .append (message )
384
- # flush to make sure the messages are printed even if we have a
385
- # crash.
389
+ # Flush to make sure the messages are printed even if we have a crash.
386
390
print (message , file = sys .stderr , flush = True ) # noqa: T201
387
391
return 0
388
392
You can’t perform that action at this time.
0 commit comments