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


Groups > comp.lang.python > #54985 > unrolled thread

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

Started byΝίκος <nikos.gr33k@gmail.com>
First post2013-09-29 10:49 +0300
Last post2013-10-01 01:06 +1000
Articles 20 on this page of 66 — 15 participants

Back to article view | Back to comp.lang.python


Contents

  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 10:49 +0300
    Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 10:53 +0300
      Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Chris Angelico <rosuav@gmail.com> - 2013-09-29 18:00 +1000
        Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 11:04 +0300
          Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Chris Angelico <rosuav@gmail.com> - 2013-09-29 18:07 +1000
            Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 11:19 +0300
              Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Chris Angelico <rosuav@gmail.com> - 2013-09-29 18:23 +1000
                Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 11:30 +0300
                  Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 11:37 +0300
                    Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-29 09:45 +0000
                      Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 13:24 +0300
                        Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Dave Angel <davea@davea.name> - 2013-09-29 11:11 +0000
                          Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 14:25 +0300
                            Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Dave Angel <davea@davea.name> - 2013-09-29 11:46 +0000
                              Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 14:51 +0300
                                Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-09-29 14:38 +0200
                                Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Chris Angelico <rosuav@gmail.com> - 2013-09-30 00:01 +1000
                            Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Chris Angelico <rosuav@gmail.com> - 2013-09-30 00:19 +1000
                              Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 19:06 +0300
                                Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Joel Goldstick <joel.goldstick@gmail.com> - 2013-09-29 12:14 -0400
                                  Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 19:19 +0300
                                    Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Larry Hudson <orgnut@yahoo.com> - 2013-09-29 20:16 -0700
                                    Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-09-30 15:45 +0100
                                      Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-30 21:03 +0300
                                        Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-09-30 20:18 +0200
                                        Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-09-30 19:42 +0100
                                          Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-30 23:13 +0300
                                            Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-09-30 21:44 +0100
                                              Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-10-01 00:34 +0300
                                                Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Joel Goldstick <joel.goldstick@gmail.com> - 2013-09-30 17:44 -0400
                                                  Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-10-01 01:08 +0300
                                                    Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Joel Goldstick <joel.goldstick@gmail.com> - 2013-09-30 18:13 -0400
                                                    Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-09-30 23:14 +0100
                                                      Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-10-01 01:19 +0300
                                                        Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-09-30 23:28 +0100
                                                          Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-10-01 01:30 +0300
                                                            Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Chris Angelico <rosuav@gmail.com> - 2013-10-01 08:43 +1000
                                                              Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-10-01 01:48 +0300
                                                    Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-30 23:50 +0000
                                                Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-09-30 22:47 +0100
                                        Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Ned Batchelder <ned@nedbatchelder.com> - 2013-09-30 14:54 -0400
                                        Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-09-30 22:51 +0200
                                        Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Chris Angelico <rosuav@gmail.com> - 2013-10-01 08:29 +1000
                                          Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-10-01 01:36 +0300
                                            Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Chris Angelico <rosuav@gmail.com> - 2013-10-01 08:56 +1000
                                              Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-10-01 02:14 +0300
                                                Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-10-01 09:27 +0200
                                                  Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-10-01 11:39 +0300
                                                    Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-10-01 11:10 +0200
                                                  Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-02 01:36 +0000
                                                    Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-10-02 09:23 +0200
                                                      Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-10-02 11:52 +0300
                                                    Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-10-02 11:49 +0300
                                            Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Grant Edwards <invalid@invalid.invalid> - 2013-10-01 14:29 +0000
                                        Mutual respect, tolerance, encouragement (was: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte) Ben Finney <ben+python@benfinney.id.au> - 2013-10-01 08:42 +1000
          Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Ned Batchelder <ned@nedbatchelder.com> - 2013-09-29 06:53 -0400
            Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-29 14:08 +0000
          Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Terry Reedy <tjreedy@udel.edu> - 2013-09-29 13:30 -0400
          Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Ned Batchelder <ned@nedbatchelder.com> - 2013-09-29 15:08 -0400
    Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Chris Angelico <rosuav@gmail.com> - 2013-09-29 17:53 +1000
      Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Νίκος <nikos.gr33k@gmail.com> - 2013-09-29 10:59 +0300
        Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-09-29 12:25 -0400
        Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Grant Edwards <invalid@invalid.invalid> - 2013-09-30 13:51 +0000
          Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-09-30 15:51 +0100
            Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Denis McMahon <denismfmcmahon@gmail.com> - 2013-09-30 22:09 +0000
          Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte Chris Angelico <rosuav@gmail.com> - 2013-10-01 01:06 +1000

