summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2002-08-18 21:57:09 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2002-08-18 21:57:09 (GMT)
commit58ba80a6a66d74f7b9dcc40fb8c08a2201749194 (patch)
tree1f83c43b6ea4b3a7453ca76fdf5c8229578c4491 /Mac
parentf2e45dd9dde5fa45afeb2bb42660a5a1a2d199d5 (diff)
downloadcpython-58ba80a6a66d74f7b9dcc40fb8c08a2201749194.zip
cpython-58ba80a6a66d74f7b9dcc40fb8c08a2201749194.tar.gz
cpython-58ba80a6a66d74f7b9dcc40fb8c08a2201749194.tar.bz2
Refuse to run if the last bit of the destination path contains a # character.
This is a silly workaround for a rather serious bug in MacOSX: if you take a long filename and convert it to an FSSpec the fsspec gets a magic cooky (containing a #, indeed). If you then massage the extension of this fsspec and convert back to a pathname you may end up referring to the same file. This could destroy your sourcefile. The problem only occcurs in MacPython-OS9, not MacPython-OSX (I think). Closes bug #505562.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Lib/buildtools.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Mac/Lib/buildtools.py b/Mac/Lib/buildtools.py
index ca9b252..a5e641d 100644
--- a/Mac/Lib/buildtools.py
+++ b/Mac/Lib/buildtools.py
@@ -74,7 +74,10 @@ def process(template, filename, destname, copy_codefragment,
progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
progress.label("Compiling...")
progress.inc(0)
-
+ # check for the script name being longer than 32 chars. This may trigger a bug
+ # on OSX that can destroy your sourcefile.
+ if '#' in os.path.split(filename)[1]:
+ raise BuildError, "BuildApplet could destroy your sourcefile on OSX, please rename: %s" % filename
# Read the source and compile it
# (there's no point overwriting the destination if it has a syntax error)