Skip to content

Commit 6d50f2c

Browse files
committed
add function to warn on special ASCII characters
1 parent 9e86c31 commit 6d50f2c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

constructor/install.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
LINK_SOFT: 'soft-link',
4646
LINK_COPY: 'copy',
4747
}
48+
SPECIAL_ASCII = '$!&\%^|{}[]<>~`"\':;?@*#'
4849

4950
# these may be changed in main()
5051
ROOT_PREFIX = sys.prefix
@@ -507,8 +508,17 @@ def main2():
507508
post_extract()
508509

509510

511+
def warn_on_special_chrs():
512+
if on_win:
513+
return
514+
for c in SPECIAL_ASCII:
515+
if c in ROOT_PREFIX:
516+
print("WARNING: found '%s' in install prefix." % c)
517+
518+
510519
if __name__ == '__main__':
511520
if IDISTS:
512521
main()
522+
warn_on_special_chrs()
513523
else: # common usecase
514524
main2()

0 commit comments

Comments
 (0)