Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '"the': 0.07; 'subject:file': 0.07; 'subject:skip:s 10': 0.07; 'encode': 0.09; 'except:': 0.09; 'thats': 0.09; 'cc:addr:python-list': 0.11; '*and': 0.16; '->': 0.16; 'codec': 0.16; 'dose': 0.16; 'ioerror:': 0.16; 'ordinal': 0.16; 'subject:python': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'library': 0.18; 'bit': 0.19; 'aug': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'byte': 0.24; 'exists': 0.24; 'helpful': 0.24; 'non': 0.24; 'cc:2**0': 0.24; '>': 0.26; 'handling': 0.26; 'pass': 0.26; 'skip:" 20': 0.27; 'header:In- Reply-To:1': 0.27; 'tried': 0.27; 'chris': 0.29; 'am,': 0.29; 'character': 0.29; 'characters': 0.30; 'skip:( 40': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'gives': 0.31; 'code': 0.31; 'getting': 0.31; 'didnt': 0.31; 'exceptions': 0.31; 'file': 0.32; 'url:python': 0.33; '(most': 0.33; '"the': 0.34; "can't": 0.35; 'skip:s 30': 0.35; 'skip:u 20': 0.35; 'but': 0.35; 'received:google.com': 0.35; '8bit%:9': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'skip:& 10': 0.38; 'fact': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'skip:p 20': 0.39; 'url:mail': 0.40; 'skip:u 10': 0.60; 'skip:c 50': 0.60; 'skip:\xc2 10': 0.60; 'skip:* 10': 0.61; 'name': 0.63; 'more': 0.64; 'different': 0.65; 'to:addr:gmail.com': 0.65; 'believe': 0.68; 'yes': 0.68; 'applying': 0.72; 'special': 0.74; '8bit%:16': 0.84; '8bit%:24': 0.84; 'bare': 0.84; '*best': 0.91; '*thanks': 0.91; 'regards*': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geekschicago.com; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=rE2/28mfjHoEJgL+v1iRAr0ubisS5evhW6gi2WCnca0=; b=PAQjCAMw8sPMStUTq5YWWkmnv5X01DTrr45xJY5evsYD+ZQq5Go2FS8hbvKSpE0j1R zsGF+L1kYwFIPs7F7dCPvDiL0e6nldaOAZgK8VSHrFhfJZBd6jDPWHqE1hpjtt2UoTeN EsghNvlWASQUJbgozCCchAzGrj04PigH1m6AU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=rE2/28mfjHoEJgL+v1iRAr0ubisS5evhW6gi2WCnca0=; b=O+38j+9rdPOhv/CxxvtXi0FyN/q3VErBS1xwjH27zHouLn3jaVcPGHuG5wMxtm9njA S3V7ds6dYbhwmA/xD9dyJh3cZKIANbyvpREQpZX/uXxsC1n1twgOPh6VEZuXzaVgnxka crUnyOsdgOzm3rfVrX59bXqP3lmU1J525RIyfFzP7HxK0IIJpAxmN3RAGpIFOUy1U4Fk Q8TduPI3XAOHBy7S2yxmQsCeqfO5UqFjwySrLHDmfCQkrSfVZadX0sn2W6G/ndhsEvm8 TDAsuOROjbL6vpIa9EMNDihHARe1rSlh++Aw/l0vUD1CcbI5lHPH6DsM+lltA39c6tXi tPTg== X-Gm-Message-State: ALoCoQndp/Lrq62REb5uBnAmLAjAplGUlEZMogCPbD0lTY5kJp0fZGukShelm52/zh3ItspEDl6U X-Received: by 10.224.3.67 with SMTP id 3mr66460442qam.26.1408431197984; Mon, 18 Aug 2014 23:53:17 -0700 (PDT) MIME-Version: 1.0 Sender: furqan@geekschicago.com X-Originating-IP: [202.166.163.98] In-Reply-To: References: From: Furqan wasi Date: Tue, 19 Aug 2014 11:52:37 +0500 X-Google-Sender-Auth: RkuTPTZZm22DrE1N3SwaxDr_NSY Subject: Re: python scikits.audiolab Sndfile special chars in file name To: Chris Angelico Content-Type: multipart/alternative; boundary=047d7b6709753fe5520500f5f1e8 X-Mailman-Approved-At: Tue, 19 Aug 2014 10:45:24 +0200 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 197 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408437925 news.xs4all.nl 2831 [2001:888:2000:d::a6]:36487 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76545 --047d7b6709753fe5520500f5f1e8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable *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 =3D Sndfile(track1, 'r')* *Traceback (most recent call last):* File "D:/python/Interstitial Project/test.py", line 10, in track_one_file_obj =3D 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\=E6=9F=A5=E6=89=BE=E5= =95=8F=E9=A1=8CReference\1.wav ->error while opening file C:\Users\Furqan\Desktop\=E6=9F=A5=E6=89=BE=E5= =95=8F=E9=A1=8CReference\1.wav -> System error : The system cannot find the path specified. *and gives the exception if use this code * *track_one_file_obj =3D 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 track_one_file_obj =3D 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 =3D 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 track_one_file_obj =3D 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 wrote: > On Tue, Aug 19, 2014 at 1:34 AM, Furqan wasi > 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 > --=20 *Best Regards* Furqan Wasi *AVPreserve * --047d7b6709753fe5520500f5f1e8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
yes you are rig= ht ,=C2=A0

it through's this exception that "The system can= not find the path specified." but in fact it exists , so thats why i t= ried to pass the file name by handling file name by applying different non = utf character solution but no of those work=C2=A0

track_one_file_obj =3D Sndfile(track1, 'r')
Traceback (most recent call last):
=C2=A0 File "D:/python/Interstitial Project/test.py", line 10, in= <module>
=C2=A0 =C2=A0 track_one_file_obj =3D Sndfil= e(track1, 'r')
=C2=A0 File "_sndfile.pyx", line 488, in scikits.audio= lab.pysndfile._sndfile.Sndfile.__init__ (scikits\audiolab\pysndfile\_sndfil= e.c:4251)
IOError: error while opening C:\Users\Furqan\Desktop\=E6=9F=A5= =E6=89=BE=E5=95=8F=E9=A1=8CReference\1.wav
->error while opening= file C:\Users\Furqan\Desktop\=E6=9F=A5=E6=89=BE=E5=95=8F=E9=A1=8CReference= \1.wav
-= > System error : The system cannot find the path specified.

and gives the exception if use=C2=A0this code=C2=A0

track_one_file_obj =3D Sndfile(track1.decode('utf-8'), 'r= 9;)
print(track_one_file_obj)

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

and gives exception if i use=C2=A0
track_one_= file_obj =3D Sndfile(track1.encode('utf-8'), 'r')
=
print(track_one_file_obj)

= Traceback (most recent call last):
=C2=A0= File "D:/python/Interstitial Project/test.py", line 19, in <m= odule>
=C2=A0 =C2=A0 track_one_file_obj =3D Sndfile(t= rack1.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 g= etting that the=C2=A0Sndfile=C2=A0or libsndfile=C2=A0library=C2=A0dose not = support file name which has special character in its name , so i am a bit s= tuck with this=C2=A0

Thanks=C2=A0



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@avpres= erve.com> wrote:
> except:
>=C2=A0 =C2=A0 =C2=A0print('Simple didnt work')
>=C2=A0 =C2=A0 =C2=A0pass

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=C2=A0

--047d7b6709753fe5520500f5f1e8--