Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76545 > unrolled thread

Re: python scikits.audiolab Sndfile special chars in file name

Started byFurqan wasi <furqan@avpreserve.com>
First post2014-08-19 11:52 +0500
Last post2014-08-19 11:52 +0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: python scikits.audiolab Sndfile special chars in file name Furqan wasi <furqan@avpreserve.com> - 2014-08-19 11:52 +0500

#76545 — Re: python scikits.audiolab Sndfile special chars in file name

FromFurqan wasi <furqan@avpreserve.com>
Date2014-08-19 11:52 +0500
SubjectRe: python scikits.audiolab Sndfile special chars in file name
Message-ID<mailman.13133.1408437925.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

*yes you are right , it through's this exception that "The system cannot
find the path specified." but in fact it exists , so thats why i tried to
pass the file name by handling file name by applying different non utf
character solution but no of those work *

*track_one_file_obj = Sndfile(track1, 'r')*

*Traceback (most recent call last):*
  File "D:/python/Interstitial Project/test.py", line 10, in <module>
    track_one_file_obj = Sndfile(track1, 'r')
  File "_sndfile.pyx", line 488, in
scikits.audiolab.pysndfile._sndfile.Sndfile.__init__
(scikits\audiolab\pysndfile\_sndfile.c:4251)
IOError: error while opening C:\Users\Furqan\Desktop\查找問題Reference\1.wav
 ->error while opening file C:\Users\Furqan\Desktop\查找問題Reference\1.wav
-> System error : The system cannot find the path specified.

*and gives the exception if use this code *

 *track_one_file_obj = Sndfile(track1.decode('utf-8'), 'r')*
*print(track_one_file_obj)*

Traceback (most recent call last):
  File "D:/python/Interstitial Project/test.py", line 28, in <module>
    track_one_file_obj = Sndfile(track1.decode('utf-8'), 'r')
  File "_sndfile.pyx", line 471, in
scikits.audiolab.pysndfile._sndfile.Sndfile.__init__
(scikits\audiolab\pysndfile\_sndfile.c:4092)
UnicodeEncodeError: 'ascii' codec can't encode characters in position
24-27: ordinal not in range(128)

and gives exception if i use
*track_one_file_obj = Sndfile(track1.encode('utf-8'), 'r')*


*print(track_one_file_obj)*
Traceback (most recent call last):
  File "D:/python/Interstitial Project/test.py", line 19, in <module>
    track_one_file_obj = Sndfile(track1.encode('utf-16'), 'r')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 24:
ordinal not in range(128)

so far what i am getting that the Sndfile or libsndfile library dose not
support file name which has special character in its name , so i am a bit
stuck with this

*Thanks *



On Tue, Aug 19, 2014 at 6:42 AM, Chris Angelico <rosuav@gmail.com> wrote:

> On Tue, Aug 19, 2014 at 1:34 AM, Furqan wasi <furqan@avpreserve.com>
> wrote:
> > except:
> >     print('Simple didnt work')
> >     pass
>
> Drop all of these bare excepts. Let the exceptions get printed.
> Believe you me, they are a LOT more helpful than "didnt work".
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 

*Best Regards*

Furqan Wasi
*AVPreserve *

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web