cgat-developers / ruffus

CGAT-ruffus is a lightweight python module for running computational pipelines
MIT License
173 stars 34 forks source link

Python3 text/binary error in drmaa_wrapper #46

Closed ghost closed 9 years ago

ghost commented 9 years ago

In the drmaa_wrapper.py module, line 204 tmpfile = tempfile.NamedTemporaryFile(mode='w+b' ... ) the temp file to write the job script is opened in binary mode while the data is passed as string in lines 209ff: tmpfile.write( "#!/bin/sh\n" ) This is not possible in Python3. I guess passing a bytes object should work for both Python2.X and Python3.X

Peter

bunbun commented 9 years ago

unicode support in python3 has been difficult to get right while maintaining backwards compatibility. It doesn't help that there is no automatic unit-testing for drmaa-wrapper in travis-ci... : No computational cluster yet in travis-ci :-) I need to at least write unit-tests for the non drmaa parts of module.

ghost commented 9 years ago

I know what you mean, I was hit by the same type of error over and over again when I started developing in Python3 :-) Regarding the unit testing, I would be happy to help testing the code on our cluster; I could also contribute of few test case, but I would require some guidance how to properly isolate them so that the test suite does not produce failing tests in a non-cluster environment.

bunbun commented 9 years ago

Fixed. Unittest in test_drmaa_wrapper_run_job_locally.py.