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


Groups > comp.lang.python > #76484

python scikits.audiolab Sndfile special chars in file name

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'encoding': 0.05; '-*-': 0.07; 'subject:file': 0.07; 'subject:skip:s 10': 0.07; 'utf-8': 0.07; 'advance': 0.07; 'coding:': 0.09; 'except:': 0.09; 'try:': 0.09; 'subject:python': 0.16; 'trying': 0.19; 'passing': 0.19; 'import': 0.22; 'fine': 0.24; 'pass': 0.26; 'tried': 0.27; 'characters': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'didnt': 0.31; "skip:' 40": 0.31; 'skip:r 60': 0.31; 'file': 0.32; 'could': 0.34; 'skip:s 30': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'thanks': 0.36; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'unable': 0.39; 'skip:p 20': 0.39; 'how': 0.40; 'read': 0.60; 'information': 0.63; 'skip:r 40': 0.68; 'special': 0.74; 'stat': 0.84; '*best': 0.91; 'regards*': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=geekschicago.com; s=google; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=eN/FRoD8w91er9M62F9E36Ly61ykzLhE+s2aMAq8Bcw=; b=J5fCzdR6V4ec2vm2x0aXroQv6w9fYUirPKSl42vWbj7KfsYX3EmYlYvclc/Y1b/Xiv O6q+KdQGaeZKkEhX1Zk0wm8aMTi1NzuDmnnzmytuEeioapTSXtggU/Nlu0ACoAjFx2J/ SHIPTRua7ZcnHuafCKN3wCoJiLOdV2B69+qjc=
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:from:date:message-id:subject :to:content-type; bh=eN/FRoD8w91er9M62F9E36Ly61ykzLhE+s2aMAq8Bcw=; b=fx8CpihQ3ovuzg7dRY7Tk8F3svlWg1r8qiY9q3D3ZKaMf8VQJKetemHxFEPoSaKNql cNTBwC15Pvtud6ASrXnyxbxRE04ndEDNLg3ffru4NxHi67iiILHlGVSeVqFJPE5TWChx Q/82psPebbYpgqjo6ZHNi8ne1q8ZdgpSHHnQsNr7fIHVg48UTsEuOoXjHOd9EbrU90yp MzsUs66Xbl/D4aPOUawPOdZYNXKdBMAn4pkuoxFjxOPg8pWmYJtV/UTpebCKnL+FCNDW Bax9e4n1YiDNXCRs3LUejJ/QxP6LNO6vI0eBH2laQVCfk9UTIGvXcKTzIHld0lUmkkPN k6yg==
X-Gm-Message-State ALoCoQkHWto3NAJ4InlF/NxR3XhAYMO0CaS+Q3w0Akm650mFoVp2POJTDqZ3Yyvz2cmwCeddjA1J
X-Received by 10.140.95.241 with SMTP id i104mr54189790qge.6.1408376086741; Mon, 18 Aug 2014 08:34:46 -0700 (PDT)
MIME-Version 1.0
Sender furqan@geekschicago.com
X-Originating-IP [202.166.163.98]
From Furqan wasi <furqan@avpreserve.com>
Date Mon, 18 Aug 2014 20:34:06 +0500
X-Google-Sender-Auth z1SRrIsZfd7q-KP8Sl-wlZYWJV0
Subject python scikits.audiolab Sndfile special chars in file name
To python-list@python.org
Content-Type multipart/alternative; boundary=001a11c169ae5c5fad0500e91c5c
X-Mailman-Approved-At Mon, 18 Aug 2014 18:46:09 +0200
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.13101.1408380370.18130.python-list@python.org> (permalink)
Lines 231
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1408380370 news.xs4all.nl 2913 [2001:888:2000:d::a6]:49486
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76484

Show key headers only | View raw


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

Hi ,

Could you help me out on this , or guide me to some how can thanks

I am trying to get a wav file information but Sndfile is unable to read
file with special characters in path and file name(查找問題daw.wav) and i am
unable to get information in any way , i tried passing file path to Sndfile
 with diferent encoding to but didnt work , but if i pass this
'C:\Users\Furqan\Desktop\test\DAW\1.wav' it works fine , Thanks is advance

My Code is
# -*- coding: UTF-8 -*-
from scikits.audiolab import Sndfile
from os import walk, path, stat

track1 =  r'C:\Users\Furqan\Desktop\test\查找問題daw\查找問題d.wav'
#track2 = r'C:\Users\Furqan\Desktop\test\DAW\1.wav'

try:
    track_one_file_obj = Sndfile(track1, 'r')
except:
    print('Simple didnt work')
    pass

try:
    track_one_file_obj = Sndfile(track1.decode('cp1252'), 'r')
except:
    print('cp1252 didnt work')
    pass

try:
    track_one_file_obj = Sndfile(track1.encode('utf-8'), 'r')
    print(track_one_file_obj)
except:
    print('encode didnt work')
    pass


try:
    track_one_file_obj = Sndfile(track1.encode('utf8'), 'r')
    print(track_one_file_obj)
except:
    print('encode didnt work')
    pass

try:
    track_one_file_obj = Sndfile(track1.decode('utf-8'), 'r')
    print(track_one_file_obj)
except:
    print('decode didnt work')
    pass

-- 

*Best Regards*

Furqan Wasi
*AVPreserve *

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


Thread

python scikits.audiolab Sndfile special chars in file name Furqan wasi <furqan@avpreserve.com> - 2014-08-18 20:34 +0500

csiph-web