Hi James,
I just submitted a pull request about this; a patch is attached to this
e-mail. To apply the patch, cd to $RDBASE and issue the following command:
patch -p0 < patch20150713.txt
Best,
p.
On 13/07/2015 15:16, James Davidson wrote:
Dear All,
I have just built revision 5775 on Windows, and the pyGraphMolWrap
test fails. The relevant bit of the verbose output is below:
78: ERROR: testGithub498 (__main__.TestCase)
78: ----------------------------------------------------------------------
78: Traceback (most recent call last):
78: File "C:/RDKit/Code/GraphMol/Wrap/rough_test.py", line 3033, in
testGithub498
78: outf = gzip.open(tempfile.mktemp(),'wt+')
78: File "C:\Anaconda\lib\gzip.py", line 34, in open
78: return GzipFile(filename, mode, compresslevel)
78: File "C:\Anaconda\lib\gzip.py", line 94, in __init__
78: fileobj = self.myfileobj = __builtin__.open(filename, mode or
'rb')
78: ValueError: Invalid mode ('wt+b')
This seems to be due to a difference in python/gzip behaviour on
Windows vs. eg Linux:
*On Ubuntu (Anaconda python):*
In [1]: import tempfile, gzip
In [2]: outf = gzip.open(tempfile.mktemp(), 'wt+')
In [3]:
*On Windows (again Anaconda python):*
In [1]: import tempfile, gzip
In [2]: outf = gzip.open(tempfile.mktemp(), 'wt+')
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-6bee12287576> in <module>()
----> 1 outf = gzip.open(tempfile.mktemp(), 'wt+')
C:\Anaconda\lib\gzip.pyc in open(filename, mode, compresslevel)
32
33 """
---> 34 return GzipFile(filename, mode, compresslevel)
35
36 class GzipFile(io.BufferedIOBase):
C:\Anaconda\lib\gzip.pyc in __init__(self, filename, mode,
compresslevel, fileobj, mtime)
92 mode += 'b'
93 if fileobj is None:
---> 94 fileobj = self.myfileobj =
__builtin__.open(filename, mode or 'rb')
95 if filename is None:
96 # Issue #13781: os.fdopen() creates a fileobj with
a bogus name
ValueError: Invalid mode ('wt+b')
In [3]:
Is this an easy one to fix?
Kind regards
James
______________________________________________________________________
PLEASE READ: This email is confidential and may be privileged. It is
intended for the named addressee(s) only and access to it by anyone
else is unauthorised. If you are not an addressee, any disclosure or
copying of the contents of this email or any action taken (or not
taken) in reliance on it is unauthorised and may be unlawful. If you
have received this email in error, please notify the sender or
[email protected]. Email is not a secure method of communication
and the Company cannot accept responsibility for the accuracy or
completeness of this message or any attachment(s). Please check this
email for virus infection for which the Company accepts no
responsibility. If verification of this email is sought then please
request a hard copy. Unless otherwise stated, any views or opinions
presented are solely those of the author and do not represent those of
the Company.
The Vernalis Group of Companies
100 Berkshire Place
Wharfedale Road
Winnersh, Berkshire
RG41 5RD, England
Tel: +44 (0)118 938 0000
To access trading company registration and address details, please go
to the Vernalis website at www.vernalis.com and click on the "Company
address and registration details" link at the bottom of the page..
______________________________________________________________________
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
*** Code/GraphMol/Wrap/rough_test.new.py Mon Jul 13 23:19:32 2015
--- Code/GraphMol/Wrap/rough_test.orig.py Mon Jul 13 23:18:35 2015
***************
*** 3030,3040 ****
def testGithub498(self):
import gzip,tempfile
! if (sys.version_info < (3, 0)):
! mode = 'w+'
! else:
! mode = 'wt+'
! outf = gzip.open(tempfile.mktemp(), mode)
m = Chem.MolFromSmiles('C')
w = Chem.SDWriter(outf)
w.write(m)
--- 3030,3036 ----
def testGithub498(self):
import gzip,tempfile
! outf = gzip.open(tempfile.mktemp(), 'wt+')
m = Chem.MolFromSmiles('C')
w = Chem.SDWriter(outf)
w.write(m)
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss