-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Please give the trailing slash back to os.tmpdir() #1669
Comments
Why not use
|
@mscdex Sorry, maybe I should say it more clearly. I'm asking why you think it is a necessary breaking change. Just removing one trailing slash won't complete the “consistency” between And here is another question: Will making EDIT: Added |
That's true actually: $ TEMP=/ ~/io.js/iojs -e 'console.log(JSON.stringify(require("os").tmpdir()))'
""
dirname works correctly in that case: $ cat /test.js
console.log(__dirname)
$ ~/io.js/iojs /test.js
/ |
@rlidwka I've updated my previous comment. Please think about backslash |
cc @tellnes |
Perhaps semver-major changes aren't looked at hard enough... maybe we should introduce a hard minimum amount of reviewers for a major change, say 3. |
We could change it so we remove all trailing slashes and keep one if there is no other characters there? |
@beanieboi No. I don't care the trailing slash and will not use such a boring API any more. |
I must point out that this is not only a severe problem for the root path |
So remove trailing |
@tellnes I have no more opinions on how to deal with those separators. At least, use the correct separator for different platforms. This is a stable API, I hope you all take it more seriously. |
os.tmpdir() began stripping trailing slashes in b57cc51. This causes problems if the temp directory is simply '/'. It also stripped trailing slashes without first determining which slash type is used by the current operating system. This commit only strips trailing slashes if another character precedes the slash. On Windows, it checks for ':', as not to strip slashes from something like 'C:\'. It also only strips slashes that are appropriate for the user's operating system. Fixes: #1669 PR-URL: #1673 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Christian Tellnes <christian@tellnes.no>
As of 7693705, trailing slashes will not be stripped from |
Please revert the commit b57cc51
Since we can get any string (like "/oh/my/xxx/////"), from the environment, why bother to remove the trailing slash? For consistency between __dirname and os.tmpdir() #715 #747 ??
The text was updated successfully, but these errors were encountered: