{"action":"opened","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/3392","labels_url":"https://api.github.com/repos/jruby/jruby/issues/3392/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/3392/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/3392/events","html_url":"https://github.com/jruby/jruby/issues/3392","id":111013875,"number":3392,"title":"Pathname#relative_path_from failing when there is a '!' character in the path","user":{"login":"hading","id":379024,"avatar_url":"https://avatars.githubusercontent.com/u/379024?v=3","gravatar_id":"","url":"https://api.github.com/users/hading","html_url":"https://github.com/hading","followers_url":"https://api.github.com/users/hading/followers","following_url":"https://api.github.com/users/hading/following{/other_user}","gists_url":"https://api.github.com/users/hading/gists{/gist_id}","starred_url":"https://api.github.com/users/hading/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hading/subscriptions","organizations_url":"https://api.github.com/users/hading/orgs","repos_url":"https://api.github.com/users/hading/repos","events_url":"https://api.github.com/users/hading/events{/privacy}","received_events_url":"https://api.github.com/users/hading/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-12T16:48:08Z","updated_at":"2015-10-12T16:48:08Z","closed_at":null,"body":"For jruby-9.0.1.0 (discovered on 9.0.0.0). I don't know if there are other characters that trigger this.\r\n\r\nE.g. \r\njruby-9.0.1.0 :001 > require 'pathname'\r\n => true \r\njruby-9.0.1.0 :002 > x = \"joe\"\r\n => \"joe\" \r\njruby-9.0.1.0 :003 > y = \"joe/pete!/bob\"\r\n => \"joe/pete!/bob\" \r\njruby-9.0.1.0 :004 > Pathname.new(y).relative_path_from(Pathname.new(x))\r\nArgumentError: different prefix: \"joe/pete!/\" and \"joe\"\r\n\tfrom /Users/hding2/.rvm/rubies/jruby-9.0.1.0/lib/ruby/stdlib/pathname.rb:508:in `relative_path_from'\r\n\tfrom (irb):4:in `<eval>'\r\n\tfrom org/jruby/RubyKernel.java:978:in `eval'\r\n\tfrom org/jruby/RubyKernel.java:1291:in `loop'\r\n\tfrom org/jruby/RubyKernel.java:1098:in `catch'\r\n\tfrom org/jruby/RubyKernel.java:1098:in `catch'\r\n\tfrom /Users/hding2/.rvm/rubies/jruby-9.0.1.0/bin/irb:13:in `<top>'\r\n\r\nIn ruby-2.2.3:\r\n2.2.3 :001 > require 'pathname'\r\n => true \r\n2.2.3 :002 > x = \"joe\"\r\n => \"joe\" \r\n2.2.3 :003 > y = \"joe/pete!/bob\"\r\n => \"joe/pete!/bob\" \r\n2.2.3 :004 > Pathname.new(y).relative_path_from(Pathname.new(x))\r\n => #<Pathname:pete!/bob> \r\n"}}