Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

- Fix spurious `Error: ignoring SIGPIPE signal` on Unix when embedded Python writes to a closed pipe (#1868).

- Fixed Positron UI interactions, such as restart/create new session with reticulate (#1871, #1869).

- Added support for F1 help for reticulate Python objects in Positron (#1866).

# reticulate 1.44.1

- The default Python version in `install_python()`
Expand Down
15 changes: 13 additions & 2 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,20 @@ register_ark_methods <- function() {
# before registering ark methods we make sure we can find the ipykernel path
# which will be needed for the variable inspectors and for help handlers
# this can'rt be executed during handling of RPC's, so it's important that it's cached.
.ps.ui.executeCommand <- get(".ps.ui.executeCommand", globalenv())
if (is.null(.globals$positron_ipykernel_path)) {
.globals$positron_ipykernel_path <- .ps.ui.executeCommand("positron.reticulate.getIPykernelPath")
tryCatch({
.ps.ui.executeCommand <- get(".ps.ui.executeCommand", globalenv())
.globals$positron_ipykernel_path <- .ps.ui.executeCommand("positron.reticulate.getIPykernelPath")
}, error = function(err) {
# schedule for executing at top level, so we don't error when this is executed from
# Positron RPC methods, which don't allow calling .ps.ui.executeCommand.
addTaskCallback(function(...) {
.ps.ui.executeCommand <- get(".ps.ui.executeCommand", globalenv())
.globals$positron_ipykernel_path <- .ps.ui.executeCommand("positron.reticulate.getIPykernelPath")
# returning FALSE makes sure the callback is removed.
FALSE
})
})
}

# register help handler
Expand Down