You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/26 10:08:22 UTC

[GitHub] [arrow] yutannihilation commented on a change in pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

yutannihilation commented on a change in pull request #9321:
URL: https://github.com/apache/arrow/pull/9321#discussion_r564389389



##########
File path: r/R/parquet.R
##########
@@ -567,3 +568,14 @@ ParquetArrowReaderProperties <- R6Class("ParquetArrowReaderProperties",
 ParquetArrowReaderProperties$create <- function(use_threads = option_use_threads()) {
   parquet___arrow___ArrowReaderProperties__Make(isTRUE(use_threads))
 }
+
+with_safe_locale <- function(expr) {
+  # ARROW-7288: due to a bug in libstdc++ on mingw, std::regex can blow up
+  # on other locales, and the parquet reader calls it
+  if (tolower(Sys.info()[["sysname"]]) == "windows") {
+    old_locale <- Sys.getlocale("LC_COLLATE")
+    Sys.setlocale("LC_COLLATE", "C")
+    on.exit(Sys.setlocale(old_locale))

Review comment:
       ```suggestion
       on.exit(Sys.setlocale("LC_COLLATE", old_locale))
   ```
   
   `category` is needed here, as the error message on CI suggests.
   
   ```
   Error: Error: invalid 'category' argument
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org