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

Still include the stdout output captured before the autoprint mechanism. #1423

Merged
merged 4 commits into from
Jul 25, 2023

Conversation

dfalbel
Copy link
Member

@dfalbel dfalbel commented Jul 25, 2023

Should fix: #1387 (comment)
@matthew-brett Can you confirm this is the expected behavior?

@matthew-brett
Copy link
Contributor

Thanks - I just tested commit 61e300f6 - that does work as I expect with jupyter_compat=TRUE. Here's my test notebook:

Some text.

```{python, jupyter_compat=TRUE}
print('first_stdout')
'first_expression'
print('second_stdout')
'final_expression'
```

More text.

With the given commit, and:

> devtools::load_all()
> rmarkdown::render("test.Rmd", output_format = "md_document")

I get:

Some text.

    print('first_stdout')

    ## first_stdout

    'first_expression'
    print('second_stdout')

    ## second_stdout

    'final_expression'

    ## 'final_expression'

More text.

@dfalbel
Copy link
Member Author

dfalbel commented Jul 25, 2023

Thanks @matthew-brett , also added your example to the test suite :)

@matthew-brett
Copy link
Contributor

Excellent - thank you for adding that.

@t-kalinowski t-kalinowski merged commit a003118 into rstudio:main Jul 25, 2023
12 checks passed
matthew-brett added a commit to matthew-brett/resampling-with that referenced this pull request Jul 25, 2023
Latest reticulate should handle jupyter_compat correctly.

See: rstudio/reticulate#1423
stefanv pushed a commit to resampling-stats/resampling-with that referenced this pull request Jul 25, 2023
Latest reticulate should handle jupyter_compat correctly.

See: rstudio/reticulate#1423
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

Successfully merging this pull request may close these issues.

knitr engine doesn't capture python stdout
3 participants