Page 1 of 4  [1] 2 3 4  Next page →


#54985 — UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

FromΝίκος <nikos.gr33k@gmail.com>
Date2013-09-29 10:49 +0300
SubjectUnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte
Message-ID<l28m26$aao$1@dont-email.me>
Hello although my code is correct just today i saw this in the error_log

[Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126] Traceback 
(most recent call last):
[Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126]   File 
"/home/nikos/public_html/cgi-bin/metrites.py", line 30, in <module>
[Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126]     host = 
socket.gethostbyaddr( ipval ) [0]
[Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126] 
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: 
invalid start byte
[Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126] Premature end 
of script headers: metrites.py


Which should never had happened since i use the following code:


ipval = ( os.environ.get('HTTP_CF_CONNECTING_IP') or 
os.environ.get('REMOTE_ADDR', "Cannot Resolve") )
city = "Άγνωστη Πόλη"
host = "Άγνωστη Προέλευση"
try:
	gi = pygeoip.GeoIP('/usr/local/share/GeoIPCity.dat')
	city = gi.time_zone_by_addr( ipval )
	host = socket.gethostbyaddr( ipval ) [0]
except socket.gaierror as e:
	print( "metrites.py => (%s): " % lastvisit, repr( sys.exc_info() ), 
file=open('/tmp/err.out', 'w') )

So vene if somethign might have gone wrong with the 'host' assignment, 
'host' should have defaulted to "Άγνωστη Προέλευση"

why the utf-8 error?

[toc] | [next] | [standalone]


#54986

FromΝίκος <nikos.gr33k@gmail.com>
Date2013-09-29 10:53 +0300
Message-ID<l28m9v$aao$2@dont-email.me>
In reply to#54985
Στις 29/9/2013 10:49 πμ, ο/η Νίκος έγραψε:
> Hello although my code is correct just today i saw this in the error_log
>
> [Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126] Traceback
> (most recent call last):
> [Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126]   File
> "/home/nikos/public_html/cgi-bin/metrites.py", line 30, in <module>
> [Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126]     host =
> socket.gethostbyaddr( ipval ) [0]
> [Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126]
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0:
> invalid start byte
> [Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126] Premature end
> of script headers: metrites.py
>
>
> Which should never had happened since i use the following code:
>
>
> ipval = ( os.environ.get('HTTP_CF_CONNECTING_IP') or
> os.environ.get('REMOTE_ADDR', "Cannot Resolve") )
> city = "Άγνωστη Πόλη"
> host = "Άγνωστη Προέλευση"
> try:
>      gi = pygeoip.GeoIP('/usr/local/share/GeoIPCity.dat')
>      city = gi.time_zone_by_addr( ipval )
>      host = socket.gethostbyaddr( ipval ) [0]
> except socket.gaierror as e:
>      print( "metrites.py => (%s): " % lastvisit, repr( sys.exc_info() ),
> file=open('/tmp/err.out', 'w') )
>
> So vene if somethign might have gone wrong with the 'host' assignment,
> 'host' should have defaulted to "Άγνωστη Προέλευση"
>
> why the utf-8 error?

Since this is not a socket.gaierror it wants:

except Exception as e: ?

i just tried it and now it works.

but then agian why the

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 
0: invalid start byte

when it comes to dtermine the 'host' ?

[toc] | [prev] | [next] | [standalone]


#54989

FromChris Angelico <rosuav@gmail.com>
Date2013-09-29 18:00 +1000
Message-ID<mailman.439.1380441619.18130.python-list@python.org>
In reply to#54986
On Sun, Sep 29, 2013 at 5:53 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
> Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0:
> invalid start byte

Something's trying to decode a stream of bytes as UTF-8, and it's not
UTF-8. Work out what in your code is bytes and what is strings, and do
your own conversions.

http://www.joelonsoftware.com/articles/Unicode.html

READ IT. Do not write another line of code until you actually
understand what he's saying there.

ChrisA

[toc] | [prev] | [next] | [standalone]


#54990

FromΝίκος <nikos.gr33k@gmail.com>
Date2013-09-29 11:04 +0300
Message-ID<l28mtv$c50$2@dont-email.me>
In reply to#54989
Στις 29/9/2013 11:00 πμ, ο/η Chris Angelico έγραψε:
> On Sun, Sep 29, 2013 at 5:53 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
>> Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0:
>> invalid start byte
>
> Something's trying to decode a stream of bytes as UTF-8, and it's not
> UTF-8. Work out what in your code is bytes and what is strings, and do
> your own conversions.
>
> http://www.joelonsoftware.com/articles/Unicode.html
>
> READ IT. Do not write another line of code until you actually
> understand what he's saying there.
>
> ChrisA
>
okey i will, but isnt this just weird:

How come all these daysthe followinf line work as expected:

host = socket.gethostbyaddr( ipval ) [0]

and only just today just happened to output:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0:
invalid start byte erros?

Nothign got added in my script. This is the only line that tried to 
determine the host.

[toc] | [prev] | [next] | [standalone]


#54991

FromChris Angelico <rosuav@gmail.com>
Date2013-09-29 18:07 +1000
Message-ID<mailman.440.1380442039.18130.python-list@python.org>
In reply to#54990
On Sun, Sep 29, 2013 at 6:04 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
> How come all these daysthe followinf line work as expected:
>
>
> host = socket.gethostbyaddr( ipval ) [0]
>
> and only just today just happened to output:

Maybe the ipval is different. Maybe something else is causing the
error. I wonder how, in Python, you would find out which one it is?
Wouldn't it be nice if Python had a function - statement in Python 2 -
that told you what something was.

ChrisA

[toc] | [prev] | [next] | [standalone]


#54992

FromΝίκος <nikos.gr33k@gmail.com>
Date2013-09-29 11:19 +0300
Message-ID<l28npr$hai$1@dont-email.me>
In reply to#54991
Στις 29/9/2013 11:07 πμ, ο/η Chris Angelico έγραψε:
> On Sun, Sep 29, 2013 at 6:04 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
>> How come all these daysthe followinf line work as expected:
>>
>>
>> host = socket.gethostbyaddr( ipval ) [0]
>>
>> and only just today just happened to output:
>
> Maybe the ipval is different. Maybe something else is causing the
> error. I wonder how, in Python, you would find out which one it is?
> Wouldn't it be nice if Python had a function - statement in Python 2 -
> that told you what something was.

The snippet is this:

ipval = ( os.environ.get('HTTP_CF_CONNECTING_IP') or 
os.environ.get('REMOTE_ADDR', "Cannot Resolve") )
city = "Άγνωστη Πόλη"
host = "Άγνωστη Προέλευση"
try:
	gi = pygeoip.GeoIP('/usr/local/share/GeoIPCity.dat')
	city = gi.time_zone_by_addr( ipval )
	host = socket.gethostbyaddr( ipval ) [0]
except Exception as e:
	print( "metrites.py => (%s): " % lastvisit, repr( sys.exc_info() ), 
file=open('/tmp/err.out', 'w') )


ipval is suposed to get just an ip address.
ip addresses doesnt change its just number seperated by dots.
the same provider i uses yesterday i continue to use today, i just 
restrated the router and got a new ip address and after the new address 
got assignes to me.

unicode decore error related to host started to happen.
Can someone explain this or have a way to troubleshoot it because this 
error is bugging me for several months now but not all the time just in 
cases liek miens today.

[toc] | [prev] | [next] | [standalone]


#54993

FromChris Angelico <rosuav@gmail.com>
Date2013-09-29 18:23 +1000
Message-ID<mailman.441.1380443023.18130.python-list@python.org>
In reply to#54992
On Sun, Sep 29, 2013 at 6:19 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
> ipval is suposed to get just an ip address.
> ip addresses doesnt change its just number seperated by dots.

That's one way an IP address can be rendered. It's not the only one.
There's an entire category of IP addresses that's usually written with
colons rather than dots. However, I reiterate: How do you KNOW what's
in ipval? I wonder if there's an easy way for you to find out...

ChrisA

[toc] | [prev] | [next] | [standalone]


#54994

FromΝίκος <nikos.gr33k@gmail.com>
Date2013-09-29 11:30 +0300
Message-ID<l28of9$jla$1@dont-email.me>
In reply to#54993
Στις 29/9/2013 11:23 πμ, ο/η Chris Angelico έγραψε:
> On Sun, Sep 29, 2013 at 6:19 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
>> ipval is suposed to get just an ip address.
>> ip addresses doesnt change its just number seperated by dots.
>
> That's one way an IP address can be rendered. It's not the only one.
> There's an entire category of IP addresses that's usually written with
> colons rather than dots. However, I reiterate: How do you KNOW what's
> in ipval? I wonder if there's an easy way for you to find out...
>
> ChrisA
>
yes it is, i take it you mean to just print the damn varibale to see 
what on eath is actually outputs back....

[toc] | [prev] | [next] | [standalone]


#54995

FromΝίκος <nikos.gr33k@gmail.com>
Date2013-09-29 11:37 +0300
Message-ID<l28oro$jla$2@dont-email.me>
In reply to#54994
Στις 29/9/2013 11:30 πμ, ο/η Νίκος έγραψε:
> Στις 29/9/2013 11:23 πμ, ο/η Chris Angelico έγραψε:
>> On Sun, Sep 29, 2013 at 6:19 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
>>> ipval is suposed to get just an ip address.
>>> ip addresses doesnt change its just number seperated by dots.
>>
>> That's one way an IP address can be rendered. It's not the only one.
>> There's an entire category of IP addresses that's usually written with
>> colons rather than dots. However, I reiterate: How do you KNOW what's
>> in ipval? I wonder if there's an easy way for you to find out...
>>
>> ChrisA
>>
> yes it is, i take it you mean to just print the damn varibale to see
> what on eath is actually outputs back....


Here, as exactly as i though of it:

print( ipval )  returned  46.198.177.249

just a noirmal IPv4 ip address.

which leaved the questions of:

[Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126] Traceback 
(most recent call last):
[Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126]   File 
"/home/nikos/public_html/cgi-bin/metrites.py", line 30, in <module>
[Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126]     host = 
socket.gethostbyaddr( ipval ) [0]
[Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126] 
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: 
invalid start byte
[Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126] Premature end 
of script headers: metrites.py


What on earth it cant decode?

[toc] | [prev] | [next] | [standalone]


#54997

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-09-29 09:45 +0000
Message-ID<5247f6bb$0$29988$c3e8da3$5496439d@news.astraweb.com>
In reply to#54995
On Sun, 29 Sep 2013 11:37:14 +0300, Νίκος wrote:

> Στις 29/9/2013 11:30 πμ, ο/η Νίκος έγραψε:
>> Στις 29/9/2013 11:23 πμ, ο/η Chris Angelico έγραψε:
>>> On Sun, Sep 29, 2013 at 6:19 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
>>>> ipval is suposed to get just an ip address. ip addresses doesnt
>>>> change its just number seperated by dots.
>>>
>>> That's one way an IP address can be rendered. It's not the only one.
>>> There's an entire category of IP addresses that's usually written with
>>> colons rather than dots. However, I reiterate: How do you KNOW what's
>>> in ipval? I wonder if there's an easy way for you to find out...
>>>
>>> ChrisA
>>>
>> yes it is, i take it you mean to just print the damn varibale to see
>> what on eath is actually outputs back....
> 
> 
> Here, as exactly as i though of it:
> 
> print( ipval )  returned  46.198.177.249 
............................^^^^^^^^^^^^^^

But the error comes from:

> [Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126] 
.............................................^^^^^^^^^^^^^^


Given that the error occurred hours ago, I don't think you'll be able to 
diagnose why it happened unless it happens again.


Another thought comes to mind... unless you have changed your habits, I 
recall that you edit the source code live. If that is the case, it is 
possible that the error actually occurred in a completely unrelated line, 
if you happened to be editing the file at the moment the error occurred.



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#55001

