0

I'm using Jython, through Topspin (NMR Software running on Java) to run the following code:

home = "C:/Bruker/TopSpin3.2"
ep_zges_outdir = os.path.abspath(home + "/data/Testshutil/nmr/zges/")
data = ["EP_Saliva_140131_raw", "1", "1", "C:/Bruker/TopSpin3.2/data/Testshutil/nmr"]
ep_zges_list = [["EP_Saliva_140131_raw",25,334],...]

for sample in ep_zges_list:
    if data[0] == sample[0] and data[1] == str(sample[1]):
        src = os.path.abspath(data[3] + "/" + data[0] + "/" + data[1])
        dst = os.path.abspath(ep_zges_outdir + "/" + str(sample[2]))
        shutil.copytree(src, dst)

Proper imports were done and, when it works, no os.path.abspath is necessary.

This works perfectly in Windows/Linux python and through the same Software that runs Jython in CentOS. It does not run in the Software/Jython in Windows 7 and the following error is produced:

Traceback (most recent call last):
  File "C:/Bruker/TopSpin3.2/exp/stan/nmr/py/user/JF_test_code_8.py", line 41, in <module>
    shutil.copytree(os.path.abspath(data[3] + "/" + data[0] + "/" + data[1]), os.path.abspath(ep_zges_outdir + "/" + str(sample[2])))
  File "C:\Bruker\TopSpin3.2\jython\Lib\shutil.py", line 145, in copytree
    raise Error, errors
shutil.Error: [u'C:\\Bruker\\TopSpin3.2\\data\\Testshutil\\nmr\\EP_Saliva_140310_raw\\1\\pdata\\1', 
u'C:\\Bruker\\TopSpin3.2\\data\\Testshutil\\nmr\\zges\\334\\pdata\\1', 
"[Errno 5] Input/output error: u'C:\\\\Bruker\\\\TopSpin3.2\\\\data\\\\Testshutil\\\\nmr\\\\zges\\\\334\\\\pdata\\\\1'", 
u'C:\\Bruker\\TopSpin3.2\\data\\Testshutil\\nmr\\EP_Saliva_140310_raw\\1\\pdata', 
u'C:\\Bruker\\TopSpin3.2\\data\\Testshutil\\nmr\\zges\\334\\pdata', 
"[Errno 5] Input/output error: u'C:\\\\Bruker\\\\TopSpin3.2\\\\data\\\\Testshutil\\\\nmr\\\\zges\\\\334\\\\pdata'", 
u'C:\\Bruker\\TopSpin3.2\\data\\Testshutil\\nmr\\EP_Saliva_140310_raw\\1', 
u'C:\\Bruker\\TopSpin3.2\\data\\Testshutil\\nmr\\zges\\334', 
"[Errno 5] Input/output error: u'C:\\\\Bruker\\\\TopSpin3.2\\\\data\\\\Testshutil\\\\nmr\\\\zges\\\\334'"]

Software versions: Windows 7 SP1 64bit. Python 2.7 32bit. Jython 2.5.3 running on Topspin 3.2 and Java 1.7.0_51.

CentOS 6.5 32Bit Jython 2.5.3 running on Topspin 3.2 and Java 1.7.0_45

1 Answer 1

1

I think this is a Jython bug (a very annoying one). See

http://bugs.jython.org/issue1872

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! I did what was described here for the copystat function: bugs.jython.org/msg7033

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.