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

Exception triggered by unusual filename #1510

Open
wttw opened this Issue May 17, 2016 · 8 comments

Comments

Projects
None yet
3 participants
@wttw

wttw commented May 17, 2016

Short Summary

Throws exception in refreshTreeOnOpen at startup: "does not appear to be a local path".

komodo_alert

### Steps to Reproduce

Have a file named "TEST_ Month End Madness – what will you get for just $1, $2 or $3? .eml" in your home directory. Hex dump of filename:

      00 01 02 03 04 05 06 07 - 08 09 0A 0B 0C 0D 0E 0F  0123456789ABCDEF

00000000 54 45 53 54 5F 20 4D 6F - 6E 74 68 20 45 6E 64 20 TEST_ Month End
00000010 4D 61 64 6E 65 73 73 20 - E2 80 93 20 77 68 61 74 Madness ... what
00000020 20 77 69 6C 6C 20 79 6F - 75 20 67 65 74 20 66 6F will you get fo
00000030 72 20 6A 75 73 74 20 24 - 31 2C 20 24 32 20 6F 72 r just $1, $2 or
00000040 20 24 33 3F 20 2E 65 6D - 6C 0A $3? .eml.

I'm guessing it doesn't like the en-dash in the middle.

Expected results

No exception.

Actual results

Exception.

Platform Information

Komodo Edit or IDE? IDE
Komodo Version? 10.0.0 build 89159
Operating System (and version)? OS X 10.11.4

Additional Information

-- eg. Error logs, screenshots, workarounds --

@Naatan Naatan added the Type: Bug label May 17, 2016

@Naatan Naatan added this to the 10.0.1 milestone May 17, 2016

@Naatan

This comment has been minimized.

Member

Naatan commented May 17, 2016

Reproduced, thanks for the report! I think it's likely the dollar sign or question marks.

@cgchoffman

This comment has been minimized.

Member

cgchoffman commented May 17, 2016

Are we sure we support this? You're not allowed ot name a file with a "?" in it on Windows.

@Naatan

This comment has been minimized.

Member

Naatan commented May 17, 2016

That may be, but I reproduced it on Linux.

If the filesystem supports it we ought to support it. Or at least not error out on it.

@cgchoffman

This comment has been minimized.

Member

cgchoffman commented May 17, 2016

True. Nathanr, can you do me a favour and try saving a new file with that name on linux? On OSX I get an error in localPathToURI.

@Naatan

This comment has been minimized.

Member

Naatan commented May 17, 2016

Note in my original test I created it from my terminal and then pointed Komodo at it.

When I try to create it from Komodo it creates it but it cannot open it:

image

When I press Yes it creates a file with the name TEST_ Month End Madness – what will you get for just $1, $2 or $3

Based on that I'd say the question mark is the issue.

Personally I'm ok with Komodo not supporting files with question marks in their name, but it should fail gracefully.

@cgchoffman

This comment has been minimized.

Member

cgchoffman commented May 19, 2016

It's the "-" in the file name and I don't know why. It has something to do with the encoding of the character but how Komodo is failing is beyond me. I'll share what I have found so far.
I've narrowed it down to uriparse.py:56.
For somereason koFileEx.path has part of the path stripped off the end. You can see that in @wttw screenshot in their original message.

Noteable (all of this is run in the python shell, python 2.7):

  1. running the same line of code in the Komodo Python shell will fail with an error that truncates the string the exact same way.
    path = u'/Users/careyh/Projects/TEMP/testing-1510/TEST_ Month End Madness – what will you get for just $1, $2 or $3?.eml'
  2. If you remove the "–" and replace it with "-" it runs fine.
  3. If you keep the "–" but make the string less 108 chars it will run properly EDIT: Even weirder. If you shorten the entire input it will run. Eg. Keep the path at 108 chars but make the variable name ath and it will run without error...bah, i don't think this is related to the original bug now.
@cgchoffman

This comment has been minimized.

Member

cgchoffman commented May 19, 2016

Also note: I tried koFileEx.path = localpath.encode("utf-8") which fixes the python shell issues above but has no effect on the issue filed in this bug.

cgchoffman added a commit that referenced this issue May 19, 2016

Places: fail graceful when failing on file #1510
(integrated from master branch change ed5c992 by Carey Hoffman <cgchoffman@gmail.com>)

cgchoffman added a commit that referenced this issue May 19, 2016

Detail error for localPathToURI failure in Places
ref: commit:ed5c992 issue:#1510

(integrated from master branch change 9e220f0 by Carey Hoffman <cgchoffman@gmail.com>)
@cgchoffman

This comment has been minimized.

Member

cgchoffman commented May 19, 2016

Handling it as best we can right now: fd6c511
File will not show up in places.

Note that changing AString in src/views/koFileEx.idl:109 makes the error go away as well but breaks other things.

This is NOT fixed but Places will work now.

@cgchoffman cgchoffman modified the milestones: 10.1, 10.0.1 May 19, 2016

@Naatan Naatan modified the milestones: 11, 10.1 Aug 15, 2016

@Naatan Naatan modified the milestones: 11.x.x, 11 Apr 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment