Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #43514
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <nagia.retsina@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'scripts': 0.03; 'messages.': 0.05; 'output': 0.05; 'subject:Python': 0.06; 'python3': 0.07; 'skip:" 60': 0.07; 'utf-8': 0.07; 'skip:/ 10': 0.09; 'to:addr:comp.lang.python': 0.09; 'runs': 0.10; 'cc:addr :python-list': 0.11; 'python': 0.11; 'apache': 0.15; '*i*': 0.16; '23,': 0.16; 'codec': 0.16; 'doesnt': 0.16; 'enough.': 0.16; 'script?': 0.16; 'scripts.': 0.16; 'simpson': 0.16; 'skip:[ 30': 0.16; 'stderr': 0.16; 'subject:Unicode': 0.16; 'subject:issue': 0.16; 'sys.stderr': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'user.': 0.19; 'command': 0.22; 'cc:addr:gmail.com': 0.22; 'shell': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'byte': 0.24; 'please?': 0.24; 'settings.': 0.24; 'specify': 0.24; 'switched': 0.24; 'cheers,': 0.24; 'file.': 0.24; 'environment': 0.24; 'script': 0.25; 'permission': 0.26; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'testing': 0.29; 'character': 0.29; 'related': 0.29; 'cc:2**2': 0.30; 'errors': 0.30; 'cgi': 0.31; 'didnt': 0.31; 'go.': 0.31; 'file': 0.32; 'there.': 0.32; 'this.': 0.32; 'run': 0.32; 'running': 0.33; '(most': 0.33; 'cc:no real name:2**1': 0.33; 'plain': 0.33; 'maybe': 0.34; 'subject:with': 0.35; "can't": 0.35; 'display': 0.35; 'case,': 0.35; 'good.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'useful': 0.36; 'possible': 0.36; 'should': 0.36; 'so,': 0.37; 'skip:o 20': 0.38; 'server': 0.38; 'skip:& 10': 0.38; 'thank': 0.38; 'depends': 0.38; 'files': 0.38; 'issue': 0.38; 'recent': 0.39; 'does': 0.39; 'skip:. 10': 0.39; 'sure': 0.39; 'even': 0.60; 'skip:u 10': 0.60; 'commands': 0.60; 'skip:c 50': 0.60; 'tell': 0.60; 'from:no real name:2**0': 0.61; 'skip:o 30': 0.61; 'you.': 0.62; 'back': 0.62; 'complete': 0.62; 'email addr:gmail.com': 0.63; 'such': 0.63; 'more': 0.64; 'different': 0.65; 'here': 0.66; 'direct': 0.67; 'line,': 0.68; 'webpage': 0.68; '8bit%:92': 0.71; '8bit%:100': 0.72; 'broswer': 0.84; 'off,': 0.84; '2013': 0.98 |
| X-Received | by 10.49.108.229 with SMTP id hn5mr1195483qeb.14.1365862588323; Sat, 13 Apr 2013 07:16:28 -0700 (PDT) |
| Newsgroups | comp.lang.python |
| Date | Sat, 13 Apr 2013 07:16:28 -0700 (PDT) |
| In-Reply-To | <mailman.549.1365848898.3114.python-list@python.org> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=94.68.69.168; posting-account=hGu1uQoAAACZy7LiR653nG0NwqDrTyoS |
| References | <8c5d502c-80c2-41b4-a72e-8552f7de8323@googlegroups.com> <mailman.549.1365848898.3114.python-list@python.org> |
| User-Agent | G2/1.0 |
| X-Google-Web-Client | true |
| X-Google-IP | 94.68.69.168 |
| MIME-Version | 1.0 |
| Subject | Re: Unicode issue with Python v3.3 |
| From | nagia.retsina@gmail.com |
| To | comp.lang.python@googlegroups.com |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| Cc | nagia.retsina@gmail.com, Νίκος Γκρ33κ <nikos.gr33k@gmail.com>, 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 | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Message-ID | <mailman.552.1365862596.3114.python-list@python.org> (permalink) |
| Lines | 158 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1365862596 news.xs4all.nl 2681 [2001:888:2000:d::a6]:58415 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:43514 |
Show key headers only | View raw
Τη Σάββατο, 13 Απριλίου 2013 1:28:07 μ.μ. UTC+3, ο χρήστης Cameron Simpson έγραψε:
> On 12Apr2013 21:50, nagia.retsina@gmail.com <nagia.retsina@gmail.com> wrote:
>
> | Ookey after that is corrected, i then tried the plain solution and i got this response back form the shell:
>
> |
>
> | Traceback (most recent call last):
>
> | File "metrites.py", line 213, in <module>
>
> | htmldata = f.read()
>
> | File "/root/.local/lib/python2.7/lib/python3.3/encodings/iso8859_7.py", line 23, in decode
>
> | return codecs.charmap_decode(input,self.errors,decoding_table)[0]
>
> | UnicodeDecodeError: 'charmap' codec can't decode byte 0xae in position 47: character maps to <undefined>
>
> |
>
> | then i switched to:
>
> |
>
> | with open('/home/nikos/www/' + page, encoding='utf-8') as f:
>
> | htmldata = f.read()
>
> |
>
> | and i got no error at all, just pure run *from the shell*!
>
>
>
> Ok, so you need to specify utf-8 to decode the file. Good.
>
>
>
> | But i get internal server error when i try to run the webpage from the browser(Chrome).
>
>
>
> That is standard for a CGI script that does not complete successfully.
>
>
>
> | So, can you tell me please where can i find the apache error log so to display here please?
>
>
>
> That depends on the install. Have a look in /var/log/apache or similar.
>
> Otherwise you need to find the httpd.conf for the apache and look
>
> for its log coniguration settings.
>
>
>
> | Apcher error_log is always better than running 'python3 metrites.py' because even if the python script has no error apache will also display more web related things?
>
>
>
> The error log is where error messages from CGI scripts go. And other error messages.
>
> It is very useful when testing CGI scripts.
>
>
>
> Of course, it's best to work out as much as possible from the command
>
> line first; you have much more direct control and access to errors
>
> there. That only gets you so far though; the environment the CGI
>
> script runs in is not the same as your command line, and some
>
> different behaviour can come from this.
>
>
>
> BTW, are you sure python3 is running your CGI script?
>
> Also, the CGI script may not be running as you, but as the apache user.
>
> In that case, it may fail if it does not has permission to access various
>
> files owned by you.
>
>
>
> Anyway, you need to see the error messages to work this out.
>
>
>
> If you can't find the error log you can divert stderr at the
>
> start of your python program:
>
>
>
> sys.stderr = open('/home/nikos/cgi.err.out', 'a')
>
>
>
> and watch that in a shell:
>
>
>
> tail -f cgi.err.out
>
>
>
> Cheers,
>
> --
>
> Cameron Simpson <cs@zip.com.au>
>
>
>
> If you 'aint falling off, you ar'nt going hard enough. - Fred Gassit
root@macgyver [/home/nikos/public_html/cgi-bin]# ls ../cgi.err.out
../cgi.err.out
root@macgyver [/home/nikos/public_html/cgi-bin]# cat ../cgi.err.out
root@macgyver [/home/nikos/public_html/cgi-bin]#
Also i have foudn the error log and i tried to view it but it was empty and then i removed it and then run the script both from shell and broswer but it didnt reappeared.
root@macgyver [/home/nikos/public_html/cgi-bin]# cat /var/log/httpd/error_log
cat: /var/log/httpd/error_log: No such file or directory
root@macgyver [/home/nikos/public_html/cgi-bin]#
Maybe its somehtign wron with my enviroment?
Should we check the Apache and CGI enviroment somehow and also make sure as you say that *I* run the CGI scripts and not user 'Apache' ?
Tell me what commands i should issues please and i will display the output to you.
Thank you Cameron, for helpimg me. Somehow the script doesnt seem to be the issue in my VPS.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Unicode issue with Python v3.3 Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-09 14:10 -0700
Re: Unicode issue with Python v3.3 Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-09 15:34 -0600
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-09 20:16 -0700
Re: Unicode issue with Python v3.3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-10 04:25 +0000
Re: Unicode issue with Python v3.3 Chris Angelico <rosuav@gmail.com> - 2013-04-10 14:46 +1000
Re: Unicode issue with Python v3.3 rusi <rustompmody@gmail.com> - 2013-04-09 22:06 -0700
Re: Unicode issue with Python v3.3 rusi <rustompmody@gmail.com> - 2013-04-09 23:04 -0700
Re: Unicode issue with Python v3.3 Antoine Pitrou <solipsis@pitrou.net> - 2013-04-10 07:04 +0000
Re: Unicode issue with Python v3.3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-10 08:28 +0000
People in the python community [was Re: Unicode issue with Python v3.3] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-10 08:34 +0000
Re: People in the python community [was Re: Unicode issue with Python v3.3] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-10 10:31 +0100
Re: People in the python community [was Re: Unicode issue with Python v3.3] Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-10 03:50 -0700
Re: People in the python community [was Re: Unicode issue with Python v3.3] Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-10 03:50 -0700
Re: People in the python community [was Re: Unicode issue with Python v3.3] Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-10 03:53 -0700
Re: People in the python community [was Re: Unicode issue with Python v3.3] Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-10 03:53 -0700
Re: People in the python community [was Re: Unicode issue with Python v3.3] Peter Otten <__peter__@web.de> - 2013-04-10 13:11 +0200
Re: People in the python community [was Re: Unicode issue with Python v3.3] Peter Otten <__peter__@web.de> - 2013-04-10 13:13 +0200
Re: People in the python community [was Re: Unicode issue with Python v3.3] Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-10 07:43 -0700
Re: People in the python community [was Re: Unicode issue with Python v3.3] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-10 16:15 +0100
Re: People in the python community [was Re: Unicode issue with Python v3.3] Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-10 09:50 -0700
Re: People in the python community [was Re: Unicode issue with Python v3.3] Michael Torrie <torriem@gmail.com> - 2013-04-11 21:20 -0600
Re: People in the python community [was Re: Unicode issue with Python v3.3] Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-10 09:50 -0700
Re: People in the python community [was Re: Unicode issue with Python v3.3] Chris Angelico <rosuav@gmail.com> - 2013-04-11 01:19 +1000
Re: People in the python community [was Re: Unicode issue with Python v3.3] Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-10 07:43 -0700
Re: Unicode issue with Python v3.3 Arnaud Delobelle <arnodel@gmail.com> - 2013-04-10 23:56 +0100
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-10 00:23 -0700
Re: Unicode issue with Python v3.3 Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-10 01:06 -0700
Re: Unicode issue with Python v3.3 Cameron Simpson <cs@zip.com.au> - 2013-04-11 09:17 +1000
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-10 21:50 -0700
Re: Unicode issue with Python v3.3 Cameron Simpson <cs@zip.com.au> - 2013-04-11 20:45 +1000
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-11 03:54 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-11 03:54 -0700
Re: Unicode issue with Python v3.3 Nikos <nagia.retsina@gmail.com> - 2013-04-11 09:55 -0700
Re: Unicode issue with Python v3.3 Cameron Simpson <cs@zip.com.au> - 2013-04-13 11:41 +1000
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-12 21:50 -0700
Re: Unicode issue with Python v3.3 Cameron Simpson <cs@zip.com.au> - 2013-04-13 20:28 +1000
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-13 07:16 -0700
Re: Unicode issue with Python v3.3 Chris Angelico <rosuav@gmail.com> - 2013-04-14 01:45 +1000
Re: Unicode issue with Python v3.3 Cameron Simpson <cs@zip.com.au> - 2013-04-14 10:01 +1000
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-13 07:16 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-12 21:50 -0700
Re: Unicode issue with Python v3.3 Nikos <nagia.retsina@gmail.com> - 2013-04-11 09:55 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-10 21:50 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-11 00:13 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-11 00:13 -0700
Re: Unicode issue with Python v3.3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-11 07:50 +0000
Re: Unicode issue with Python v3.3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-11 08:20 +0000
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-11 03:07 -0700
Re: Unicode issue with Python v3.3 Lele Gaifax <lele@metapensiero.it> - 2013-04-11 12:45 +0200
Re: Unicode issue with Python v3.3 Nobody <nobody@nowhere.com> - 2013-04-10 19:08 +0100
Re: Unicode issue with Python v3.3 Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-10 11:25 -0700
Re: Unicode issue with Python v3.3 Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-10 13:50 -0600
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-09 20:16 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-11 21:36 -0700
Re: Unicode issue with Python v3.3 alex23 <wuwei23@gmail.com> - 2013-04-11 22:06 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-11 22:42 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-12 05:50 -0700
Re: Unicode issue with Python v3.3 Chris Angelico <rosuav@gmail.com> - 2013-04-12 23:14 +1000
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-12 06:18 -0700
Re: Unicode issue with Python v3.3 Chris Angelico <rosuav@gmail.com> - 2013-04-12 23:21 +1000
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-12 06:18 -0700
Re: Unicode issue with Python v3.3 rusi <rustompmody@gmail.com> - 2013-04-12 06:29 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-12 07:36 -0700
Re: Unicode issue with Python v3.3 Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-12 12:37 -0600
Re: Unicode issue with Python v3.3 Roy Smith <roy@panix.com> - 2013-04-12 14:49 -0400
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-12 13:48 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-12 13:48 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-13 23:00 -0700
Re: Unicode issue with Python v3.3 Cameron Simpson <cs@zip.com.au> - 2013-04-14 19:28 +1000
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-14 04:22 -0700
Re: Unicode issue with Python v3.3 Cameron Simpson <cs@zip.com.au> - 2013-04-18 09:00 +1000
Re: Unicode issue with Python v3.3 Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-17 20:37 -0700
Re: Unicode issue with Python v3.3 Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-17 20:37 -0700
Re: Unicode issue with Python v3.3 Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-19 12:16 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-14 04:22 -0700
Re: Unicode issue with Python v3.3 Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-15 11:42 -0700
Re: Unicode issue with Python v3.3 Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-04-15 11:42 -0700
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-16 23:56 -0700
Re: Unicode issue with Python v3.3 Chris Angelico <rosuav@gmail.com> - 2013-04-17 17:01 +1000
Re: Unicode issue with Python v3.3 Chris Angelico <rosuav@gmail.com> - 2013-04-17 17:32 +1000
Re: Unicode issue with Python v3.3 nagia.retsina@gmail.com - 2013-04-16 23:56 -0700
csiph-web