Github user HyukjinKwon commented on a diff in the pull request: https://github.com/apache/spark/pull/16305#discussion_r92911442 --- Diff: core/src/main/scala/org/apache/spark/deploy/RPackageUtils.scala --- @@ -231,8 +236,10 @@ private[deploy] object RPackageUtils extends Logging { val zipOutputStream = new ZipOutputStream(new FileOutputStream(zipFile, false)) try { filesToBundle.foreach { file => - // get the relative paths for proper naming in the zip file - val relPath = file.getAbsolutePath.replaceFirst(dir.getAbsolutePath, "") + // Get the relative paths for proper naming in the zip file. Note that + // the separator should always be / for according to ZIP specification. + // `relPath` here should be, for example, "/packageTest/def.R" or "/test.R". + val relPath = file.toURI.toString.replaceFirst(dir.toURI.toString.stripSuffix("/"), "") --- End diff -- Ah, I thought you meant writing comment in the codes.. :).it just replaces the `\` on Windows to `/`. The reason for `stripSuffix` is, it seems it has a trailing `/` when the uri is known as a directory.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org