Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'case.': 0.05; 'frameworks': 0.05; 'skip:\\ 20': 0.05; "subject:' ": 0.07; 'python': 0.09; "(i'd": 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sep': 0.09; 'encoding': 0.15; 'sat,': 0.15; 'weird': 0.15; 'argument.': 0.16; 'buggy': 0.16; 'proceeding': 0.16; 'received:80.91.229.3': 0.16; 'received:dip.t-dialin.net': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-dialin.net': 0.16; 'url:foo': 0.16; 'url:py': 0.16; 'wrote:': 0.17; 'duplicate': 0.17; 'element': 0.17; '>>>': 0.18; 'variable': 0.20; 'written': 0.20; 'latter': 0.22; 'work.': 0.23; '15,': 0.23; 'tried': 0.25; 'header:User-Agent:1': 0.26; 'plain': 0.27; 'possibly': 0.27; "doesn't": 0.28; 'header:X -Complaints-To:1': 0.28; 'subject:list': 0.28; 'chris': 0.28; 'initial': 0.28; 'knows': 0.30; "skip:' 10": 0.30; 'code': 0.31; 'problem.': 0.32; 'switch': 0.32; 'print': 0.32; 'extract': 0.33; 'turns': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'changed': 0.34; 'list': 0.35; 'pm,': 0.35; 'too.': 0.35; 'something': 0.35; 'received:org': 0.36; 'but': 0.36; 'too': 0.36; 'rather': 0.37; 'subject:: ': 0.38; 'page': 0.38; 'gives': 0.39; 'to:addr:python.org': 0.39; 'list,': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'solve': 0.62; 'visit': 0.64; 'url:cgi-bin': 0.66; '8bit%:100': 0.70; '8bit%:92': 0.70; 'url:page': 0.71; '1st': 0.81; 'url:counter': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: cannot concatenate 'str' and 'list' objects Date: Sat, 15 Sep 2012 16:29:29 +0200 Organization: None References: <071ad036-77ca-42d3-b68d-0dd3e3fac43e@googlegroups.com> <2138d293-c411-404d-bbf1-1afbae3fc597@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Gmane-NNTP-Posting-Host: p5084a73e.dip.t-dialin.net User-Agent: KNode/4.7.3 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: 56 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347719347 news.xs4all.nl 6889 [2001:888:2000:d::a6]:58836 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29232 Νικόλαος Κούρας wrote: > Τη Σάββατο, 15 Σεπτεμβρίου 2012 4:38:51 μ.μ. UTC+3, ο χρήστης Chris > Angelico έγραψε: >> On Sat, Sep 15, 2012 at 11:28 PM, Νικόλαος Κούρας >> wrote: >> >> > Iam not using frameworks just plain python code written in Notepad++ >> >> > >> >> > Can you please tell me how to switch this line in order for this line >> > to work? >> >> >> >> f = open( '../' + page[0]) >> >> >> >> will possibly work. But do try to understand what's happening, rather >> >> than simply solve the problem. You may find that something else has >> >> changed too. >> >> >> >> ChrisA > > i see you try to extract only the 1st element of the list, i tried that > too but it gives me now this weird message: > > if you visit my website http://superhost.gr You seem to have encoding problems: >>> print '\xc4\xe5\xed \xf5\xf0\xdc\xf1\xf7\xe5\xe9 \xf4\xdd\xf4\xef\xe9\xef \xe1\xf1\xf7\xe5\xdf\xef \xde \xea\xe1\xf4\xdc\xeb\xef\xe3\xef\xf2'.decode("iso-8859-7") Δεν υπάρχει τέτοιο αρχείο ή κατάλογος That doesn't look weird (I'd guess) for someone who knows Greek... Proceeding to http://superhost.gr/cgi-bin/counter.py?page=foo.html versus http://superhost.gr/cgi-bin/counter.py?page=foo.html&page=bar.html it turns out that you get a list as the page variable only in the latter case. So you might have provoked your initial problem by following a buggy url with a duplicate page argument.