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

[fix] get_cased_path doesn't raise when path does not exists #3516

Merged
merged 5 commits into from Sep 11, 2018

Conversation

Projects
None yet
3 participants
@jgsogo
Copy link
Member

commented Sep 10, 2018

Fix/improve implementation of get_cased_path: if you call it with a non-existing path, it will work only on the existing part of the path and leave the rest as is.

Changelog: Bugfix: get_cased_path crashed when the path didn't exist.

@jgsogo jgsogo added the type: bug label Sep 10, 2018

@ghost ghost assigned jgsogo Sep 10, 2018

@ghost ghost added the stage: review label Sep 10, 2018

jgsogo added some commits Sep 10, 2018

p = get_cased_path(non_existing_path) # If not exists from the root, returns as is
self.assertEqual(p, non_existing_path)
except Exception as e:
self.fail("Unexpected exception: %s" % e)

This comment has been minimized.

Copy link
@memsharded

memsharded Sep 10, 2018

Contributor

An uncontrolled exception will make the test fail anyway, don't use try-except

This comment has been minimized.

Copy link
@jgsogo

jgsogo Sep 10, 2018

Author Member

I prefer having it explicit, but I can remove it... less lines of code ^^

This comment has been minimized.

Copy link
@memsharded

memsharded Sep 11, 2018

Contributor

Yes, much better, thanks!

self.assertEqual(os.path.join(p1, "not-existing"),
get_cased_path(non_existing_path))
except Exception as e:
self.fail("Unexpected exception: %s" % e)

This comment has been minimized.

Copy link
@memsharded

memsharded Sep 10, 2018

Contributor

Same as above

@jgsogo jgsogo assigned danimtb and unassigned jgsogo Sep 10, 2018

@memsharded memsharded added this to the 1.8 milestone Sep 11, 2018

@danimtb danimtb merged commit 56d84a9 into conan-io:develop Sep 11, 2018

2 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
license/cla Contributor License Agreement is signed.
Details

@ghost ghost removed the stage: review label Sep 11, 2018

grisumbras pushed a commit to grisumbras/conan that referenced this pull request Dec 27, 2018

[fix] get_cased_path doesn't raise when path does not exists (conan-i…
…o#3516)

* get_cased_path doesn't raise when path does not exists

* partially existing paths will be partially cased

* typo

* remove uneeded try-except blocks
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.