2019-06-17 06:51:10 - ERROR - Error loading database connection info from file /home/johnf/pesdabo3/pesreports.cnxml:
I/O operation on closed file

I believe that the use of with open(ref) in ->fileRef() does not open the file (or keep it open) which causes the above error.

The call is

MainForm.createdBizobjs(self)-> self.Application.addConnectFile("filename") ->

ConnParser.py -> importConnections()

line 91

f = fileRef(pth) causes xml.sax.parse(f,ch) to fail with the above error.  That is because f.closed == True

so using "with open(ref) as ff:" in importConnections() is the cause. Replacing it with an plain open() works but I'm not sure why using the "with" does not work.


Johnf



On 6/16/19 9:45 AM, Ed Leafe wrote:
   Branch: refs/heads/dabo3
   Home:   https://github.com/dabodev/dabo
   Commit: a8d7cd2f34453270602a5bf5de4804ec8895d803
       
https://github.com/dabodev/dabo/commit/a8d7cd2f34453270602a5bf5de4804ec8895d803
   Author: EdLeafe <[email protected]>
   Date:   2019-06-16 (Sun, 16 Jun 2019)

   Changed paths:
     M .gitignore
     M dabo/biz/RemoteBizobj.py
     M dabo/dApp.py
     M dabo/lib/DesignerClassConverter.py
     M dabo/lib/RemoteConnector.py
     M dabo/lib/connParser.py
     M dabo/lib/profilehooks.py
     M dabo/lib/specParser.py
     M dabo/ui/dImage.py
     M dabo/ui/dShell.py
     M ide/CxnEditor.py
     M ide/ReportDesigner.py
     M ide/wizards/AppWizard/AppWizard.py
     M tools/reportMixedIndentation.py

   Log Message:
   -----------
   Replaced the use of file() with open()

Rather than simply do the word replace, I changed all the usages to use
the context manager to ensure that the files are properly closed.



[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/[email protected]

Reply via email to