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

[ospaths] BUG: splitFile("/a.txt").dir = "" ; + other bugs with splitFile #8255

Closed
timotheecour opened this issue Jul 10, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@timotheecour
Copy link
Contributor

commented Jul 10, 2018

  • bug 1:
    nim:
    echo splitFile("/a.txt")
    (dir: "", name: "a", ext: ".txt") #definitely wrong

python:
os.path.split("/a.txt")
('/', 'a.txt')

  • bug 2:
    nim:
    echo splitFile("a/")
    (dir: "a/", name: "", ext: "") # violates good sense, and also documention: "dir does not end in DirSep. extension includes the leading dot."

python:
os.path.split("a/")
('a', '')

  • bug 6
    echo splitFile("a/..")
    (dir: "a", name: ".", ext: ".")
    should be:
    (dir: "a", name: "..")

@timotheecour timotheecour referenced this issue Jul 10, 2018

Open

[ospaths, os] miscellaneous issues #8177

10 of 26 tasks complete

@timotheecour timotheecour changed the title [ospaths] BUG: splitFile("/a.txt") returns (dir: "", name: "a", ext: ".txt") [ospaths] BUG: splitFile("/a.txt").dir = "" ; + other bugs with splitFile Jul 10, 2018

@timotheecour timotheecour changed the title [ospaths] BUG: splitFile("/a.txt").dir = "" ; + other bugs with splitFile [ospaths] BUG: splitFile("/a.txt").dir = "" ; + other bugs with splitFile, parentDir Jul 10, 2018

@Araq

This comment has been minimized.

Copy link
Member

commented Jul 10, 2018

Bug 1 is documented behaviour and encoded in the return type!

@andreaferretti

This comment has been minimized.

Copy link
Collaborator

commented Jul 10, 2018

I think bug 1 is about dir, which should be /

@timotheecour

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2018

I think bug 1 is about dir, which should be /

yes, that is the bug I'm referring to

@timotheecour timotheecour added the std.os label Oct 25, 2018

timotheecour added a commit to timotheecour/Nim that referenced this issue Dec 19, 2018

@timotheecour timotheecour changed the title [ospaths] BUG: splitFile("/a.txt").dir = "" ; + other bugs with splitFile, parentDir [ospaths] BUG: splitFile("/a.txt").dir = "" ; + other bugs with splitFile Dec 19, 2018

@timotheecour

This comment has been minimized.

Copy link
Contributor Author

commented Dec 19, 2018

=> PR to fix it: #10047

timotheecour added a commit to timotheecour/Nim that referenced this issue Dec 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.