Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!usenetcore.com!newsfeed.xs4all.nl!newsfeed6.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'debugging': 0.05; 'error:': 0.05; "subject:' ": 0.07; 'python': 0.09; 'open()': 0.09; 'parsed': 0.09; 'received:184.172': 0.09; 'scripts,': 0.09; 'concatenate': 0.16; 'received:69.93': 0.16; 'storing': 0.16; 'wrote:': 0.17; 'code.': 0.20; 'to:name:python-list@python.org': 0.20; 'from:addr:chris': 0.22; 'this:': 0.23; 'feature': 0.24; 'script': 0.24; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'leave': 0.26; 'am,': 0.27; 'subject:list': 0.28; 'post': 0.28; '"in': 0.29; 'cgi': 0.29; 'parameters.': 0.29; 'objects': 0.29; 'source': 0.29; 'probably': 0.29; 'code': 0.31; 'gets': 0.32; 'print': 0.32; 'getting': 0.33; 'correctly.': 0.33; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'text': 0.34; 'built-in': 0.35; 'add': 0.36; 'really': 0.36; 'should': 0.36; 'problems': 0.36; 'possible': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'page': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'remove': 0.61; 'back': 0.62; 'is.': 0.62; '8bit%:100': 0.70; 'received:199': 0.71; 'safe.': 0.93 Date: Sat, 15 Sep 2012 11:13:55 -0500 From: Chris Gonnerman User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: "python-list@python.org" Subject: Re: cannot concatenate 'str' and 'list' objects References: <071ad036-77ca-42d3-b68d-0dd3e3fac43e@googlegroups.com> <9c166e95-e70f-4294-833b-1071a24c6d6d@googlegroups.com> In-Reply-To: <9c166e95-e70f-4294-833b-1071a24c6d6d@googlegroups.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator191.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gonnerman.org X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([10.0.1.176]) [199.127.49.110]:56785 X-Source-Auth: chris@newcenturycomputers.net X-Email-Count: 2 X-Source-Cap: bmV3Y2VudDtuZXdjZW50O2dhdG9yMTkxLmhvc3RnYXRvci5jb20= 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347726873 news.xs4all.nl 6981 [2001:888:2000:d::a6]:43078 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29252 On 09/15/2012 10:23 AM, Νικόλαος Κούρας wrote: > I swicthed back my code to: f = open( '../' + page ) > > and http://superhost.gr works which means that line gets parsed correctly. > > Only when i post data to the text area boxes iam getting the error: > > cannot concatenate 'str' and 'list' objects > > how is this possible to work before and NOT work when i enter data to the page for storing to the database? You really need to add some print-type diagnostics to your script temporarily, just to see what you are actually getting for parameters. For example, put this: print "Content-type: text/plain\n" near the top so you can get a source printout, then add print `page` just before you attempt your open() call so you can see what the exact Python representation of page is. Do similarly for other problems in your code. Don't leave such an "instrumented" copy of your CGI script on your site for very long and you should be safe. Also, consider using the built-in cgi traceback feature in your scripts, at least while you are debugging them (though you probably want to remove the traceback after you are "in production"). -- Chris.