FromΝίκος <nikos.gr33k@gmail.com>
Date2013-09-29 13:24 +0300
Message-ID<l28v5k$fu7$1@dont-email.me>
In reply to#54997
Στις 29/9/2013 12:45 μμ, ο/η Steven D'Aprano έγραψε:
> On Sun, 29 Sep 2013 11:37:14 +0300, Νίκος wrote:
>
>> Στις 29/9/2013 11:30 πμ, ο/η Νίκος έγραψε:
>>> Στις 29/9/2013 11:23 πμ, ο/η Chris Angelico έγραψε:
>>>> On Sun, Sep 29, 2013 at 6:19 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
>>>>> ipval is suposed to get just an ip address. ip addresses doesnt
>>>>> change its just number seperated by dots.
>>>>
>>>> That's one way an IP address can be rendered. It's not the only one.
>>>> There's an entire category of IP addresses that's usually written with
>>>> colons rather than dots. However, I reiterate: How do you KNOW what's
>>>> in ipval? I wonder if there's an easy way for you to find out...
>>>>
>>>> ChrisA
>>>>
>>> yes it is, i take it you mean to just print the damn varibale to see
>>> what on eath is actually outputs back....
>>
>>
>> Here, as exactly as i though of it:
>>
>> print( ipval )  returned  46.198.177.249
> ............................^^^^^^^^^^^^^^
>
> But the error comes from:
>
>> [Sun Sep 29 07:44:43 2013] [error] [client 173.245.49.126]
> .............................................^^^^^^^^^^^^^^
>
>
> Given that the error occurred hours ago, I don't think you'll be able to
> diagnose why it happened unless it happens again.
>
>
> Another thought comes to mind... unless you have changed your habits, I
> recall that you edit the source code live. If that is the case, it is
> possible that the error actually occurred in a completely unrelated line,
> if you happened to be editing the file at the moment the error occurred.

You remembr correctly, i'am still editing the source code live to 
reflect instant changes.

But....at that moment and all mornign long i wasnt altering the code at 
all when this error occured and i just tried it at the moment as iam 
typing it this by alterting the

except Exception as e: ===> except socket.gaierror as e:
which cannot handle unicore realted errors and the exact same error 
appeared with my ip address involved at the error log.

so, the question that arises again and reamins is how come 'host' vars 
gets a values most of the times and sometimes it just outputs back 
unicode related erros.

I must tell you that i had this problem also months ago, but since i 
couldnt able to solve it i left it as it was, but it just started to 
make things more and more hectic.

[toc] | [prev] | [next] | [standalone]


#55007

FromDave Angel <davea@davea.name>
Date2013-09-29 11:11 +0000
Message-ID<mailman.446.1380453107.18130.python-list@python.org>
In reply to#55001
On 29/9/2013 06:24, Νίκος wrote:

    <snip>

>
> except Exception as e: ===> except socket.gaierror as e:
> which cannot handle unicore realted errors and the exact same error 
> appeared with my ip address involved at the error log.
>
> so, the question that arises again and reamins is how come 'host' vars 
> gets a values most of the times and sometimes it just outputs back 
> unicode related erros.
>
> I must tell you that i had this problem also months ago, but since i 
> couldnt able to solve it i left it as it was, but it just started to 
> make things more and more hectic.
>

it would be interesting to see a more complete stack trace.  But I'd
guess that in the process of looking up the ip address at the dns
servers, somebody is producing a non-ascii byte string that isn't
encoded in utf-8.  It might conceivably be in your /etc/hosts file as
well, assuming gethostbyname() looks there when the internet query
fails.



-- 
DaveA

[toc] | [prev] | [next] | [standalone]


#55009

FromΝίκος <nikos.gr33k@gmail.com>
Date2013-09-29 14:25 +0300
Message-ID<l292n0$1cg$1@dont-email.me>
In reply to#55007
Στις 29/9/2013 2:11 μμ, ο/η Dave Angel έγραψε:
> On 29/9/2013 06:24, Νίκος wrote:
>
>      <snip>
>
>>
>> except Exception as e: ===> except socket.gaierror as e:
>> which cannot handle unicore realted errors and the exact same error
>> appeared with my ip address involved at the error log.
>>
>> so, the question that arises again and reamins is how come 'host' vars
>> gets a values most of the times and sometimes it just outputs back
>> unicode related erros.
>>
>> I must tell you that i had this problem also months ago, but since i
>> couldnt able to solve it i left it as it was, but it just started to
>> make things more and more hectic.
>>
>
> it would be interesting to see a more complete stack trace.  But I'd
> guess that in the process of looking up the ip address at the dns
> servers, somebody is producing a non-ascii byte string that isn't
> encoded in utf-8.  It might conceivably be in your /etc/hosts file as
> well, assuming gethostbyname() looks there when the internet query
> fails.

