Skip to content

Commit

Permalink
Merge pull request #1581 from rstudio/rchk-fixes
Browse files Browse the repository at this point in the history
rchk fixes
  • Loading branch information
t-kalinowski authored Apr 9, 2024
2 parents 7eb3e3c + d3cc23f commit 08cebd1
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 55 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ __pycache__
^Dockerfile$
^\.dockerignore$
^\.git-blame-ignore-revs$
^rchk$
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ issues/
README.html
index.html
inst/doc
.vscode/
.vscode/
rchk
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
to the original `sys.stdout` and `sys.stderr`, resulting in no further visible output
from Python, and eventually, a segfault. (#1564)

- Fixed issues reported by rchk, as requested by CRAN (#1581).

- `py_to_r(x)` now returns `x` unmodified if `x` is not a Python object,
instead of signaling an error.

Expand Down
1 change: 1 addition & 0 deletions src/libpython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ bool LibPython::loadSymbols(bool python3, std::string* pError)
// PyUnicode_AsEncodedString may have several different names depending on the Python
// version and the UCS build type
std::vector<std::string> names;
names.reserve(3);
names.push_back("PyUnicode_AsEncodedString");
names.push_back("PyUnicodeUCS2_AsEncodedString");
names.push_back("PyUnicodeUCS4_AsEncodedString");
Expand Down
Loading

0 comments on commit 08cebd1

Please sign in to comment.