Windows: paths are not completely handled
#5
Closed
opened 11 years ago by adrientetar
·
14 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
I'm on Windows with latest racket and pollen.
What I did was
cd
to my working directory then ran this command:The
index.ptree
works, I can also access files in the folder that are not processed by pollen. However, when I click onspec.html.pm
; I get this:Notice the stray path here.
Now
cd
'ing to racket directory and running it from here with a custom project path, I have basically the same error pattern but with racket path:Basically the same but with Racket's path.
For reference the command ran here was:
@mbutterick; Note that it's the first time I'm using Racket so I may be doing something wrong.
More likely I'm doing something dumb with Windows paths.
I'll have a look...
Thanks, just ran into something weirder: it now works... but I haven't actually changed anything.
The log shows this:
Seems like that stray path is now considered empty internally?
I was able to reproduce this problem. There were a couple places in the code where I wasn't handling Windows paths correctly. I've pushed a fix & now it's working for me.
PS You can update your installation with
raco pkg update pollen
or on Windows
"C:\Program Files\Racket\raco" pkg update pollen
Neat, thanks!
@mbutterick I haven’t used pollen in months but here I just updated to the latest version and I have a similar message I had before:
The application raised an exception with the message:
Stack trace:
I did more testing. When I pass a path inside quotes like
raco pollen start "C:\nAZERTY"
I get the error up here. I need quotes for paths that have spaces in the terminal.It also does not work when you have non-ASCII chars in your path, like e.g. é. Should it use strings instead of bytes or something?
After doing these two tests I renamed back to C:\nAZERTY and opened without quotes, got the same error when opening the server root (
http://localhost:8080/
) but it worked when opening the dashboard directly (http://localhost:8080/index.ptree
).So something is a bit weird with how it routes the root page?
Lastly, I’d expect the dashboard to follow the Windows path conventions.
Also if I click on the drive letter from the dashboard:
The application raised an exception with the message:
(same with absolute path instead of drive if I click on a path.)
Stack trace:
What happens if you change your current directory to
C:\nAZERTY
and then doraco pollen start
(without a directory argument)?I pushed a possible fix. Let me know if it helps.
It works now except when opening server root (
http://localhost:8080/
), opening index.ptree or a file works properly.(I hit this also with raw UTF8 files without BOM but it seems to be an issue on the browser’s side.)
Sometimes a page will hang and fail to load and give a spurious TCP error:
It seems to correspond to a timeout from the client but the underlying error might be elsewhere. Does it look like a Racket error rather than Pollen?
(Notice that non-ASCII chars are not output properly but since it’s a Racket-output error, I’m assuming that Racket itself does it wrong.)
You won't see anything at the server root (
http://localhost:8080/
) unless you put your ownindex.html
there. (This is deliberate behavior.)As for the TCP error, the stack trace doesn’t originate in Pollen code, so it looks like a Racket error.
As for the non-ASCII characters, that’s probably because the web page showing the error needs to be set to UTF-8 — I can fix that.
PS. Because of a recent update, you need to change the name of
project-require.rkt
todirectory-require.rkt
.It makes sense, however I’d expect it to not error with a stack trace when
index.html
isn’t present?The web error is fine (through it lacks a DOCTYPE like the dashboard did previously), it was in the Terminal.
Right, thanks!