wxglade codegen causes exception error Cannot create a file when that file already exists

Graeme Glenn - InfoComm Engineering <[email protected]>
Newsgroups gmane.comp.python.wxglade
Organization InfoComm Engineering
Message-ID <[email protected]>
Hi,

Had a couple of projects already on the go, but decided to upgrade from
0.7 to 0.7.1
It loaded original design file correctly by when it came to
codegeneration reported exception error Cannot create a file when that
file already exists.

I put the code in a new directory and tried again. It seemed to work
fine, but after restarting the the machine, I again found this error.

Here's the relevant part of the log file:

2016-01-08 13:07:45,142 PythonCodeWriter ERROR: Internal Error
An unexpected error occurred!

Date and time:       2016-01-08T13:07:45.144000
Python version:      2.7.9
wxPython version:    2.8.12.1
wxWidgets platform:  __WXMSW__
wxGlade version:     0.7.1
Language code:       English_Australia
Encoding:            1252
Filesystem encoding: mbcs

Exception type:      <type 'exceptions.WindowsError'>
Exception details:   [Error 183] Cannot create a file when that file
already exists
Application stack trace:
Stack frame at level 0
======================
  File "C:\Program Files\wxGlade\common.py", line 517
  Function
"save_file(filename=u'C:\\src\\python\\effectivo02\\DialogCat.py',
content='# -*- coding: ISO-8859-15 -*-\n#\n# generated by wxGlade 0.7.1
on Tue Jan 05 14:09:10 2016\n#\n\... n', which='codegen')"
  Source code context:
          outfile = None
          try:
              if need_backup:
  ->              os.rename(filename, filename +
config.preferences.backup_suffix)
                  config.backed_up[filename] = True
     
              # create necessary subdirectories on demand
  Local variables:
  -> do_backup (<type 'int'>): 1
  -> need_backup (<type 'bool'>): True
  -> filename (<type 'unicode'>):
u'C:\\src\\python\\effectivo02\\DialogCat.py'
  -> content (<type 'str'>): '# -*- coding: ISO-8859-15 -*-\n#\n#
generated by wxGlade 0.7.1 on Tue Jan 05 14:09:10 2016\n#\n\nimport
wx\n# begin wxGlade: dependencies\ ... \n        # end wxGlade\n\n# end
of class DialogCat\n'
  -> outfile (<type 'NoneType'>): None
  -> chksum_content (<type 'str'>): 'bba3ed467cbb81b4c73c2cbc07c1eac2'
  -> oldfile (<type 'file'>): <closed file
u'C:\\src\\python\\effectivo02\\DialogCat.py', mode 'r' at 0x0268FF98>
  -> which (<type 'str'>): 'codegen'
  -> chksum_oldcontent (<type 'str'>): '91b1229f6933749258d3ddc40b46d2ee'
  -> oldcontent (<type 'str'>): '# -*- coding: ISO-8859-15 -*-\n#\n#
gener ---- \n        self.Layout()\n        # end wxGlade\n\n# end of
class DialogCat\n'

Stack frame at level 1
======================
  File "C:\Program Files\wxGlade\codegen\__init__.py", line 2307
  Function "save_file(self=<py_codegen.PythonCodeWriter object at
0x035F2870>, filename=u'C:\\src\\python\\effectivo02\\DialogCat.py',
content=u'# -*- coding: ISO-8859-15 -*-\n#\n# generated by wxGlade 0.7.1
on Tue Jan 05 14:09:10 2016\n#\n\nimport wx\n# begin wxGlade:
dependencies\n# end wxGlade\n\n# begin wxGlade: extracode\n# ----    
self.Layout()\n        # end wxGlade\n\n# end of class DialogCat\n',
mainfile=False, content_only=True)"
  Source code context:
     
              # save the file now
              try:
  ->              common.save_file(filename, tmp, 'codegen')
              except IOError, e:
                  raise XmlParsingError(str(e))
              except:
  Local variables:
  -> tmp (<type 'str'>): '# -*- coding: ISO-8859-15 -*-\n#\n# generated
by wxGlade 0.7.1 on Tue Jan 05 14:09:10 2016\n#\n\nimport wx\n# begin
wxGlade: dependencies\n# end wxGlade\n\n# begin wxGlade: e1)\n       
self.Layout()\n        # end wxGlade\n\n# end of class DialogCat\n'
  -> mainfile (<type 'bool'>): False
  -> self (<class 'py_codegen.PythonCodeWriter'>):
<py_codegen.PythonCodeWriter object at 0x035F2870>
  -> filename (<type 'unicode'>):
u'C:\\src\\python\\effectivo02\\DialogCat.py'
  -> content (<type 'unicode'>): u'# -*- coding: ISO-8859-15 -*-\n#\n#
generated by wxGlade 0.7.1 on Tue Jan 05 14:09:10 2016\n#\n\nimport
wx\n# begin wxGlade: dependencies\n# end wxGlade\n\n---- 1)\n       
self.Layout()\n        # end wxGlade\n\n# end of class DialogCat\n'
  -> content_only (<type 'bool'>): True
  -> dirname (<type 'unicode'>): u'C:\\src\\python\\effectivo02'



-- 
InfoComm Signature

*Graeme G. Glenn*

*PEng. Dip Electronics BEng Comm Dip Theo*

InfoComm Engineering
<http://www.coolice.com.au/catalog/>www.coolice.com.au
	

*Ph: (03) 9789 3547
Mob: 0412 727 224*

*Fax: (03) 9011 6180*

*Email: [email protected] <mailto:[email protected]>*

*Account Name: InfoComm Engineering
Bank: Commonwealth Bank*

*BSB: 063 240 Account: 1011 8505*

------------------------------------------------------------------------------

_______________________________________________
wxGlade-general mailing list
wxGlade-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/wxglade-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.