Windows file path problems

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows file path problems

Dániel Bali
Hi!

I fetched the new updates from the master branch recently and now all tests fail on Windows. 

Here is a full stack trace:

The problem appears to be here:
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: file:C:
at org.apache.flink.core.fs.Path.initialize(Path.java:244)
at org.apache.flink.core.fs.Path.<init>(Path.java:227)
at org.apache.flink.core.fs.Path.<init>(Path.java:140)
at org.apache.flink.core.fs.local.LocalFileSystem.pathToFile(LocalFileSystem.java:147)
...

Does this happen to anybody else? 

Thanks,
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Windows file path problems

Stephan Ewen
I think this is due to a change introduced by Fabian to fix the issue of trailing slashes. May have this side effect...

I agree, this is critical and should be fixed soon...

On Tue, Mar 17, 2015 at 3:41 PM, Dániel Bali <[hidden email]> wrote:
Hi!

I fetched the new updates from the master branch recently and now all tests fail on Windows. 

Here is a full stack trace:

The problem appears to be here:
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: file:C:
at org.apache.flink.core.fs.Path.initialize(Path.java:244)
at org.apache.flink.core.fs.Path.<init>(Path.java:227)
at org.apache.flink.core.fs.Path.<init>(Path.java:140)
at org.apache.flink.core.fs.local.LocalFileSystem.pathToFile(LocalFileSystem.java:147)
...

Does this happen to anybody else? 

Thanks,
Daniel

Reply | Threaded
Open this post in threaded view
|

Re: Windows file path problems

Dániel Bali
Hi Stephan,

The problem is that "file:/C:" is evaluated as a non-absolute path in `Path:isAbsolute`
This hack seems to fix the issue:

in Path.java from line 318:

public boolean isAbsolute() {
   final int start = hasWindowsDrive(uri.getPath(), true) ? 3 : 0;
   if (uri.getPath().length() > start) {
      return uri.getPath().startsWith(SEPARATOR, start);
   }
   return true;
}

Best regards,
Daniel

2015-03-17 16:06 GMT+01:00 Stephan Ewen <[hidden email]>:
I think this is due to a change introduced by Fabian to fix the issue of trailing slashes. May have this side effect...

I agree, this is critical and should be fixed soon...

On Tue, Mar 17, 2015 at 3:41 PM, Dániel Bali <[hidden email]> wrote:
Hi!

I fetched the new updates from the master branch recently and now all tests fail on Windows. 

Here is a full stack trace:

The problem appears to be here:
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: file:C:
at org.apache.flink.core.fs.Path.initialize(Path.java:244)
at org.apache.flink.core.fs.Path.<init>(Path.java:227)
at org.apache.flink.core.fs.Path.<init>(Path.java:140)
at org.apache.flink.core.fs.local.LocalFileSystem.pathToFile(LocalFileSystem.java:147)
...

Does this happen to anybody else? 

Thanks,
Daniel


Reply | Threaded
Open this post in threaded view
|

Re: Windows file path problems

Stephan Ewen
Looks fine. Can you make a pull request with that fix?

On Tue, Mar 17, 2015 at 4:41 PM, Dániel Bali <[hidden email]> wrote:
Hi Stephan,

The problem is that "file:/C:" is evaluated as a non-absolute path in `Path:isAbsolute`
This hack seems to fix the issue:

in Path.java from line 318:

public boolean isAbsolute() {
   final int start = hasWindowsDrive(uri.getPath(), true) ? 3 : 0;
   if (uri.getPath().length() > start) {
      return uri.getPath().startsWith(SEPARATOR, start);
   }
   return true;
}

Best regards,
Daniel

2015-03-17 16:06 GMT+01:00 Stephan Ewen <[hidden email]>:
I think this is due to a change introduced by Fabian to fix the issue of trailing slashes. May have this side effect...

I agree, this is critical and should be fixed soon...

On Tue, Mar 17, 2015 at 3:41 PM, Dániel Bali <[hidden email]> wrote:
Hi!

I fetched the new updates from the master branch recently and now all tests fail on Windows. 

Here is a full stack trace:

The problem appears to be here:
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: file:C:
at org.apache.flink.core.fs.Path.initialize(Path.java:244)
at org.apache.flink.core.fs.Path.<init>(Path.java:227)
at org.apache.flink.core.fs.Path.<init>(Path.java:140)
at org.apache.flink.core.fs.local.LocalFileSystem.pathToFile(LocalFileSystem.java:147)
...

Does this happen to anybody else? 

Thanks,
Daniel



Reply | Threaded
Open this post in threaded view
|

Re: Windows file path problems

Dániel Bali
Hi,

I created a PR, I hope it's ok like this:
https://github.com/apache/flink/pull/491

2015-03-17 16:51 GMT+01:00 Stephan Ewen <[hidden email]>:
Looks fine. Can you make a pull request with that fix?

On Tue, Mar 17, 2015 at 4:41 PM, Dániel Bali <[hidden email]> wrote:
Hi Stephan,

The problem is that "file:/C:" is evaluated as a non-absolute path in `Path:isAbsolute`
This hack seems to fix the issue:

in Path.java from line 318:

public boolean isAbsolute() {
   final int start = hasWindowsDrive(uri.getPath(), true) ? 3 : 0;
   if (uri.getPath().length() > start) {
      return uri.getPath().startsWith(SEPARATOR, start);
   }
   return true;
}

Best regards,
Daniel

2015-03-17 16:06 GMT+01:00 Stephan Ewen <[hidden email]>:
I think this is due to a change introduced by Fabian to fix the issue of trailing slashes. May have this side effect...

I agree, this is critical and should be fixed soon...

On Tue, Mar 17, 2015 at 3:41 PM, Dániel Bali <[hidden email]> wrote:
Hi!

I fetched the new updates from the master branch recently and now all tests fail on Windows. 

Here is a full stack trace:

The problem appears to be here:
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: file:C:
at org.apache.flink.core.fs.Path.initialize(Path.java:244)
at org.apache.flink.core.fs.Path.<init>(Path.java:227)
at org.apache.flink.core.fs.Path.<init>(Path.java:140)
at org.apache.flink.core.fs.local.LocalFileSystem.pathToFile(LocalFileSystem.java:147)
...

Does this happen to anybody else? 

Thanks,
Daniel