Thank you for being willing to look this further.

root@secure [~]# cat /etc/hosts
127.0.0.1               localhost.localdomain localhost
84.200.17.58            secure.superhost.gr secure
root@secure [~]#

Just tell me what else file contents or error_log output you want me to 
show you from my server and i will.

Here is my domain's DNS Zone Entry in case it will helpo with something:

let me show you how superhost.gr entry appears via WHM in the Zoen section.

Code:
; cPanel first:11.38.2.7 (update_time):1380448502 
Cpanel::ZoneFile::VERSION:1.3 hostname:secure.superhost.gr latest:11.38.2.7
; Zone file for superhost.gr
$TTL 14400
superhost.gr.	86400	IN	SOA	ns1.superhost.gr.	nikos.gr33k.gmail.com.	(
						2013092903 ;Serial Number
						86400 ;refresh
						7200 ;retry
						3600000 ;expire
						86400	)

superhost.gr.	86400	IN	NS	ns1.superhost.gr.
superhost.gr.	86400	IN	NS	ns2.superhost.gr.


superhost.gr.	14400	IN	A	84.200.17.58

localhost	14400	IN	A	127.0.0.1

superhost.gr.	14400	IN	MX	0	superhost.gr.

mail	14400	IN	CNAME	superhost.gr.
www	14400	IN	CNAME	superhost.gr.
ftp	14400	IN	CNAME	superhost.gr.



As for the mail iam afrid it outputs this:
Code:
Warning	MX CNAME Check	WARNING: CNAME was returned for the following MX 
records:
mail.superhost.gr
The CNAME(s) that were returned are listed above. This is not ok per the 
RFCs and can cause problems including mail being lost!
Error	MX A request returns CNAME	WARNING: MX records points to a CNAME. 
CNAMEs are not allowed in MX records, according to RFC974, RFC1034 
3.6.2, RFC1912 2.4, and RFC2181 10.3. The problem MX record(s) are:
mail.superhost.gr points to ['superhost.gr']
This can cause problems
Do i need to chnage the mx record in cloudflare so mx records point to 
somethign else being ???????

Also my webpage works as

www.superhost.gr   but not as     superhost.gr

I have removed my webiste from cloulflare to make thigns simpler and now 
in order to viw mywebiste i must give
http://www.superhost.gr

if i give plain http://superhost.gr it doesnt load at all.

The only way is http://www.superhost.gr but no link on my webpage works 
when clicked upon.

iam getting this: http://superhost.gr/cgi-sys/defaultwebpage.cgi

Clearly these are DNS and Mail issues.

i have asked PaulVPS which is my provider and they dont f***** care to 
help resolve those issues, and i have paid them upo until May 2014.

