On 8/19/14, 9:47 AM, Werner wrote:
Hi,

I see this exception:
File "d:\devMine\twcbv4\twcbsrc\controllers\app_cb.py", line 1310, in
<module>
   app.MainLoop()
File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line
8660, in MainLoop
   wx.PyApp.MainLoop(self)
File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line
7952, in MainLoop
   return _core_.PyApp_MainLoop(*args, **kwargs)
File
"c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\lib\agw\aui\auibar.py",
line 3704, in OnLeftUp
   self.ProcessEvent(e)
File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line
4154, in ProcessEvent
   return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
File "d:\devMine\twcbv4\twcbsrc\controllers\app_cb.py", line 421, in
onTBPrint
   dlg.ShowModal()
File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_windows.py", line
805, in ShowModal
   return _windows_.Dialog_ShowModal(*args, **kwargs)
File
"c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\lib\agw\aquabutton.py",
line 439, in OnLeftUp
   self.Notify()
File
"c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\lib\agw\aquabutton.py",
line 890, in Notify
   self.GetEventHandler().ProcessEvent(evt)
File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line
4154, in ProcessEvent
   return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
File "d:\devMine\twcbv4\twcbsrc\controllers\dreports.py", line 528, in
doReportWriteAndPreview
   _filename = self.genReport()
File "d:\devMine\twcbv4\twcbsrc\controllers\dreports.py", line 566, in
genReport
   rw.ReportFormFile = self.getReportFile()
File "D:\devTools\dabo\dabo\lib\reportWriter.py", line 3227, in
_setReportFormFile
   self.HomeDirectory = os.path.join(os.path.split(val)[:-1])[0]
File "c:\Python27\Lib\ntpath.py", line 89, in join
   return result_drive + result_path

TypeError: cannot concatenate 'str' and 'tuple' objects

"val" on line 3227 contains
"u'd:\\devMine\\twcbv4\\twcbsrc\\reports\\reportDefs\\cb_listing_portrait.rfxml'"


It looks like the problem is:
os.path.split(u'd:\\devMine\\twcbv4\\twcbsrc\\reports\\reportDefs\\cb_listing_portrait.rfxml')[:1]

as it returns a tuple:
(u'd:\\devMine\\twcbv4\\twcbsrc\\reports\\reportDefs',)

Is this really a change in Py 2.7.8 or am I just not looking at the
correct thing?

It exists in python 2.7.6 too. Try running:
https://gist.github.com/pmcnett/f6dc17f645a994b4f189

Changing line 3227 to:
self.HomeDirectory  = os.path.split(val)[0]

fixes it for me, but why did we do a split and a join at this place in
the first place?

I had to have had a reason, but I'm at a loss for what it could've been. That line exists exactly as it was originally added in 2005:

commit 9eefca09deec292117763eaf51a9da818da1c79c
Author: Paul McNett <[email protected]>
Date:   Thu Oct 13 13:59:38 2005 +0000

Added HomeDirectory property to the report writer, which should always be the
    directory of the current report form xml file, so that images and other
resources can always be found relative to the location of the report form
    file.

I say commit your suggested change.


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

Reply via email to