rstudio / rstudio/reticulate

R Session Aborted on any Python errors

Open
#577 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.8k
Forks
349
Avg merge
5h 13m
Merged PRs (30d)
4

Description

My R session crashes whenever the python code raises an error. Both

reticulate::py_run_string('1/0')

and

reticulate::import('numby')

cause "R Session Aborted".

What is the correct way to handle Python errors and avoid crashing R?

sessionInfo:

R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=Russian_Russia.1251           LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] reticulate_1.12

loaded via a namespace (and not attached):
[1] compiler_3.5.1  Matrix_1.2-14   tools_3.5.1     Rcpp_0.12.18    grid_3.5.1      jsonlite_1.5    lattice_0.20-35

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the crash with reticulate::py_run_string('1/0') and reticulate::import('numby') on the reported R and Windows versions. Trace how Python exceptions and failed imports are handled, then verify that these errors are reported to R without aborting the session.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, r
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.