I just dotn want to lsoe other customers :(

[toc] | [prev] | [next] | [standalone]


#55012

FromDave Angel <davea@davea.name>
Date2013-09-29 11:46 +0000
Message-ID<mailman.448.1380455194.18130.python-list@python.org>
In reply to#55009
On 29/9/2013 07:25, Νίκος wrote:


>
> Thank you for being willing to look this further.

Willing, but probably not able.  I think I know a lot about the
language, and less about the libraries.  I know very little about the
administration side of internet use. The reference to /etc/hosts is
only a guess, as I said.




-- 
DaveA

[toc] | [prev] | [next] | [standalone]


#55013

FromΝίκος <nikos.gr33k@gmail.com>
Date2013-09-29 14:51 +0300
Message-ID<l2948i$8lj$1@dont-email.me>
In reply to#55012
Στις 29/9/2013 2:46 μμ, ο/η Dave Angel έγραψε:
> On 29/9/2013 07:25, Νίκος wrote:
>
>
>>
>> Thank you for being willing to look this further.
>
> Willing, but probably not able.  I think I know a lot about the
> language, and less about the libraries.  I know very little about the
> administration side of internet use. The reference to /etc/hosts is
> only a guess, as I said.
>
>
>
>
Can you please point me to a direction that someone will be able to help 
me with this since the provider doesn't care to do so?

[toc] | [prev] | [next] | [standalone]


#55016

FromChris “Kwpolska” Warrick <kwpolska@gmail.com>
Date2013-09-29 14:38 +0200
Message-ID<mailman.449.1380458338.18130.python-list@python.org>
In reply to#55013
On Sun, Sep 29, 2013 at 1:51 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
> Στις 29/9/2013 2:46 μμ, ο/η Dave Angel έγραψε:
>>
>> On 29/9/2013 07:25, Νίκος wrote:
>>
>>
>>>
>>> Thank you for being willing to look this further.
>>
>>
>> Willing, but probably not able.  I think I know a lot about the
>> language, and less about the libraries.  I know very little about the
>> administration side of internet use. The reference to /etc/hosts is
>> only a guess, as I said.
>>
>>
>>
>>
> Can you please point me to a direction that someone will be able to help me
> with this since the provider doesn't care to do so?

I can point you to “find a sysadmin that will work for you and fix
your problems for money”.  Where can you find one?  That’s not a
question for me.  I suggest looking around Greek websites, as someone
speaking the same language as you could help you better.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense

[toc] | [prev] | [next] | [standalone]


#55018

FromChris Angelico <rosuav@gmail.com>
Date2013-09-30 00:01 +1000
Message-ID<mailman.451.1380463320.18130.python-list@python.org>
In reply to#55013
On Sun, Sep 29, 2013 at 10:38 PM, Chris “Kwpolska” Warrick
<kwpolska@gmail.com> wrote:
> I can point you to “find a sysadmin that will work for you and fix
> your problems for money”.  Where can you find one?  That’s not a
> question for me.  I suggest looking around Greek websites, as someone
> speaking the same language as you could help you better.

To be more specific: Greek job-posting web sites. Or maybe general
job-posting web sites will let you search specifically for people who
speak Greek. Either way, you're looking for someone to hire, here.
Maybe you want a contract position, or maybe salaried, but either way,
that's what you're needing.

ChrisA

[toc] | [prev] | [next] | [standalone]


#55020

FromChris Angelico <rosuav@gmail.com>
Date2013-09-30 00:19 +1000
Message-ID<mailman.452.1380464398.18130.python-list@python.org>
In reply to#55009
On Sun, Sep 29, 2013 at 9:25 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
> superhost.gr.   14400   IN      MX      0       superhost.gr.
>
> mail    14400   IN      CNAME   superhost.gr.
>
> As for the mail iam afrid it outputs this:
> Code:
> Warning MX CNAME Check  WARNING: CNAME was returned for the following MX
> records:
> mail.superhost.gr
> The CNAME(s) that were returned are listed above. This is not ok per the
> RFCs and can cause problems including mail being lost!
> Error   MX A request returns CNAME      WARNING: MX records points to a
> CNAME. CNAMEs are not allowed in MX records, according to RFC974, RFC1034
> 3.6.2, RFC1912 2.4, and RFC2181 10.3. The problem MX record(s) are:
> mail.superhost.gr points to ['superhost.gr']

Once again, you are posting code and errors that don't go with each
other. Your MX record does not point to mail.superhost.gr but to
superhost.gr itself. This makes it extremely difficult to help you.
EXTREMELY.

Two options: Either edit your bind file manually OR use some other
tool for viewing and editing it. If the latter, the bindfile is
utterly meaningless - look at the other tool. If the former, I would
rewrite your zone file like this:

-- cut --
$TTL 14400
@   86400   IN      SOA     ns1.superhost.gr.       nikosgr33k.gmail.com.  (
                                                2013092903 ;Serial Number
                                                86400 ;refresh
                                                7200 ;retry
                                                3600000 ;expire
                                                86400   )

@   86400   IN      NS      ns1
@   86400   IN      NS      ns2

@   IN      A       84.200.17.58

@   IN      MX      0 @

mail    IN      CNAME   @
www     IN      CNAME   @
ftp     IN      CNAME   @
-- cut --

The changes I've made are:
1) Remove the massive duplication of your domain name, mainly by using
the shorthand "@". (There are other shorthands you can use, too.)
2) Remove the dot from your email address. Currently your official
address is nikos@gr33k.gmail.com which is flat-out wrong. Fortunately
for you, Gmail will accept nikosgr33k@gmail.com no problem.
3) Eliding the TTLs where they're the same as your default
4) Removing the entry for localhost.superhost.gr which you shouldn't
really be using - it'll only confuse matters. Use localhost as a TLD -
that's how it's set up.

