Re: Question about working with html entities in python 2 to use them as filenames

2016-11-23 Thread dieter
Steven Truppe writes: > type= title = Wizo - Anderster Full Album - YouTube > type= title = Wizo - Bleib Tapfer / für'n Arsch Full > Album - YouTube > Traceback (most recent call last): > File "./music-fetcher.py", line 39, in > title = HTMLParser.HTMLParser().unescape(title) > File

Re: Question about working with html entities in python 2 to use them as filenames

2016-11-23 Thread Steven Truppe
type= title = Wizo - Anderster Full Album - YouTube type= title = Wizo - Bleib Tapfer / für'n Arsch Full Album - YouTube Traceback (most recent call last): File "./music-fetcher.py", line 39, in title = HTMLParser.HTMLParser().unescape(title) File "/usr/lib/python2.7/HTMLParser.py",

Re: Question about working with html entities in python 2 to use them as filenames

2016-11-22 Thread Paul Rubin
Steven Truppe writes: > # here i would like to create a directory named after the content of > # the title... I allways get this error: > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2 The title has a à (capital A with tilde) character in it, and there is no corresponding

Re: Question about working with html entities in python 2 to use them as filenames

2016-11-22 Thread Steve D'Aprano
On Wed, 23 Nov 2016 09:00 am, Lew Pitcher wrote: > 2) Apparently os.mkdir() (at least) defaults to requiring an ASCII > pathname. No, you have misinterpreted what you have seen. Even in Python 2, os.mkdir will accept a Unicode argument. You just have to make sure it is given as unicode: os.mkd

Re: Question about working with html entities in python 2 to use them as filenames

2016-11-22 Thread Steve D'Aprano
On Wed, 23 Nov 2016 07:54 am, Steven Truppe wrote: > I've made a pastebin with a few examples: http://pastebin.com/QQQFhkRg Your pastebin appears to be the same code as you've shown here. And, again, it doesn't seem to be the actual code you are really running. The only new or helpful informatio

Re: Question about working with html entities in python 2 to use them as filenames

2016-11-22 Thread Steve D'Aprano
On Wed, 23 Nov 2016 07:33 am, Steven Truppe wrote: > imort chardet That's not working Python code. Steven, you have asked us to help you with some code. For us to do that, we need to see the ACTUAL code you are running, not some other code which is full of typos and may be very different from wh

Re: Question about working with html entities in python 2 to use them as filenames

2016-11-22 Thread Lew Pitcher
On Tuesday November 22 2016 15:54, in comp.lang.python, "Steven Truppe" wrote: > I've made a pastebin with a few examples: http://pastebin.com/QQQFhkRg > > > > On 2016-11-22 21:33, Steven Truppe wrote: >> I all, >> >> >> i'm using linux and python 2 and want to parse a file line by line by >>

Re: Question about working with html entities in python 2 to use them as filenames

2016-11-22 Thread Steven Truppe
I've made a pastebin with a few examples: http://pastebin.com/QQQFhkRg On 2016-11-22 21:33, Steven Truppe wrote: I all, i'm using linux and python 2 and want to parse a file line by line by executing a command with the line (with os.system). My problem now is that i'm opening the file and