Ask Your Question
0

dyntools.CHNF TypeError: sequence item 0: expected string, int found

asked 2019-10-18 12:04:36 -0500

xinya gravatar image

In python script: chnf = dyntools.CHNF(outfile,outvrsn=0)

The full error message :

File ".\dyntools.py", line 1411, in init

File ".\dyntools.py", line 247, in init

TypeError: sequence item 0: expected string, int found

What may cause this problem? Thank you

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted
0

answered 2019-10-21 09:38:34 -0500

xinya gravatar image

Thank you all for replying.

It is not caused by either outfile (str) and outvrsn(int), they are both in correct format. I can be sure about that. This script was developed for years and tests with numerous systems. It is the first time we got this error. And there must be some issues in the dynamic run embedded in outfile causing this problem. I will update if I find the bug.

BTW, is there a good manual for dyntools? I am not able to find one.

edit flag offensive delete link more

Comments

import dyntools help('dyntools') It used to print the docstring out in the Python terminal. After reading your reply I now suspect Siemens changed something or what not...

drsgao gravatar imagedrsgao ( 2019-10-21 09:42:49 -0500 )edit

HI , I just came across this questions and answers. Compare to Dyntools in version 33.4 , PTI has drastically changed it in version 34.6. Instead of upgrading and adding more function some of them have been deleted. Any script developed for V33 should be revised for V34.

Clarck gravatar imageClarck ( 2019-11-14 10:35:04 -0500 )edit
0

answered 2019-10-22 19:19:32 -0500

GaryB gravatar image

updated 2019-10-22 19:20:25 -0500

It says sequence item 0 which may be the first argument. I think there’s an issue with setting outfile higher in the code. Check the variable type of it, should be string like it says. I think outvrsn looks fine for 33.12.

edit flag offensive delete link more

Comments

By the way, when things to do with file access abruptly stop working, it’s often a file permissions issue. I don’t know about your situation but just a thought.

GaryB gravatar imageGaryB ( 2019-10-22 19:42:15 -0500 )edit
0

answered 2019-10-18 13:02:10 -0500

drsgao gravatar image

Looks like it needs a string, i.e., '0' , and you gave it an int, i.e., 0.

By the way, what version is you PSSE?

edit flag offensive delete link more

Comments

Thanks for the reply. Yes, I knew it is caused by some mixing of string and int in the out file. But I am not able to locate it according to the error message: File ".\dyntools.py", line 1411, in init File ".\dyntools.py", line 247, in init Any suggestion?

xinya gravatar imagexinya ( 2019-10-18 13:47:20 -0500 )edit

I don't think it is in the OUT file. I think you are giving the method an int argument instead of a string argument, thus the TypeError. Try this: chnf = dyntools.CHNF(outfile, outvrsn='0'). You need to put quotes around the zero to make it a string.

drsgao gravatar imagedrsgao ( 2019-10-18 15:36:06 -0500 )edit

var outvrsn takes an INT, so my guess is that var outfile was giving an INT while expecting a STR.

jconto gravatar imagejconto ( 2019-10-18 18:12:16 -0500 )edit

@jconto I think this should be the answer. By the way, the "outvrsn" argument is added in v34? I don't see it in v33.4.

drsgao gravatar imagedrsgao ( 2019-10-21 02:59:02 -0500 )edit

I think it was added in v33.11. I am using the latest v. 33.12.1

jconto gravatar imagejconto ( 2019-10-21 18:10:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2019-10-18 12:04:36 -0500

Seen: 907 times

Last updated: Oct 22 '19