This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author markon
Recipients kuiper, markon
Date 2009-10-17.11:14:46
SpamBayes Score 1.7212014e-07
Marked as misclassified No
Message-id <1255778090.32.0.308260191777.issue7158@psf.upfronthosting.co.za>
In-reply-to
Content
I think this is not a Python bug, since it concerns PyQt. 

You're passing a QString object to os.path.split(), while the official
documentation wants you pass a Python string.

However, when I tried to run your example, newWF.py, and tried to open a
file from the menu, I got this:

controls.nch: 1024                                                    
Controls Window data shape: (511, 1024)
Data file: None
/home/marco/Programmi/Python-2.6.3/pyconfig.h
Traceback (most recent call last):
  File "issue7158.py", line 277, in openDataFile
    head,tail = os.path.split(filename)
  File "/usr/lib/python2.5/posixpath.py", line 77, in split
    i = p.rfind('/') + 1
AttributeError: 'QString' object has no attribute 'rfind'

Why does this happen? 
`filename` is a QString object. (you can see why here:
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qfiledialog.html#getOpenFileName
)

So how do you split your filename? I don't know.

I should close this bug.
History
Date User Action Args
2009-10-17 11:14:50markonsetrecipients: + markon, kuiper
2009-10-17 11:14:50markonsetmessageid: <1255778090.32.0.308260191777.issue7158@psf.upfronthosting.co.za>
2009-10-17 11:14:47markonlinkissue7158 messages
2009-10-17 11:14:46markoncreate