Aside from #2 and #4, this shouldn't actually change your DNS records,
but it'll make your bindfile that much easier to read and work with.

Of course, if you're editing the file with some other program, don't
do this at all. Just use that other program.

ChrisA

[toc] | [prev] | [next] | [standalone]


#55022

FromΝίκος <nikos.gr33k@gmail.com>
Date2013-09-29 19:06 +0300
Message-ID<l29j65$p7h$1@dont-email.me>
In reply to#55020
Στις 29/9/2013 5:19 μμ, ο/η Chris Angelico έγραψε:
> On Sun, Sep 29, 2013 at 9:25 PM, Νίκος <nikos.gr33k@gmail.com> wrote:
>> superhost.gr.   14400   IN      MX      0       superhost.gr.
>>
>> mail    14400   IN      CNAME   superhost.gr.
>>
>> As for the mail iam afrid it outputs this:
>> Code:
>> Warning MX CNAME Check  WARNING: CNAME was returned for the following MX
>> records:
>> mail.superhost.gr
>> The CNAME(s) that were returned are listed above. This is not ok per the
>> RFCs and can cause problems including mail being lost!
>> Error   MX A request returns CNAME      WARNING: MX records points to a
>> CNAME. CNAMEs are not allowed in MX records, according to RFC974, RFC1034
>> 3.6.2, RFC1912 2.4, and RFC2181 10.3. The problem MX record(s) are:
>> mail.superhost.gr points to ['superhost.gr']
>
> Once again, you are posting code and errors that don't go with each
> other. Your MX record does not point to mail.superhost.gr but to
> superhost.gr itself. This makes it extremely difficult to help you.
> EXTREMELY.
>
> Two options: Either edit your bind file manually OR use some other
> tool for viewing and editing it. If the latter, the bindfile is
> utterly meaningless - look at the other tool. If the former, I would
> rewrite your zone file like this:
>
> -- cut --
> $TTL 14400
> @   86400   IN      SOA     ns1.superhost.gr.       nikosgr33k.gmail.com.  (
>                                                  2013092903 ;Serial Number
>                                                  86400 ;refresh
>                                                  7200 ;retry
>                                                  3600000 ;expire
>                                                  86400   )
>
> @   86400   IN      NS      ns1
> @   86400   IN      NS      ns2
>
> @   IN      A       84.200.17.58
>
> @   IN      MX      0 @
>
> mail    IN      CNAME   @
> www     IN      CNAME   @
> ftp     IN      CNAME   @
> -- cut --
>
> The changes I've made are:
> 1) Remove the massive duplication of your domain name, mainly by using
> the shorthand "@". (There are other shorthands you can use, too.)
> 2) Remove the dot from your email address. Currently your official
> address is nikos@gr33k.gmail.com which is flat-out wrong. Fortunately
> for you, Gmail will accept nikosgr33k@gmail.com no problem.
> 3) Eliding the TTLs where they're the same as your default
> 4) Removing the entry for localhost.superhost.gr which you shouldn't
> really be using - it'll only confuse matters. Use localhost as a TLD -
> that's how it's set up.
>
> Aside from #2 and #4, this shouldn't actually change your DNS records,
> but it'll make your bindfile that much easier to read and work with.
>
> Of course, if you're editing the file with some other program, don't
> do this at all. Just use that other program.
>
> ChrisA
>
I have tried your setup and still my webpage http://superhost.gr is not 
loading at all

i dont ebven have access to cPanel and WHM any more by hostname.

The via WHM i have reset the DNS Zone for superhost.gr and let it 
recreate it as WHM wants it by default.

Still same error. No website appearing anymore no access to cPanel & WHM 
and no ability to send or receive mail.

[toc] | [prev] | [next] | [standalone]


#55024

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2013-09-29 12:14 -0400
Message-ID<mailman.454.1380471288.18130.python-list@python.org>
In reply to#55022

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

asked and answered.  Move on

[toc] | [prev] | [next] | [standalone]


Page 1 of 4  [1] 2 3 4  Next page →

Back to top | Article view | comp.lang.python


csiph-web