New submission from Tom Kuiper <kui...@jpl.nasa.gov>: Normal behavior: >>> from os import path >>> filename = "/home/kuiper/Projects/microdischarges/Observing/2009-09-01/STATS_NP2000_VSR1A.1W1.09-244-193632" >>> print filename /home/kuiper/Projects/microdischarges/Observing/2009-09-01/STATS_NP2000_VSR1A.1W1.09-244-193632 >>> print path.basename(filename) STATS_NP2000_VSR1A.1W1.09-244-193632
Abnormal behavior in class method: from os import path ... def openDataFile(self): filename = QFileDialog.getOpenFileName(self, 'Open file','.') self.datafile.setTextpath.basename(filename)) ... Traceback (most recent call last): File "newWF.py", line 277, in openDataFile self.datafile.setText(os.path.basename(filename)) File "/usr/lib/python2.5/posixpath.py", line 112, in basename return split(p)[1] File "/usr/lib/python2.5/posixpath.py", line 77, in split i = p.rfind('/') + 1 AttributeError: rfind ---------- files: newWF.py messages: 94167 nosy: kuiper severity: normal status: open title: os.path.basename/split fails type: behavior versions: Python 2.5 Added file: http://bugs.python.org/file15153/newWF.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7158> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com