[Python-checkins] python/dist/src/Mac/Lib buildtools.py,1.16,1.17

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Sun, 18 Aug 2002 14:57:11 -0700


Update of /cvsroot/python/python/dist/src/Mac/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv15345

Modified Files:
	buildtools.py 
Log Message:
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.


Index: buildtools.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Lib/buildtools.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** buildtools.py	5 Aug 2002 22:06:29 -0000	1.16
--- buildtools.py	18 Aug 2002 21:57:09 -0000	1.17
***************
*** 75,79 ****
  		progress.label("Compiling...")
  		progress.inc(0)
! 	
  	# Read the source and compile it
  	# (there's no point overwriting the destination if it has a syntax error)
--- 75,82 ----
  		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)