➜

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 eryksun
Recipients Marko Mavrinac, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Date 2017-03-16.15:04:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489676699.23.0.290247419123.issue29827@psf.upfronthosting.co.za>
In-reply-to
Content
In a string literal, '\t' represents a tab character (ordinal 9). Windows filenames cannot contain control characters [1], i.e. ordinals 1-31. For path literals I recommend using forward slashes and normalizing via os.path.normpath, e.g. filepath = os.path.normpath('C:/Users/mavri/Desktop/proba/testni.wav'). 

FYI, the way exists() is written handles any OSError as False:

    def exists(path):
        try:
            os.stat(path)
        except OSError:
            return False
        return True

In your case, stat() fails with ERROR_INVALID_NAME (123):

    >>> os.stat('\testni.wav')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: [WinError 123] The filename, directory name, or volume label
    syntax is incorrect: '\testni.wav'

[1]: https://msdn.microsoft.com/en-us/library/aa365247#naming_conventions
History
Date User Action Args
2017-03-16 15:04:59eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, Marko Mavrinac
2017-03-16 15:04:59eryksunsetmessageid: <1489676699.23.0.290247419123.issue29827@psf.upfronthosting.co.za>
2017-03-16 15:04:59eryksunlinkissue29827 messages
2017-03-16 15:04:58eryksuncreate