termios error from Python and /dev/FIM0

Hi All,
I have a very simple test program to set the serial attributes for /dev/ttyFIM0. I am getting a termio.error: (22, ‘Invalid argument’) error message when I try to set a new speed attribute. Plus a print of the get attribute list doesn’t look right either. Here is my program:

import os
import termios

serfd = os.open( ‘/dev/ttyFIM0’, os.O_RDWR | os.O_NOCTTY)
print ‘termios =’, termios.tcgetattr( serfd)
old = termios.tcgetattr(serfd)
old[4] = 38400 # ispeed
old[5] = 38400 # ospeed
termios.tcsetattr(serfd, termios.TCSANOW, old)

The print show 13 and 13 for the baud rate which is bogus.
try/except left out for clarity
Any help is appreciated.

DOH! Forgot to mention my platform and tools.

ConnectMe 9210
Linux Digi 5.7

There is no USB port on that, so tty port cannot be used. The value is printed is file descriptor value, not the port number value. You can use port number as ‘/com/0’.