Skip to content

avoid special characters like '[', ']' in path to temporary directory#1808

Merged
boegel merged 2 commits intoeasybuilders:developfrom
boegel:tmpdir_no_square_brackets
Jun 14, 2016
Merged

avoid special characters like '[', ']' in path to temporary directory#1808
boegel merged 2 commits intoeasybuilders:developfrom
boegel:tmpdir_no_square_brackets

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Jun 13, 2016

I've run into this a couple of times when submitting array jobs with eb commands on our system using Torque, since then you end up in an environment where $TMPDIR is set to something like:

`/local/12345[3200].master15.delcatty.gent.vsc`

Sometimes, this breaks the build/installation for no good reason. I've seen this occur primarily when installing Python packages (it seems like setuptools has trouble with it), and when using nvcc which picks up $TMPDIR and uses it as a 'scratch' space, cfr. easybuilders/easybuild-easyblocks#953 (comment)

@boegel boegel added this to the v2.9.0 milestone Jun 13, 2016
@boegel
Copy link
Copy Markdown
Member Author

boegel commented Jun 13, 2016

@wpoely86 please review

Comment thread easybuild/tools/options.py Outdated
# only common characteris like alphanumeric, '_', '-', '.' and '/' are retained; others are converted to '_'
special_chars_regex = r'[^\w/.-]'
if re.search(special_chars_regex, current_tmpdir):
current_tmpdir = re.sub(special_chars_regex, '_', current_tmpdir)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking but I would convert to X ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any particular reason?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cause X is just an ordinary letter and _ might be 'special' for some codes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, ok, I'll change it

@wpoely86
Copy link
Copy Markdown
Member

👍

@boegel
Copy link
Copy Markdown
Member Author

boegel commented Jun 14, 2016

Thanks for the review @wpoely86!

@boegel boegel merged commit de8495a into easybuilders:develop Jun 14, 2016
@boegel boegel deleted the tmpdir_no_square_brackets branch June 14, 2016 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants