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


Groups > comp.lang.python > #76545

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

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 <furqan@geekschicago.com>
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; '&quot;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; '-&gt;': 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&gt;': 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; '&gt;': 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 <CAPTjJmrcmBLeBY9Wo-twvT1KVq0MP5LnLPAE8kKrnaN8W8Bg7g@mail.gmail.com>
References <CABy8q84h2Cs9o9byiPC6wsOu_=E49tRagxrVerrKCBBxFv73+g@mail.gmail.com> <CAPTjJmrcmBLeBY9Wo-twvT1KVq0MP5LnLPAE8kKrnaN8W8Bg7g@mail.gmail.com>
From Furqan wasi <furqan@avpreserve.com>
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 <rosuav@gmail.com>
Content-Type multipart/alternative; boundary=047d7b6709753fe5520500f5f1e8
X-Mailman-Approved-At Tue, 19 Aug 2014 10:45:24 +0200
Cc "python-list@python.org" <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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13133.1408437925.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


[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 *

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web