I get the above mentioned error while trying to open a file:
ff=TFile('blah.root', 'recreate')
ff.close()
same happens with the with style. A similar issue has been posted here. There it seems that the problem would be solved by upgrading to version 6.24. I have now version 6.26 so I am not sure whether there is a workaround for this.