sassoftware/pyviyatools

createfolders.py fails to create folders with a trailing slash

Closed this issue · 4 comments

Hi Gerry,

I've found a wee nuance in createfolders.py and I'm hoping you could implement some error handling.

If you try to create a folder with a trailing slash at the end of the name then createfolders.py crashes with a 'http response code: 404' error.

Here's an example CSV, whereby createfolders.py would create the first two folders (/test and /test/newfolder) but would then crash.

/test,""
/test/newfolder,""
/test/newfolder2/,""
/test/newfolder3,""
/test/newfolder3/example,""

Perhaps you could implement some handling that checks for and removes any trailing slashes found on the end of folder names? Or notifies the user and tells them to remove them?

Thanks.

Hi Tom, yes that seems like a bug. I will take care of it.

@tomstarr I have added some code to strip the trailing slash. Try it out and I will merge it in if everything looks good.

Thanks Gerry, I'll get on to testing this later this week. Will keep you posted.

@gerrynelson63 apologies for the delay. I can confirm that the update looks good and handles this issue.
Thanks!