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

import "path with space/bar.nim" gives error msg with wrong file name #10042

Closed
timotheecour opened this issue Dec 19, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@timotheecour
Copy link
Contributor

commented Dec 19, 2018

Error: cannot open file: foobar/fun.nim

import "foo bar/fun.nim"
# ditto with abs path:
# import "/tmp/d02/foo bar/fun.nim"

I bumped into it while working on testament which contained one such test file with a space in dir

Note that nim c "path with space/main.nim" works

@Araq

This comment has been minimized.

Copy link
Member

commented Dec 19, 2018

Look for

    # hacky way to implement 'x / y /../ z':
    result = renderTree(n, {renderNoComments}).replace(" ")

in compiler/modulepaths.nim

@timotheecour timotheecour added the Easy label Dec 19, 2018

narimiran added a commit to narimiran/Nim that referenced this issue Jan 30, 2019

fix nim-lang#10042 (allow spaces in import)
This allows spaces in imports, by using the following syntax:
* `import "directory with spaces" / subdir / file`, or
* `import "directory with spaces/subdir/file"`

narimiran added a commit to narimiran/Nim that referenced this issue Jan 30, 2019

fix nim-lang#10042 (allow spaces in import)
This allows spaces in imports, by using the following syntax:
* `import "directory with spaces" / subdir / file`, or
* `import "directory with spaces/subdir/file"`

@Araq Araq closed this in fa05877 Jan 31, 2019

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.