holgerBerger / hpc-workspace

Automatically exported from code.google.com/p/hpc-workspace
GNU General Public License v3.0
18 stars 13 forks source link

BugFix ws_register: typo in function call readlines() #70

Closed URZ-HD closed 3 years ago

URZ-HD commented 3 years ago

When using ws_register with "old" db format the following exception occurs:

> ws_register ws
Traceback (most recent call last):
  File "/usr/local/bin/ws_register", line 135, in <module>
    wsname=f['workspace']
TypeError: string indices must be integers

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/ws_register", line 137, in <module>
    f=open(fname).readines()
AttributeError: '_io.TextIOWrapper' object has no attribute 'readines'

Can be fixed with corrected typo "readines()" -> "readlines()" in "except TypeError" block.

cniethammer commented 3 years ago

I cannot reproduce this.

Could you provide the following info:

cniethammer commented 3 years ago

@URZ-HD I included the fix for the readlines() typo in PR #72 . Still not sure, where your other problem comes from.

URZ-HD commented 3 years ago

@cniethammer You mean the TypeError itself ? It occurs when some workspace-db files of the user have the old database format (not yaml). So this behaviour is expected and the exception works correctly with fixed typo.