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

2013-10-02 Thread Antoon Pardon
Op 02-10-13 03:36, Steven D'Aprano schreef:
 On Tue, 01 Oct 2013 09:27:22 +0200, Antoon Pardon wrote:
 
 People pay for some kind of guaranteed uptime.
 
 You have *no idea* what sort of contract Nikos has with his customers. 
 Nor do you know have any idea what fees he charges. For all we know, he 
 is promising, and charging for, 99% uptime while delivering 99.9% uptime.

Which is beside the point. It is very well possible to rip someone of
and in the mean time have a contract that makes ripping that person of,
legal.

It is also possible one behaves in a way similar as if ripping
others off, but that your victims are lucky and don't experience
a bad outcome (yet).

 I know you are getting off on hating Nikos, but take it elsewhere.

I know you are getting off insinuating hate of those who dare to
critisize Nikos harshly, but take it elsewhere.

-- 
Antoon Pardon

-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-10-02 Thread Νίκος

Στις 2/10/2013 4:36 πμ, ο/η Steven D'Aprano έγραψε:

On Tue, 01 Oct 2013 09:27:22 +0200, Antoon Pardon wrote:


People pay for some kind of guaranteed uptime.


You have *no idea* what sort of contract Nikos has with his customers.
Nor do you know have any idea what fees he charges. For all we know, he
is promising, and charging for, 99% uptime while delivering 99.9% uptime.

I know you are getting off on hating Nikos, but take it elsewhere.


It is good to know that some people understand me better then others.

Thank you steven.

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-10-02 Thread Νίκος

Στις 2/10/2013 10:23 πμ, ο/η Antoon Pardon έγραψε:

Op 02-10-13 03:36, Steven D'Aprano schreef:

On Tue, 01 Oct 2013 09:27:22 +0200, Antoon Pardon wrote:


People pay for some kind of guaranteed uptime.


You have *no idea* what sort of contract Nikos has with his customers.
Nor do you know have any idea what fees he charges. For all we know, he
is promising, and charging for, 99% uptime while delivering 99.9% uptime.


Which is beside the point. It is very well possible to rip someone of
and in the mean time have a contract that makes ripping that person of,
legal.

It is also possible one behaves in a way similar as if ripping
others off, but that your victims are lucky and don't experience
a bad outcome (yet).


I know you are getting off on hating Nikos, but take it elsewhere.


I know you are getting off insinuating hate of those who dare to
critisize Nikos harshly, but take it elsewhere.


I'am not ripping anyone off.
I designed all their websites and i host all their websiutes.
All their websites do work properly as expected.

I only trial and error with my perosnal domain, personal account only.
The only thing i did change system wide was installing Python 3.3.2 for 
perosnal reasons and rewrite the code for that.


But, wy iam a sitting here and explainign myself to you.
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-10-01 Thread Antoon Pardon
Op 01-10-13 01:14, Νίκος schreef:
 Στις 1/10/2013 1:56 πμ, ο/η Chris Angelico έγραψε:
 But what you're doing
 is charging your customers while you learn the very basics.
 
 I designed their websites and they are up and running.
 Yes i have charged some money, but they gain what they paid for, a
 running website, all of them.
 
 So, its not like i'm ripping off someone here.

Yes you are. People don't just pay for a running website, with running
meaning some vague: is mostly accesible. People pay for some kind of
guaranteed uptime. Since you don't have the skills to deliver that
guarantee, you are in fact ripping them off.

-- 
Antoon Pardon
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-10-01 Thread Νίκος

Στις 1/10/2013 10:27 πμ, ο/η Antoon Pardon έγραψε:

Op 01-10-13 01:14, Νίκος schreef:

Στις 1/10/2013 1:56 πμ, ο/η Chris Angelico έγραψε:

But what you're doing
is charging your customers while you learn the very basics.


I designed their websites and they are up and running.
Yes i have charged some money, but they gain what they paid for, a
running website, all of them.

So, its not like i'm ripping off someone here.


Yes you are. People don't just pay for a running website, with running
meaning some vague: is mostly accesible. People pay for some kind of
guaranteed uptime. Since you don't have the skills to deliver that
guarantee, you are in fact ripping them off.


But it has uptime, VPS is always online, i dont make system wide changes 
except for the fat that i installed Python 3.3.2 for my personal account 
needs.


If i encounter some problem i ask, bu the sad thing is that my provider 
doesn't care to help.


--
https://mail.python.org/mailman/listinfo/python-list


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

2013-10-01 Thread Antoon Pardon
Op 01-10-13 10:39, Νίκος schreef:
 Στις 1/10/2013 10:27 πμ, ο/η Antoon Pardon έγραψε:
 Op 01-10-13 01:14, Νίκος schreef:
 Στις 1/10/2013 1:56 πμ, ο/η Chris Angelico έγραψε:
 But what you're doing
 is charging your customers while you learn the very basics.

 I designed their websites and they are up and running.
 Yes i have charged some money, but they gain what they paid for, a
 running website, all of them.

 So, its not like i'm ripping off someone here.

 Yes you are. People don't just pay for a running website, with running
 meaning some vague: is mostly accesible. People pay for some kind of
 guaranteed uptime. Since you don't have the skills to deliver that
 guarantee, you are in fact ripping them off.
 
 But it has uptime, VPS is always online, i dont make system wide changes
 except for the fat that i installed Python 3.3.2 for my personal account
 needs.

That is has uptime is not enough. The question is: Should something go
wrong, are you skilled enough to fix it within a reasonable time?
In other words, when the side does go down, how long will it take you
to have it up again?

Going by the skill level you have shown here, you are unable to cope
with such situations in a way that can be expected.

 If i encounter some problem i ask, bu the sad thing is that my provider
 doesn't care to help.

Then either you have the wrong provider or you are so lacking in skill
that your provider is fed up with spoon feeding you the basic solutions.

Going with your history here, I'll go with the latter. Especially as
I think it entirely possible that your provider has already helped you
and provided you the necessary answers but you rejected them because
you didn't like the particular style of the answer.

-- 
Antoon Pardon
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-10-01 Thread Grant Edwards
On 2013-09-30, ?? nikos.gr...@gmail.com wrote:

 I learn during the process.

That's fine as long as your customers are told up front that what
they're paying for is _not_ a working usable service, but rahter a
training program for you personally (a training program that's failing
rather badly, IMO).

 That's how i deal with the situation. I challedge my self and then
 try to confront the given situation _live_.

That's a lousy attitude to have if your customers expect something
that works rather than some in-progress hacked-up POS you're using for
practice.

-- 
Grant Edwards   grant.b.edwardsYow! I want to mail a
  at   bronzed artichoke to
  gmail.comNicaragua!
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-10-01 Thread Steven D'Aprano
On Tue, 01 Oct 2013 09:27:22 +0200, Antoon Pardon wrote:

 People pay for some kind of guaranteed uptime.

You have *no idea* what sort of contract Nikos has with his customers. 
Nor do you know have any idea what fees he charges. For all we know, he 
is promising, and charging for, 99% uptime while delivering 99.9% uptime.

I know you are getting off on hating Nikos, but take it elsewhere.



-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Grant Edwards
On 2013-09-29, ?? nikos.gr...@gmail.com wrote:
  29/9/2013 10:53 , ??/?? Chris Angelico :

 You fail to understand that these code i now use was written with the 
 help of regulars here and yes its correct.

If you're code is correct, then use it and be happy.

There's no need to bother us if your code is correct.

-- 
Grant Edwards   grant.b.edwardsYow! Can I have an IMPULSE
  at   ITEM instead?
  gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Mark Lawrence

On 29/09/2013 17:19, Νίκος wrote:

Στις 29/9/2013 7:14 μμ, ο/η Joel Goldstick έγραψε:

asked and answered.  Move on


shut up. you are nothign but annoyance here.


Absolutely hilarious.  Please give up your web work and Python and get a 
job writing scripts for comedians, you'd make a large fortune.


--
Cheers.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Mark Lawrence

On 30/09/2013 14:51, Grant Edwards wrote:

On 2013-09-29, ?? nikos.gr...@gmail.com wrote:

 29/9/2013 10:53 , ??/?? Chris Angelico :

You fail to understand that these code i now use was written with the
help of regulars here and yes its correct.


If you're code is correct, then use it and be happy.

There's no need to bother us if your code is correct.



Could this be an extremely rare case whereby the original code is 100% 
correct but the problems have been exacerbated by the many suggested 
patches given here being 100% incorrect?


--
Cheers.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Chris Angelico
On Tue, Oct 1, 2013 at 12:51 AM, Mark Lawrence breamore...@yahoo.co.uk wrote:
 On 30/09/2013 14:51, Grant Edwards wrote:

 On 2013-09-29, ?? nikos.gr...@gmail.com wrote:

  29/9/2013 10:53 , ??/?? Chris Angelico :

 You fail to understand that these code i now use was written with the
 help of regulars here and yes its correct.


 If you're code is correct, then use it and be happy.

 There's no need to bother us if your code is correct.


 Could this be an extremely rare case whereby the original code is 100%
 correct but the problems have been exacerbated by the many suggested patches
 given here being 100% incorrect?

Jests and barbs left aside, I believe his definition of correct is
wasn't crashing. Earlier in this thread there was a hint that he'd
tightened a bare except to one specific exception. My guess is his
code wasn't correct, but one bug (overly-broad try/except) masked
another.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Νίκος

Στις 30/9/2013 5:45 μμ, ο/η Mark Lawrence έγραψε:

On 29/09/2013 17:19, Νίκος wrote:

Στις 29/9/2013 7:14 μμ, ο/η Joel Goldstick έγραψε:

asked and answered.  Move on


shut up. you are nothign but annoyance here.


Absolutely hilarious.  Please give up your web work and Python and get a
job writing scripts for comedians, you'd make a large fortune.


I learn Python for personal pleasure because i like programming.
Perhaps it would be even better if you quit spamming my thread with your 
funny quotes.

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Antoon Pardon

Op 30-09-13 20:03, Νίκος schreef:

Στις 30/9/2013 5:45 μμ, ο/η Mark Lawrence έγραψε:

On 29/09/2013 17:19, Νίκος wrote:

Στις 29/9/2013 7:14 μμ, ο/η Joel Goldstick έγραψε:

asked and answered.  Move on


shut up. you are nothign but annoyance here.


Absolutely hilarious.  Please give up your web work and Python and get a
job writing scripts for comedians, you'd make a large fortune.


I learn Python for personal pleasure because i like programming.


You may like porgramming, but it is rather obvious you don't like
the python style of programming. So maybe you should chose a
laguage whose style is more to your liking.


Perhaps it would be even better if you quit spamming my thread with your
funny quotes.


You have no authority over what people contribute in your thread. Since
you don't seem very considerate about the effect your contributions have
on others, you can hardly expect others to be considerate of you.

--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Mark Lawrence

On 30/09/2013 19:03, Νίκος wrote:

Στις 30/9/2013 5:45 μμ, ο/η Mark Lawrence έγραψε:

On 29/09/2013 17:19, Νίκος wrote:

Στις 29/9/2013 7:14 μμ, ο/η Joel Goldstick έγραψε:

asked and answered.  Move on


shut up. you are nothign but annoyance here.


Absolutely hilarious.  Please give up your web work and Python and get a
job writing scripts for comedians, you'd make a large fortune.


I learn Python for personal pleasure because i like programming.
Perhaps it would be even better if you quit spamming my thread with your
funny quotes.


Your approach as given in the pseudocode given below is taking up what, 
50% of the bandwidth here?  What a waste of a resource.


while answer_isn't_what_I_want:
   keep_asking_question()

You are to this mailing list what King Herod was to baby sitting.

Please drop dead and the sooner the better.  Your arrogant attitide to 
the numerous people who've tried so hard to help you is disgraceful.


--
Cheers.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Ned Batchelder

On 9/30/13 2:42 PM, Mark Lawrence wrote:
Please drop dead and the sooner the better.  Your arrogant attitide to 
the numerous people who've tried so hard to help you is disgraceful.


Mark, I'm as frustrated as anyone by Nikos' threads, but there's really 
no call for Please drop dead.  We can do better than that.


--Ned.
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Νίκος

Στις 30/9/2013 9:42 μμ, ο/η Mark Lawrence έγραψε:

On 30/09/2013 19:03, Νίκος wrote:

Στις 30/9/2013 5:45 μμ, ο/η Mark Lawrence έγραψε:

On 29/09/2013 17:19, Νίκος wrote:

Στις 29/9/2013 7:14 μμ, ο/η Joel Goldstick έγραψε:

asked and answered.  Move on


shut up. you are nothign but annoyance here.


Absolutely hilarious.  Please give up your web work and Python and get a
job writing scripts for comedians, you'd make a large fortune.


I learn Python for personal pleasure because i like programming.
Perhaps it would be even better if you quit spamming my thread with your
funny quotes.


Your approach as given in the pseudocode given below is taking up what,
50% of the bandwidth here?  What a waste of a resource.

while answer_isn't_what_I_want:
keep_asking_question()


I was thankfull to the people that tried to help me(excluding you)
Several method have been given to solve the problem.
Other newbies reading this will help them better understand why its 
written the way it is if they compare all the solutions.
And yes, i won't rest until i have it working as i think its clearer and 
more compact.




You are to this mailing list what King Herod was to baby sitting.


And you are a major asshole leading this list, who is doing nothing else 
than critizizing others people's posts, spamming all he way along while 
contributing negatively only.



Please drop dead and the sooner the better.


After you please.


Your arrogant attitide to
the numerous people who've tried so hard to help you is disgraceful.



Your ironic attitude on the other hand is what characterizes you.

Triing out various solutions and picking the one that better meets one's 
style and needs, is hardly considered as arrogance.


--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Mark Lawrence

On 30/09/2013 21:13, Νίκος wrote:

And you are a major asshole leading this list, who is doing nothing else
than critizizing others people's posts, spamming all he way along while
contributing negatively only.



Really? http://code.activestate.com/lists/python-list/651611/

--
Cheers.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Antoon Pardon

Op 30-09-13 20:54, Ned Batchelder schreef:

On 9/30/13 2:42 PM, Mark Lawrence wrote:

Please drop dead and the sooner the better.  Your arrogant attitide to
the numerous people who've tried so hard to help you is disgraceful.


Mark, I'm as frustrated as anyone by Nikos' threads, but there's really
no call for Please drop dead.  We can do better than that.


I disagree. The Please drop dead seems well deserved to me. You may
think it better if people could put themselves above it, but that
doesn't make the remark less deserved.

--
Antoon Pardon

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Νίκος

Στις 30/9/2013 11:44 μμ, ο/η Mark Lawrence έγραψε:

On 30/09/2013 21:13, Νίκος wrote:

And you are a major asshole leading this list, who is doing nothing else
than critizizing others people's posts, spamming all he way along while
contributing negatively only.



Really? http://code.activestate.com/lists/python-list/651611/


One positive comment in the history opposes 10^2 negative ones.

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Joel Goldstick
On Mon, Sep 30, 2013 at 5:34 PM, Νίκος nikos.gr...@gmail.com wrote:

 Στις 30/9/2013 11:44 μμ, ο/η Mark Lawrence έγραψε:

 On 30/09/2013 21:13, Νίκος wrote:

 And you are a major asshole leading this list, who is doing nothing else
 than critizizing others people's posts, spamming all he way along while
 contributing negatively only.


 Really? 
 http://code.activestate.com/**lists/python-list/651611/http://code.activestate.com/lists/python-list/651611/


 One positive comment in the history opposes 10^2 negative ones.

 --
 https://mail.python.org/**mailman/listinfo/python-listhttps://mail.python.org/mailman/listinfo/python-list


well, actually no.  one positive comment (and I'm sorry your reference
didn't reveal one!) is 10^2-1 times as 10^2 negative comments.   Look in a
mirror dude.  You are lazy, you charge people for code that you don't even
have under source control, you have no interest in understanding and
studying how your servers work, how python works.  You bitch and whine at
people who come along to help you.  You are to slothful to look at a
traceback.  Your hosting company ignores you apparently because you are
such an sob they don't even want your business.  You pick a nickname that
is the defininition of an asshole:
http://www.politicsforum.org/images/flame_warriors/flame_62.php  and yet
you return again and again to be rude to all who first try to help you out,
then realize you are such a total jerk that they even wish you an awful
demise without even having met you..

Take a look in the mirror dude.

I don't care if you want to tell me to shut up.  It seemed amusing to
others here.

-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Mark Lawrence

On 30/09/2013 22:34, Νίκος wrote:

Στις 30/9/2013 11:44 μμ, ο/η Mark Lawrence έγραψε:

On 30/09/2013 21:13, Νίκος wrote:

And you are a major asshole leading this list, who is doing nothing else
than critizizing others people's posts, spamming all he way along while
contributing negatively only.



Really? http://code.activestate.com/lists/python-list/651611/


One positive comment in the history opposes 10^2 negative ones.



Yet more sheer unadulterated rubbish from an imbecile who clearly hasn't 
got the faintest idea what he's talking about.  Would you please be kind 
enough to stand up, your voice is rather muffled.  That is after you've 
done a proper statistical analysis of the number of positive posts I've 
made over the years.  You are actually one of the very few people who 
has managed to get quite so far up my nose, that's quite an achievement 
as by nature I'm actually extremely tolerant.


--
Cheers.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Νίκος

Στις 1/10/2013 12:44 πμ, ο/η Joel Goldstick έγραψε:




On Mon, Sep 30, 2013 at 5:34 PM, Νίκος nikos.gr...@gmail.com
mailto:nikos.gr...@gmail.com wrote:

Στις 30/9/2013 11:44 μμ, ο/η Mark Lawrence έγραψε:

On 30/09/2013 21:13, Νίκος wrote:

And you are a major asshole leading this list, who is doing
nothing else
than critizizing others people's posts, spamming all he way
along while
contributing negatively only.


Really? http://code.activestate.com/__lists/python-list/651611/
http://code.activestate.com/lists/python-list/651611/


One positive comment in the history opposes 10^2 negative ones.

--
https://mail.python.org/__mailman/listinfo/python-list
https://mail.python.org/mailman/listinfo/python-list


well, actually no.  one positive comment (and I'm sorry your reference
didn't reveal one!) is 10^2-1 times as 10^2 negative comments.   Look in
a mirror dude.  You are lazy, you charge people for code that you don't
even have under source control, you have no interest in understanding
and studying how your servers work, how python works.  You bitch and
whine at people who come along to help you.  You are to slothful to look
at a traceback.  Your hosting company ignores you apparently because you
are such an sob they don't even want your business.  You pick a nickname
that is the defininition of an asshole:
http://www.politicsforum.org/images/flame_warriors/flame_62.php  and yet
you return again and again to be rude to all who first try to help you
out, then realize you are such a total jerk that they even wish you an
awful demise without even having met you..

Take a look in the mirror dude.

I don't care if you want to tell me to shut up.  It seemed amusing to
others here.

--
Joel Goldstick
http://joelgoldstick.com


stfu dickhead.
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Denis McMahon
On Mon, 30 Sep 2013 15:51:39 +0100, Mark Lawrence wrote:

 On 30/09/2013 14:51, Grant Edwards wrote:
 On 2013-09-29, ?? nikos.gr...@gmail.com wrote:
  29/9/2013 10:53 , ??/?? Chris Angelico :

 You fail to understand that these code i now use was written with the
 help of regulars here and yes its correct.

 If you're code is correct, then use it and be happy.
 There's no need to bother us if your code is correct.

 Could this be an extremely rare case whereby the original code is 100%
 correct but the problems have been exacerbated by the many suggested
 patches given here being 100% incorrect?

I'm sending you the bill for hospital admission. I laughed so hard I fell 
off of my chair and banged my head!

-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Joel Goldstick
On Mon, Sep 30, 2013 at 6:08 PM, Νίκος nikos.gr...@gmail.com wrote:

 Στις 1/10/2013 12:44 πμ, ο/η Joel Goldstick έγραψε:




 On Mon, Sep 30, 2013 at 5:34 PM, Νίκος nikos.gr...@gmail.com
 mailto:nikos.gr...@gmail.com** wrote:

 Στις 30/9/2013 11:44 μμ, ο/η Mark Lawrence έγραψε:

 On 30/09/2013 21:13, Νίκος wrote:

 And you are a major asshole leading this list, who is doing
 nothing else
 than critizizing others people's posts, spamming all he way
 along while
 contributing negatively only.


 Really? 
 http://code.activestate.com/__**lists/python-list/651611/http://code.activestate.com/__lists/python-list/651611/

 
 http://code.activestate.com/**lists/python-list/651611/http://code.activestate.com/lists/python-list/651611/
 


 One positive comment in the history opposes 10^2 negative ones.

 --
 
 https://mail.python.org/__**mailman/listinfo/python-listhttps://mail.python.org/__mailman/listinfo/python-list

 
 https://mail.python.org/**mailman/listinfo/python-listhttps://mail.python.org/mailman/listinfo/python-list
 


 well, actually no.  one positive comment (and I'm sorry your reference
 didn't reveal one!) is 10^2-1 times as 10^2 negative comments.   Look in
 a mirror dude.  You are lazy, you charge people for code that you don't
 even have under source control, you have no interest in understanding
 and studying how your servers work, how python works.  You bitch and
 whine at people who come along to help you.  You are to slothful to look
 at a traceback.  Your hosting company ignores you apparently because you
 are such an sob they don't even want your business.  You pick a nickname
 that is the defininition of an asshole:
 http://www.politicsforum.org/**images/flame_warriors/flame_**62.phphttp://www.politicsforum.org/images/flame_warriors/flame_62.php
  and yet
 you return again and again to be rude to all who first try to help you
 out, then realize you are such a total jerk that they even wish you an
 awful demise without even having met you..

 Take a look in the mirror dude.

 I don't care if you want to tell me to shut up.  It seemed amusing to
 others here.

 --
 Joel Goldstick
 http://joelgoldstick.com


 stfu dickhead.
 --
 https://mail.python.org/**mailman/listinfo/python-listhttps://mail.python.org/mailman/listinfo/python-list


that was responsive!  You should join your local debating club!

anyway, out!

-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Mark Lawrence

On 30/09/2013 23:08, Νίκος wrote:

Στις 1/10/2013 12:44 πμ, ο/η Joel Goldstick έγραψε:




On Mon, Sep 30, 2013 at 5:34 PM, Νίκος nikos.gr...@gmail.com
mailto:nikos.gr...@gmail.com wrote:

Στις 30/9/2013 11:44 μμ, ο/η Mark Lawrence έγραψε:

On 30/09/2013 21:13, Νίκος wrote:

And you are a major asshole leading this list, who is doing
nothing else
than critizizing others people's posts, spamming all he way
along while
contributing negatively only.


Really? http://code.activestate.com/__lists/python-list/651611/
http://code.activestate.com/lists/python-list/651611/


One positive comment in the history opposes 10^2 negative ones.

--
https://mail.python.org/__mailman/listinfo/python-list
https://mail.python.org/mailman/listinfo/python-list


well, actually no.  one positive comment (and I'm sorry your reference
didn't reveal one!) is 10^2-1 times as 10^2 negative comments.   Look in
a mirror dude.  You are lazy, you charge people for code that you don't
even have under source control, you have no interest in understanding
and studying how your servers work, how python works.  You bitch and
whine at people who come along to help you.  You are to slothful to look
at a traceback.  Your hosting company ignores you apparently because you
are such an sob they don't even want your business.  You pick a nickname
that is the defininition of an asshole:
http://www.politicsforum.org/images/flame_warriors/flame_62.php  and yet
you return again and again to be rude to all who first try to help you
out, then realize you are such a total jerk that they even wish you an
awful demise without even having met you..

Take a look in the mirror dude.

I don't care if you want to tell me to shut up.  It seemed amusing to
others here.

--
Joel Goldstick
http://joelgoldstick.com


stfu dickhead.


To quote from The A-Team, I love it when a plan comes together.

--
Cheers.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Νίκος

Στις 1/10/2013 1:14 πμ, ο/η Mark Lawrence έγραψε:

On 30/09/2013 23:08, Νίκος wrote:

Στις 1/10/2013 12:44 πμ, ο/η Joel Goldstick έγραψε:




On Mon, Sep 30, 2013 at 5:34 PM, Νίκος nikos.gr...@gmail.com
mailto:nikos.gr...@gmail.com wrote:

Στις 30/9/2013 11:44 μμ, ο/η Mark Lawrence έγραψε:

On 30/09/2013 21:13, Νίκος wrote:

And you are a major asshole leading this list, who is doing
nothing else
than critizizing others people's posts, spamming all he way
along while
contributing negatively only.


Really? http://code.activestate.com/__lists/python-list/651611/
http://code.activestate.com/lists/python-list/651611/


One positive comment in the history opposes 10^2 negative ones.

--
https://mail.python.org/__mailman/listinfo/python-list
https://mail.python.org/mailman/listinfo/python-list


well, actually no.  one positive comment (and I'm sorry your reference
didn't reveal one!) is 10^2-1 times as 10^2 negative comments.   Look in
a mirror dude.  You are lazy, you charge people for code that you don't
even have under source control, you have no interest in understanding
and studying how your servers work, how python works.  You bitch and
whine at people who come along to help you.  You are to slothful to look
at a traceback.  Your hosting company ignores you apparently because you
are such an sob they don't even want your business.  You pick a nickname
that is the defininition of an asshole:
http://www.politicsforum.org/images/flame_warriors/flame_62.php  and yet
you return again and again to be rude to all who first try to help you
out, then realize you are such a total jerk that they even wish you an
awful demise without even having met you..

Take a look in the mirror dude.

I don't care if you want to tell me to shut up.  It seemed amusing to
others here.

--
Joel Goldstick
http://joelgoldstick.com


stfu dickhead.


To quote from The A-Team, I love it when a plan comes together.


2 dickheads names Joe  Mark work together to achieve total bullshit!
Well done Beavis  Butthead!
rofl...

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Mark Lawrence

On 30/09/2013 23:19, Νίκος wrote:


2 dickheads names Joe  Mark work together to achieve total bullshit!
Well done Beavis  Butthead!
rofl...



Well aside from the fact that you've maintained your record by being 
inaccurate with 50% of the names that you've quoted, it appears that 
we've something that has very much in common with your website.  Which 
reminds me, is it still possible to access your users' names and 
passwords in plain text or is that something that you've actually 
bothered to fix?


--
Cheers.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Chris Angelico
On Tue, Oct 1, 2013 at 4:03 AM, Νίκος nikos.gr...@gmail.com wrote:
 Στις 30/9/2013 5:45 μμ, ο/η Mark Lawrence έγραψε:
 Absolutely hilarious.  Please give up your web work and Python and get a
 job writing scripts for comedians, you'd make a large fortune.


 I learn Python for personal pleasure because i like programming.
 Perhaps it would be even better if you quit spamming my thread with your
 funny quotes.

Then maybe you should keep to programming for personal pleasure and
stop trying to make it part of your business. Most of your problems
stem from a perceived urgency - you panic, because you have stupidly
edited your live code again, and come to this list begging for help.
If you were coding purely for pleasure, your problems would not lose
you customers, and you could deal with issues calmly.

To be quite frank, I think you SHOULD lose customers. Suppose you buy
a piece of furniture from some small-time carpenter, and the moving
parts are stuck, it wobbles on its legs, and if anyone uses it who
isn't American, it crashes to the floor (which is how your Unicode
issues make you look). You go and complain, loudly, in front of people
who were looking at his wares and considering buying. He might lose
customers because of your complaint - but if he's selling a dodgy
product, he *should* lose customers. Carpentry for pleasure, or
programming for pleasure, is a fine thing to do, but it should not be
considered business.

Nikos, I sincerely hope that all these problems cause you to go out of
business. Preferably right now, with just enough maintenance to last
till the end of your contracts with people. Then start programming
purely as a hobby, until you actually master the craft.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Νίκος

Στις 1/10/2013 1:28 πμ, ο/η Mark Lawrence έγραψε:

On 30/09/2013 23:19, Νίκος wrote:


2 dickheads names Joe  Mark work together to achieve total bullshit!
Well done Beavis  Butthead!
rofl...



Well aside from the fact that you've maintained your record by being
inaccurate with 50% of the names that you've quoted, it appears that
we've something that has very much in common with your website.  Which
reminds me, is it still possible to access your users' names and
passwords in plain text or is that something that you've actually
bothered to fix?


Nope, it isn't. I have fixed it.
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Νίκος

Στις 1/10/2013 1:29 πμ, ο/η Chris Angelico έγραψε:

On Tue, Oct 1, 2013 at 4:03 AM, Νίκος nikos.gr...@gmail.com wrote:

Στις 30/9/2013 5:45 μμ, ο/η Mark Lawrence έγραψε:

Absolutely hilarious.  Please give up your web work and Python and get a
job writing scripts for comedians, you'd make a large fortune.



I learn Python for personal pleasure because i like programming.
Perhaps it would be even better if you quit spamming my thread with your
funny quotes.


Then maybe you should keep to programming for personal pleasure and
stop trying to make it part of your business. Most of your problems
stem from a perceived urgency - you panic, because you have stupidly
edited your live code again, and come to this list begging for help.
If you were coding purely for pleasure, your problems would not lose
you customers, and you could deal with issues calmly.

To be quite frank, I think you SHOULD lose customers. Suppose you buy
a piece of furniture from some small-time carpenter, and the moving
parts are stuck, it wobbles on its legs, and if anyone uses it who
isn't American, it crashes to the floor (which is how your Unicode
issues make you look). You go and complain, loudly, in front of people
who were looking at his wares and considering buying. He might lose
customers because of your complaint - but if he's selling a dodgy
product, he *should* lose customers. Carpentry for pleasure, or
programming for pleasure, is a fine thing to do, but it should not be
considered business.

Nikos, I sincerely hope that all these problems cause you to go out of
business. Preferably right now, with just enough maintenance to last
till the end of your contracts with people. Then start programming
purely as a hobby, until you actually master the craft.



I learn during the process.
That's how i deal with the situation.
I challedge my self and then try to confront the given situation _live_.

It's not wise to do so, but that how i operate.
Apart form that my customer's webistes have no problems, everyhting i do 
its domain specific, my domain, DNS and Mail issues for my domain, i 
don't play with customer's settings and data.


I have a good sense _not_ to fiddle with their accounts(except from the 
time that i have taken the risk to give you root access to helo me with 
a python issue, and you've helped me appropiately).



--
https://mail.python.org/mailman/listinfo/python-list


Mutual respect, tolerance, encouragement (was: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte)

2013-09-30 Thread Ben Finney
Chris Angelico ros...@gmail.com writes:

 Nikos, I sincerely hope that all these problems cause you to go out of
 business. Preferably right now, with just enough maintenance to last
 till the end of your contracts with people. Then start programming
 purely as a hobby, until you actually master the craft.

This is a sentiment I can heartily endorse. Far better than puerile
jeers and hostile desires for violence.

Please, everyone in this thread needs to keep in mind our host's
Diversity Statement:

The Python Software Foundation and the global Python community
welcome and encourage participation by everyone. Our community is
based on mutual respect, tolerance, and encouragement, and we are
working to help each other live up to these principles. We want our
community to be more diverse: whoever you are, and whatever your
background, we welcome you.

Let's keep all discussions here close to those principles.

-- 
 \  “The trouble with the rat race is that even if you win, you're |
  `\   still a rat.” —Jane Wagner, via Lily Tomlin |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Chris Angelico
On Tue, Oct 1, 2013 at 8:30 AM, Νίκος nikos.gr...@gmail.com wrote:
 Στις 1/10/2013 1:28 πμ, ο/η Mark Lawrence έγραψε:

 On 30/09/2013 23:19, Νίκος wrote:


 2 dickheads names Joe  Mark work together to achieve total bullshit!
 Well done Beavis  Butthead!
 rofl...


 Well aside from the fact that you've maintained your record by being
 inaccurate with 50% of the names that you've quoted, it appears that
 we've something that has very much in common with your website.  Which
 reminds me, is it still possible to access your users' names and
 passwords in plain text or is that something that you've actually
 bothered to fix?


 Nope, it isn't. I have fixed it.

And this doesn't bother you???!?

Nikos, industry best practice is to make sure people can't steal all
your users' passwords *even if they get access to your hard drive*.
Passwords should be stored like this:

92e25cf5beefd4982cedd2f28b430e0e9d23e0966ee3f20c74f825eb9842

That's the password qwer, on an account named asdf, on a mythical
system. Even knowing that, you can't work out what another password
means. Storing people's passwords in plain text is a HORRIBLE HORRIBLE
idea - and having them accessible to the world is a sign of a complete
and utter lack of any semblance of security.

I understand that bugs happen. But bugs of this criticality should be
your very highest priority... unless you're not actually in business
here, and you're just scamming a bunch of people by pretending you run
a legit enterprise.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Νίκος

Στις 1/10/2013 1:43 πμ, ο/η Chris Angelico έγραψε:

On Tue, Oct 1, 2013 at 8:30 AM, Νίκος nikos.gr...@gmail.com wrote:

Στις 1/10/2013 1:28 πμ, ο/η Mark Lawrence έγραψε:


On 30/09/2013 23:19, Νίκος wrote:



2 dickheads names Joe  Mark work together to achieve total bullshit!
Well done Beavis  Butthead!
rofl...



Well aside from the fact that you've maintained your record by being
inaccurate with 50% of the names that you've quoted, it appears that
we've something that has very much in common with your website.  Which
reminds me, is it still possible to access your users' names and
passwords in plain text or is that something that you've actually
bothered to fix?



Nope, it isn't. I have fixed it.


And this doesn't bother you???!?

Nikos, industry best practice is to make sure people can't steal all
your users' passwords *even if they get access to your hard drive*.
Passwords should be stored like this:

92e25cf5beefd4982cedd2f28b430e0e9d23e0966ee3f20c74f825eb9842

That's the password qwer, on an account named asdf, on a mythical
system. Even knowing that, you can't work out what another password
means. Storing people's passwords in plain text is a HORRIBLE HORRIBLE
idea - and having them accessible to the world is a sign of a complete
and utter lack of any semblance of security.

I understand that bugs happen. But bugs of this criticality should be
your very highest priority... unless you're not actually in business
here, and you're just scamming a bunch of people by pretending you run
a legit enterprise.

ChrisA

I don't have the security awareness you have, but i'am learnign at the 
process.


What maked you think i store peoples password in plain text?

All the user account passwords i set i do it via cPanel or via WHM.

How those services store the password in the linux server its up to them.
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Chris Angelico
On Tue, Oct 1, 2013 at 8:36 AM, Νίκος nikos.gr...@gmail.com wrote:
 I learn during the process.
 That's how i deal with the situation.
 I challedge my self and then try to confront the given situation _live_.

 It's not wise to do so, but that how i operate.

Everyone's learning on the job. (I learned this week that it's
possible to play fast and loose with ARP and routing, to make one
computer look like two and two look like one. That was fun. When I
came up with the concept, I gave my boss a 95% confidence that it'd
work; and so far it's not caused any trouble.) But what you're doing
is charging your customers while you learn the very basics. You can't
sell Hello, world. Most people expect to go to university to learn a
trade; some spend two decades playing with something before earning a
single dollar (or Euro, or yen).

Learn to code, THEN try to make money at it. Or even leave off the
'then' clause - plenty of people never earn anything from code, and
stay as happy amateurs. There's nothing wrong with that.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Νίκος

Στις 1/10/2013 1:56 πμ, ο/η Chris Angelico έγραψε:

But what you're doing
is charging your customers while you learn the very basics.


I designed their websites and they are up and running.
Yes i have charged some money, but they gain what they paid for, a 
running website, all of them.


So, its not like i'm ripping off someone here.


You can't sell Hello, world.


I hope i was in the position to sell python code but i'am not.
I learn Python because i like programming.

My reseller site should have been made probably in wordpress or joomla 
cms but i decided to code it in Python instead because i like the 
language and want it to learn it better and better. It has secret 
functions as well.


When i problem occurs i just ask and thats how i progress.
Sometimes i do a little reading too :)
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-30 Thread Steven D'Aprano
On Tue, 01 Oct 2013 01:08:41 +0300, Νίκος wrote:

 stfu dickhead.


And you're back in the kill-file.

*plonk*



-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

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?
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Chris Angelico
On Sun, Sep 29, 2013 at 5:49 PM, Νίκος nikos.gr...@gmail.com wrote:
 Hello although my code is correct just today i saw this in the error_log

You retain this ridiculous arrogance that your code is somehow
correct, despite the problems you continually face. Do not these
problems prove that your code is NOT correct?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

Στις 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' ?
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

Στις 29/9/2013 10:53 πμ, ο/η Chris Angelico έγραψε:

On Sun, Sep 29, 2013 at 5:49 PM, Νίκος nikos.gr...@gmail.com wrote:

Hello although my code is correct just today i saw this in the error_log


You retain this ridiculous arrogance that your code is somehow
correct, despite the problems you continually face. Do not these
problems prove that your code is NOT correct?

ChrisA



You fail to understand that these code i now use was written with the 
help of regulars here and yes its correct.



As i said in my previous post i already identified that the problem was 
at the error handling.



Since this is not a socket.gaierror it wants:

except Exception as e: ?

i just tried it and now it works.

but then again why the:UnicodeDecodeError: 'utf-8' codec can't 
decode byte 0xb6 in position 0: invalid start byte


when it comes to determine the 'host' ?
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Chris Angelico
On Sun, Sep 29, 2013 at 5:53 PM, Νίκος nikos.gr...@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
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

Στις 29/9/2013 11:00 πμ, ο/η Chris Angelico έγραψε:

On Sun, Sep 29, 2013 at 5:53 PM, Νίκος nikos.gr...@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.

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Chris Angelico
On Sun, Sep 29, 2013 at 6:04 PM, Νίκος nikos.gr...@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
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

Στις 29/9/2013 11:07 πμ, ο/η Chris Angelico έγραψε:

On Sun, Sep 29, 2013 at 6:04 PM, Νίκος nikos.gr...@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.


--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Chris Angelico
On Sun, Sep 29, 2013 at 6:19 PM, Νίκος nikos.gr...@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
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

Στις 29/9/2013 11:23 πμ, ο/η Chris Angelico έγραψε:

On Sun, Sep 29, 2013 at 6:19 PM, Νίκος nikos.gr...@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

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

Στις 29/9/2013 11:30 πμ, ο/η Νίκος έγραψε:

Στις 29/9/2013 11:23 πμ, ο/η Chris Angelico έγραψε:

On Sun, Sep 29, 2013 at 6:19 PM, Νίκος nikos.gr...@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?
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread 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.gr...@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
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

Στις 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.gr...@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.


Butat 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.


--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Ned Batchelder

On 9/29/13 4:04 AM, Νίκος wrote:

Στις 29/9/2013 11:00 πμ, ο/η Chris Angelico έγραψε:

On Sun, Sep 29, 2013 at 5:53 PM, Νίκος nikos.gr...@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.


This is the nature of Unicode pain in Python 2 (Python 3 has a different 
kind!).  This may help you understand what's going on: 
http://nedbatchelder.com/text/unipain.html


--Ned.
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread 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.



-- 
DaveA


-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

Στις 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.58secure.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
360 ;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.

mail14400   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 :(

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread 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.




-- 
DaveA


-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

Στις 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?

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Chris “Kwpolska” Warrick
On Sun, Sep 29, 2013 at 1:51 PM, Νίκος nikos.gr...@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
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Chris Angelico
On Sun, Sep 29, 2013 at 10:38 PM, Chris “Kwpolska” Warrick
kwpol...@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
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Steven D'Aprano
On Sun, 29 Sep 2013 06:53:27 -0400, Ned Batchelder wrote:

 This is the nature of Unicode pain in Python 2 (Python 3 has a different
 kind!).  This may help you understand what's going on:
 http://nedbatchelder.com/text/unipain.html

That's a fantastic explanation, and I have pointed Nikos at that before, 
but he is running Python 3, not 2, so the obvious problem is not likely 
to be the actual problem.


-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Chris Angelico
On Sun, Sep 29, 2013 at 9:25 PM, Νίκος nikos.gr...@gmail.com wrote:
 superhost.gr.   14400   IN  MX  0   superhost.gr.

 mail14400   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
360 ;expire
86400   )

@   86400   IN  NS  ns1
@   86400   IN  NS  ns2

@   IN  A   84.200.17.58

@   IN  MX  0 @

mailIN  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 ni...@gr33k.gmail.com which is flat-out wrong. Fortunately
for you, Gmail will accept nikosgr...@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
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

Στις 29/9/2013 5:19 μμ, ο/η Chris Angelico έγραψε:

On Sun, Sep 29, 2013 at 9:25 PM, Νίκος nikos.gr...@gmail.com wrote:

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

mail14400   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
 360 ;expire
 86400   )

@   86400   IN  NS  ns1
@   86400   IN  NS  ns2

@   IN  A   84.200.17.58

@   IN  MX  0 @

mailIN  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 ni...@gr33k.gmail.com which is flat-out wrong. Fortunately
for you, Gmail will accept nikosgr...@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.

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Joel Goldstick
asked and answered.  Move on
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Νίκος

Στις 29/9/2013 7:14 μμ, ο/η Joel Goldstick έγραψε:

asked and answered.  Move on


shut up. you are nothign but annoyance here.
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Terry Reedy

On 9/29/2013 6:53 AM, Ned Batchelder wrote:


This is the nature of Unicode pain in Python 2 (Python 3 has a different
kind!).  This may help you understand what's going on:
http://nedbatchelder.com/text/unipain.html


This is really excellent and I bookmarked it.

There is one minor error: the conversion from int to float can't fail,

 float(10**1000)
Traceback (most recent call last):
  File pyshell#0, line 1, in module
float(10**1000)
OverflowError: long int too large to convert to float

Even when it succeeds, it can fail in the sense of losing information.
 int(float(12345678901234567890))
12345678901234567168
 float(int(1.55))
1.0

This is somewhat analogous to a combination of errors='ignore' and 
errors='replace' (with random garbage).


I think the presentation would be strengthened with the correction, as 
it shows that the problems of conversion are *not* unique to bytes and 
unicode.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Ned Batchelder

On 9/29/13 1:30 PM, Terry Reedy wrote:

On 9/29/2013 6:53 AM, Ned Batchelder wrote:


This is the nature of Unicode pain in Python 2 (Python 3 has a different
kind!).  This may help you understand what's going on:
http://nedbatchelder.com/text/unipain.html


This is really excellent and I bookmarked it.

There is one minor error: the conversion from int to float can't fail,

 float(10**1000)
Traceback (most recent call last):
  File pyshell#0, line 1, in module
float(10**1000)
OverflowError: long int too large to convert to float

Even when it succeeds, it can fail in the sense of losing information.
 int(float(12345678901234567890))
12345678901234567168
 float(int(1.55))
1.0

This is somewhat analogous to a combination of errors='ignore' and 
errors='replace' (with random garbage).


I think the presentation would be strengthened with the correction, as 
it shows that the problems of conversion are *not* unique to bytes and 
unicode.




Thanks, these are excellent points.

--Ned.
--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-29 Thread Larry Hudson

On 09/29/2013 09:19 AM, Νίκος wrote:

Στις 29/9/2013 7:14 μμ, ο/η Joel Goldstick έγραψε:

asked and answered.  Move on


shut up. you are nothign but annoyance here.


Thanks for the laugh.

Absolutely the most hilarious thing you've ever posted!!!   :-)

(Ever hear about the pot and the kettle?)

--
https://mail.python.org/mailman/listinfo/python-list


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

2013-09-06 Thread roggero . n
shut off the HD, start the SO form an USB and shut on again the HD

-- 
https://mail.python.org/mailman/listinfo/python-list


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

2013-07-12 Thread Wayne Werner

On Thu, 4 Jul 2013, Νίκος Γκρ33κ wrote:


Στις 4/7/2013 6:10 μμ, ο/η MRAB έγραψε:

What do you mean I don't know how to catch the exception with
OSError? You've tried except socket.gaierror and except
socket.herror, well just write except OSError instead!



try:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
except OSError:
host = UnResolved

produces also an internal server error.

Are you sure is just except OSError ?



Have you ensured that 'REMOTE_ADDR' is actually a key in os.environ? I 
highly recommend using the logging module to help diagnose what the actual 
exception is.


HTH,
-W-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-12 Thread Ferrous Cranus

Στις 12/7/2013 2:47 μμ, ο/η Wayne Werner έγραψε:

On Thu, 4 Jul 2013, Νίκος Γκρ33κ wrote:


Στις 4/7/2013 6:10 μμ, ο/η MRAB έγραψε:

What do you mean I don't know how to catch the exception with
OSError? You've tried except socket.gaierror and except
socket.herror, well just write except OSError instead!



try:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
except OSError:
host = UnResolved

produces also an internal server error.

Are you sure is just except OSError ?



Have you ensured that 'REMOTE_ADDR' is actually a key in os.environ? I
highly recommend using the logging module to help diagnose what the
actual exception is.

HTH,
-W


Yes it is a key, but the problem as i suspected was cloudflare.
i had to use os.environ['HTTP_CF_CONNECTING_IP'] that cloudflare passes 
as variable i the cgi enviroment in order to retrieve the visitor's ip.



try:
gi = pygeoip.GeoIP('/usr/local/share/GeoLiteCity.dat')
city = gi.time_zone_by_addr( os.environ['HTTP_CF_CONNECTING_IP'] )
host = socket.gethostbyaddr( os.environ['HTTP_CF_CONNECTING_IP'] )[0]
except Exception as e:
host = repr(e)


Sometimes though iam still receiving the usual
UnicodeDecodeError('utf-8', b'\xc1\xf0\xef\xf4\xf5

but only for a few ip addresses, in moste cases it works.
--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-12 Thread Dave Angel

On 07/12/2013 07:56 AM, Ferrous Cranus wrote:

Στις 12/7/2013 2:47 μμ, ο/η Wayne Werner έγραψε:

On Thu, 4 Jul 2013, Νίκος Γκρ33κ wrote:


Στις 4/7/2013 6:10 μμ, ο/η MRAB έγραψε:

What do you mean I don't know how to catch the exception with
OSError? You've tried except socket.gaierror and except
socket.herror, well just write except OSError instead!



try:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
except OSError:
host = UnResolved

produces also an internal server error.

Are you sure is just except OSError ?



Have you ensured that 'REMOTE_ADDR' is actually a key in os.environ? I
highly recommend using the logging module to help diagnose what the
actual exception is.

HTH,
-W


Yes it is a key, but the problem as i suspected was cloudflare.
i had to use os.environ['HTTP_CF_CONNECTING_IP'] that cloudflare passes
as variable i the cgi enviroment in order to retrieve the visitor's ip.


try:
 gi = pygeoip.GeoIP('/usr/local/share/GeoLiteCity.dat')
 city = gi.time_zone_by_addr( os.environ['HTTP_CF_CONNECTING_IP'] )
 host = socket.gethostbyaddr( os.environ['HTTP_CF_CONNECTING_IP'] )[0]
except Exception as e:
 host = repr(e)


Sometimes though iam still receiving the usual
UnicodeDecodeError('utf-8', b'\xc1\xf0\xef\xf4\xf5

but only for a few ip addresses, in moste cases it works.


And naturally, you now know how to debug those UnicodeDecodeError 
problems.  Surely, the code you post here isn't what you actually do, 
because when people spend time to give you detailed advice, you actually 
read it, and work at understanding it.


Chortle, snort.

--
DaveA

--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Ferrous Cranus

Στις 5/7/2013 3:06 πμ, ο/η Nobody έγραψε:

On Thu, 04 Jul 2013 13:38:09 +0300, Νίκος wrote:


So you are also suggesting that what gesthostbyaddr() returns is not
utf-8 encoded too?


The gethostbyaddr() OS function returns a byte string with no specified
encoding. Python 3 will doubtless try to decode that to a character string
using some (probably unspecified) encoding.


I see, but if the function returns a byte string not inutf-8 format then 
how my script is uspposes to decode this byte string?


And why only this error happens when i cloudflare my domain, while when 
i un-cloudflare it are reverse DNS are being resolves without problem.

So the queston is: How come it only fails when i cloidflare the domain?

Also please comment on that:

host =  gethostbyaddr() or UnResolved

This will return the first argument that define the evaluation as being 
true or untrue.


if function returns false the the 2nd argument.
Nut if the function gives an exception will the condition return the 2nd 
argument or will the program fail?


I was udner the impression that i could avoid error handling  inside 
try/excepts by utilizing or.

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 3:06 πμ, ο/η Nobody έγραψε:

On Thu, 04 Jul 2013 13:38:09 +0300, Νίκος wrote:


So you are also suggesting that what gesthostbyaddr() returns is not
utf-8 encoded too?


The gethostbyaddr() OS function returns a byte string with no specified
encoding. Python 3 will doubtless try to decode that to a character string
using some (probably unspecified) encoding.

Names obtained from DNS should consist entirely of ASCII characters
(gethostbyname shouldn't attempt to decode internationalised names
which use IDN, it should return the raw data).

Names obtained by other means (e.g. /etc/hosts or Active Directory) could
contain anything, but if you use non-ASCII hostnames you're asking for
trouble.



Please help because i just happened to noticed that after having this code:

try:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
except Exception as e:
host = Reverse DNS Failed


all requests are being resolves, result to:


Reverse DNS Failed as you can see here:
http://superhost.gr/?show=logpage=index.html

How can the above code not be able to reeverse dns any more and it falls 
back to  the failed string?


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Lele Gaifax
Ferrous Cranus ni...@superhost.gr writes:

 host =  gethostbyaddr() or UnResolved

 This will return the first argument that define the evaluation as
 being true or untrue.

 if function returns false the the 2nd argument.
 Nut if the function gives an exception will the condition return the
 2nd argument or will the program fail?

 I was udner the impression that i could avoid error handling  inside
 try/excepts by utilizing or.

No, you had the wrong impression. Why don't you simply invoke the Python
interpreter and try things out with that??

 a = 1/0 or 100
Traceback (most recent call last):
  File stdin, line 1, in module
ZeroDivisionError: division by zero
 a
Traceback (most recent call last):
  File stdin, line 1, in module
NameError: name 'a' is not defined
 a = 0/1 or 100
 a
100


ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Lele Gaifax
Νίκος Gr33k ni...@superhost.gr writes:

 try:
   host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
 except Exception as e:
   host = Reverse DNS Failed

 How can the above code not be able to reeverse dns any more and it
 falls back to  the failed string?

The only way to know is actually printing out the exception, either to
stderr, or better using the logging facility, as I suggested.

FYI, your code above is (almost) exactly equivalent to the simpler

try:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
except:
host = Reverse DNS Failed

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 10:06 πμ, ο/η Lele Gaifax έγραψε:

 try:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
 except:
host = Reverse DNS Failed



Yes i uses to had it like that, until i was looking for ways to make it 
hold the error


except Exception as e:
print( e )
host = e

but print( e ) in the way i used to had it doesn't print out the error, 
it instead gives an internal server error on browser.


I must somehow take a look at the error to understand why every visitor 
i have gets UnResolved, but how since prints fails?


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 9:55 πμ, ο/η Lele Gaifax έγραψε:

Ferrous Cranus ni...@superhost.gr writes:


host =  gethostbyaddr() or UnResolved

This will return the first argument that define the evaluation as
being true or untrue.

if function returns false the the 2nd argument.
Nut if the function gives an exception will the condition return the
2nd argument or will the program fail?

I was udner the impression that i could avoid error handling  inside
try/excepts by utilizing or.


No, you had the wrong impression. Why don't you simply invoke the Python
interpreter and try things out with that??

  a = 1/0 or 100
 Traceback (most recent call last):
   File stdin, line 1, in module
 ZeroDivisionError: division by zero
  a
 Traceback (most recent call last):
   File stdin, line 1, in module
 NameError: name 'a' is not defined
  a = 0/1 or 100
  a
 100
 


Thank you Lele, i wanted to but i had no idea how to test it.
Your devision by zero is very smart thing to test!

So it proves that a condition cannot be evaluation as truthy or falsey 
if one of the operators is giving out an exception.

Thank you.


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Benjamin Kaplan
On Jul 5, 2013 12:12 AM, Lele Gaifax l...@metapensiero.it wrote:

 Νίκος Gr33k ni...@superhost.gr writes:

  try:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
  except Exception as e:
host = Reverse DNS Failed
 
  How can the above code not be able to reeverse dns any more and it
  falls back to  the failed string?

 The only way to know is actually printing out the exception, either to
 stderr, or better using the logging facility, as I suggested.

 FYI, your code above is (almost) exactly equivalent to the simpler

 try:
 host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
 except:
 host = Reverse DNS Failed

 ciao, lele.


They aren't equivalent. except Exception won't catch KeyboardInterrupt or
SystemExit or a few others that you really don't want to catch in a generic
error handler. You should almost never have a bare except.
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Dave Angel

On 07/05/2013 02:51 AM, Νίκος Gr33k wrote:

SNIP


Please help because i just happened to noticed that after having this code:

try:
 host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
except Exception as e:
 host = Reverse DNS Failed


Don't ever catch a bare Exception class.  Make it more specific to the 
particular problem you're trying to suppress.


In particular, your previous problem with the utf-8 decoding will also 
be caught by the Exception class, so it'll get all lumped together as 
Reverse DNS Failed.





all requests are being resolves, result to:


Reverse DNS Failed as you can see here:
http://superhost.gr/?show=logpage=index.html

How can the above code not be able to reeverse dns any more and it falls
back to  the failed string?



Since you've not made any progress with all the other suggestions, how 
about if you decompose this line into several, and see just which one is 
failing?  Maybe that'll tell you what's going on.  In general, 
suppressing an exception without knowing why it's firing is a huge mistake.


The line started as:

  host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]

refactor that to:
   remadd = os.environ('REMOVE_ADDR')
   tuple3 = socket.gethostbyaddr(remadd)
   host = tuple3[0]

and see which one throws the exception.  Then once you have that, 
examine the exact parameters that might be triggering the problem.  In 
particular, figure out the exact types and values for remadd and tuple3.


   print(type(remadd) +  :  + repr(remadd))

Of course, print itself won't work too well in a CGI environment.  But 
you must have solved that problem by now, either using log files or 
running the program excerpt in a regular console.



--
DaveA

--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 10:50 πμ, ο/η Dave Angel έγραψε:


The line started as:

   host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]

refactor that to:
remadd = os.environ('REMOVE_ADDR')
tuple3 = socket.gethostbyaddr(remadd)
host = tuple3[0]

and see which one throws the exception.  Then once you have that,
examine the exact parameters that might be triggering the problem.  In
particular, figure out the exact types and values for remadd and tuple3.

print(type(remadd) +  :  + repr(remadd))


I'am not sure how iam supposed to write this: i just tried this:


try:
remadd = os.environ('REMOVE_ADDR')
tuple3 = socket.gethostbyaddr(remadd)
host = tuple3[0]
except:
host = type(remadd) +  :  + repr(remadd)


but iam getting an internal server error.

I didnt print it as you said but its the same thing host var gets 
printed later on.


Now, why would this give an internal server error?

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Dave Angel

On 07/05/2013 03:13 AM, Νίκος Gr33k wrote:

Στις 5/7/2013 10:06 πμ, ο/η Lele Gaifax έγραψε:

 try:
 host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
 except:
 host = Reverse DNS Failed



Yes i uses to had it like that, until i was looking for ways to make it
hold the error

except Exception as e:
 print( e )
 host = e

but print( e ) in the way i used to had it doesn't print out the error,
it instead gives an internal server error on browser.

I must somehow take a look at the error to understand why every visitor
i have gets UnResolved, but how since prints fails?




How have you been doing it all along?  Just open a console onto that 
server, start the appropriate version of Python interactively, and try 
the things we've been talking about.  If it fails the same way as within 
the cgi environmnet, you get full visibility.


Or if the problems cannot be recreated outside the cgi environment, use 
the log files you've been logging other problems into.  Or simply open a 
text file for writing, and add a file= keyword parameter to the print 
function call.


 print(repr(e), file=myfile)



--
DaveA

--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Dave Angel

On 07/05/2013 04:00 AM, Νίκος Gr33k wrote:

Στις 5/7/2013 10:50 πμ, ο/η Dave Angel έγραψε:


The line started as:

   host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]

refactor that to:
remadd = os.environ('REMOVE_ADDR')
tuple3 = socket.gethostbyaddr(remadd)
host = tuple3[0]

and see which one throws the exception.  Then once you have that,
examine the exact parameters that might be triggering the problem.  In
particular, figure out the exact types and values for remadd and tuple3.

print(type(remadd) +  :  + repr(remadd))


I'am not sure how iam supposed to write this: i just tried this:


try:
 remadd = os.environ('REMOVE_ADDR')
 tuple3 = socket.gethostbyaddr(remadd)
 host = tuple3[0]
except:
 host = type(remadd) +  :  + repr(remadd)


but iam getting an internal server error.

I didnt print it as you said but its the same thing host var gets
printed later on.

Now, why would this give an internal server error?



I have no idea what causes an internal server error.  It's up to you to 
get the output of the expression to some location you can examine. 
Easiest way is to run those 3 lines directly on the server, not in the 
cgi environment.


But if you don't have any debugging tools, then STOP right now and build 
some.  Use logging, or redirect print, or do something that the server 
folks provide as debugging aids.  But just blindly guessing is 
ludicrous.  So also is throwing out clues by using a bare except.


Assigning that string to host makes no sense at all.  And neither does 
putting it in the except clause.  You want to get that string to YOUR 
eyes, not to the server who might get an internal server error.



--
DaveA

--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread feedthetroll
Am Freitag, 5. Juli 2013 10:00:21 UTC+2 schrieb Νίκος Gr33k:
 ...
 I'am not sure how iam supposed to write this: i just tried this:
 try:
   remadd = os.environ('REMOVE_ADDR')
   tuple3 = socket.gethostbyaddr(remadd)
   host = tuple3[0]
 except:
   host = type(remadd) +  :  + repr(remadd)

Hey, if no one told you before:
You are allowed to read what other people suggest you to do, think about it  
and so correct obvious typos: 'REMO*V*E_ADDR'

By the way, my i cite:
Am Donnerstag, 4. Juli 2013 14:52:59 UTC+2 schrieb Νίκος Gr33k:
 ...
 '108.162.229.97' is the result of:
 print( ascii(os.environ['REMOTE_ADDR']) )

Am Donnerstag, 4. Juli 2013 16:48 UTC+2 schrieb Νίκος Gr33k:
 For me, socket.gethostbyaddr('108.162.229.97') raises socket.herror,
 which is also a subclass of OSError from Python 3.3 onwards.
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 11:35 πμ, ο/η Dave Angel έγραψε:

On 07/05/2013 04:00 AM, Νίκος Gr33k wrote:

Στις 5/7/2013 10:50 πμ, ο/η Dave Angel έγραψε:


The line started as:

   host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]

refactor that to:
remadd = os.environ('REMOVE_ADDR')
tuple3 = socket.gethostbyaddr(remadd)
host = tuple3[0]

and see which one throws the exception.  Then once you have that,
examine the exact parameters that might be triggering the problem.  In
particular, figure out the exact types and values for remadd and tuple3.

print(type(remadd) +  :  + repr(remadd))


I'am not sure how iam supposed to write this: i just tried this:


try:
 remadd = os.environ('REMOVE_ADDR')
 tuple3 = socket.gethostbyaddr(remadd)
 host = tuple3[0]
except:
 host = type(remadd) +  :  + repr(remadd)


but iam getting an internal server error.

I didnt print it as you said but its the same thing host var gets
printed later on.

Now, why would this give an internal server error?



I have no idea what causes an internal server error.  It's up to you to
get the output of the expression to some location you can examine.
Easiest way is to run those 3 lines directly on the server, not in the
cgi environment.

But if you don't have any debugging tools, then STOP right now and build
some.  Use logging, or redirect print, or do something that the server
folks provide as debugging aids.  But just blindly guessing is
ludicrous.  So also is throwing out clues by using a bare except.

Assigning that string to host makes no sense at all.  And neither does
putting it in the except clause.  You want to get that string to YOUR
eyes, not to the server who might get an internal server error.


I don't think running it via 'cli' would help much, since its a 
cgi-script and ip addr function have no meaning calling them in plain 
our of a cgi environment but here it is:



Python 3.3.2 (default, Jun  3 2013, 16:18:05)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type help, copyright, credits or license for more information.
 import os
 remadd = os.environ('REMOVE_ADDR')
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: '_Environ' object is not callable



--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 11:27 πμ, ο/η Dave Angel έγραψε:


Or if the problems cannot be recreated outside the cgi environment, use
the log files you've been logging other problems into.  Or simply open a
text file for writing, and add a file= keyword parameter to the print
function call.

  print(repr(e), file=myfile)


Yes you are correct, problem need to be recreated within the cgi env.

try:
remadd = os.environ('REMOTE_ADDR')
tuple3 = socket.gethostbyaddr(remadd)
host = tuple3[0]
except Exception as e:
host = repr(e)


http://superhost.gr/?show=logpage=index.html shows explicitly the same 
kind of error that python interpreter via cli gave me the same error!


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Dave Angel

On 07/05/2013 04:49 AM, Νίκος Gr33k wrote:



 SNIP


I don't think running it via 'cli' would help much, since its a
cgi-script and ip addr function have no meaning calling them in plain
our of a cgi environment but here it is:



No idea how to parse have no meaning calling them in plain our of a cgi 
environment





Python 3.3.2 (default, Jun  3 2013, 16:18:05)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type help, copyright, credits or license for more information.
  import os
  remadd = os.environ('REMOVE_ADDR')
Traceback (most recent call last):
   File stdin, line 1, in module
TypeError: '_Environ' object is not callable

But there were two problems with the code you faithfully copied from my 
earlier post.  One was already pointed out by feedthetroll, that I 
accidentally changed REMOTE_ADDR to REMOVE_ADDR.


The other one is perhaps more subtle; I replaced square brackets with 
parentheses.


So try again with:

  import os
  remadd = os.environ['REMOTE_ADDR']

I get an error:

Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/local/lib/python3.3/os.py, line 669, in __getitem__
value = self._data[self.encodekey(key)]
KeyError: b'REMOTE_ADDR'


but presumably your machine actually has such an environment variable.

Isn't that mistake something  you could easily have caught?  Or were you 
just blindly pasting my bugs without understanding what I was trying to 
do with refactoring?


Anyway, I can't see any reason why the rest of the sequence shouldn't 
behave identically from a terminal as it does in CGI.



--
DaveA

--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 12:21 μμ, ο/η Dave Angel έγραψε:

On 07/05/2013 04:49 AM, Νίκος Gr33k wrote:



  SNIP


I don't think running it via 'cli' would help much, since its a
cgi-script and ip addr function have no meaning calling them in plain
our of a cgi environment but here it is:



No idea how to parse have no meaning calling them in plain our of a cgi
environment




Python 3.3.2 (default, Jun  3 2013, 16:18:05)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type help, copyright, credits or license for more information.
  import os
  remadd = os.environ('REMOVE_ADDR')
Traceback (most recent call last):
   File stdin, line 1, in module
TypeError: '_Environ' object is not callable


But there were two problems with the code you faithfully copied from my
earlier post.  One was already pointed out by feedthetroll, that I
accidentally changed REMOTE_ADDR to REMOVE_ADDR.

The other one is perhaps more subtle; I replaced square brackets with
parentheses.

So try again with:

   import os
   remadd = os.environ['REMOTE_ADDR']

I get an error:

Traceback (most recent call last):
   File stdin, line 1, in module
   File /usr/local/lib/python3.3/os.py, line 669, in __getitem__
 value = self._data[self.encodekey(key)]
KeyError: b'REMOTE_ADDR'


but presumably your machine actually has such an environment variable.

Isn't that mistake something  you could easily have caught?  Or were you
just blindly pasting my bugs without understanding what I was trying to
do with refactoring?

Anyway, I can't see any reason why the rest of the sequence shouldn't
behave identically from a terminal as it does in CGI.


Yes i didnt see your typo and i have corrected it:


try:
remadd = os.environ('REMOTE_ADDR')
tuple3 = socket.gethostbyaddr(remadd)
host = tuple3[0]
except Exception as e:
host = repr(e)


Ima still receiving the same kind of erro as i did with cli as well.

You can view the error in the very first line here:

http://superhost.gr/?show=logpage=index.html


which yields: TypeError('_Environ' object is not callable,)


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Lele Gaifax
Benjamin Kaplan benjamin.kap...@case.edu writes:

 FYI, your code above is (almost) exactly equivalent to the simpler

 They aren't equivalent. except Exception won't catch KeyboardInterrupt or
 SystemExit or a few others that you really don't want to catch in a generic
 error handler. You should almost never have a bare except.

I know, that's why I added (almost), I was just trying to explain why
he wasn't able to see the problem.

Thanks for pointing out the difference,
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Lele Gaifax
Νίκος Gr33k ni...@superhost.gr writes:

 You can view the error in the very first line here:

 http://superhost.gr/?show=logpage=index.html

No, visiting that page simply emit the standard Apache error page,
without details.


 which yields: TypeError('_Environ' object is not callable,)

Dave already told you the reason[1]. Νίκος, *read* **and** *understand*
our *whole* answers to your questions, otherwise we are wasting time,
you, and us!

ciao, lele.

[1] “… The other one is perhaps more subtle; I replaced square brackets
 with parentheses.”
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 12:25 μμ, ο/η Νίκος Gr33k έγραψε:


try:
 remadd = os.environ('REMOTE_ADDR')
 tuple3 = socket.gethostbyaddr(remadd)
 host = tuple3[0]
except Exception as e:
 host = repr(e)



which yields: TypeError('_Environ' object is not callable,)


Any thoufgs as to why os.environ('REMOTE_ADDR') gives the above error?

I noticed that if i remove my domain from cloudflare the gethostbyaddr 
as it uses too months now.

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 1:24 μμ, ο/η Lele Gaifax έγραψε:

Νίκος Gr33k ni...@superhost.gr writes:


You can view the error in the very first line here:

http://superhost.gr/?show=logpage=index.html


No, visiting that page simply emit the standard Apache error page,
without details.



which yields: TypeError('_Environ' object is not callable,)


Dave already told you the reason[1]. Νίκος, *read* **and** *understand*
our *whole* answers to your questions, otherwise we are wasting time,
you, and us!

ciao, lele.

[1] “… The other one is perhaps more subtle; I replaced square brackets
  with parentheses.”



I read carefully all of tour answer please try to load again:

http://superhost.gr/?show=logpage=index.html

Di i miss an explanation on this?

TypeError('_Environ' object is not callable,)

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 12:21 μμ, ο/η Dave Angel έγραψε:

Traceback (most recent call last):
   File stdin, line 1, in module
   File /usr/local/lib/python3.3/os.py, line 669, in __getitem__
 value = self._data[self.encodekey(key)]
KeyError: b'REMOTE_ADDR



Wait!
Are you saying that the ip address is being returned as a byte string 
which then i have to decode with something like:


host = socket.gethostbyaddr( os.environ['REMOTE_HOST'].decode('utf-8') )[0]

?

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Lele Gaifax
Νίκος Gr33k ni...@superhost.gr writes:

 Στις 5/7/2013 12:25 μμ, ο/η Νίκος Gr33k έγραψε:

 try:
  remadd = os.environ('REMOTE_ADDR')
  tuple3 = socket.gethostbyaddr(remadd)
  host = tuple3[0]
 except Exception as e:
  host = repr(e)

 which yields: TypeError('_Environ' object is not callable,)

 Any thoufgs as to why os.environ('REMOTE_ADDR') gives the above error?

Yes, I'd try to understand the error message, and eventually lookup the
documentation on os.environ to see what type of object it is bound
to. The solution should be easy.

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 1:36 μμ, ο/η Lele Gaifax έγραψε:

Νίκος Gr33k ni...@superhost.gr writes:


Στις 5/7/2013 12:25 μμ, ο/η Νίκος Gr33k έγραψε:


try:
  remadd = os.environ('REMOTE_ADDR')
  tuple3 = socket.gethostbyaddr(remadd)
  host = tuple3[0]
except Exception as e:
  host = repr(e)



which yields: TypeError('_Environ' object is not callable,)


Any thoufgs as to why os.environ('REMOTE_ADDR') gives the above error?


Yes, I'd try to understand the error message, and eventually lookup the
documentation on os.environ to see what type of object it is bound
to. The solution should be easy.


Looks now when i print( repr(e)) i get

UnicodeDecodeError('utf-8', b'\xb6\xe3\xed\xf9\xf3

but what string does it try to decode and jeeps failing?


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Lele Gaifax
Νίκος Gr33k ni...@superhost.gr writes:

 Looks now when i print( repr(e)) i get

 UnicodeDecodeError('utf-8', b'\xb6\xe3\xed\xf9\xf3

 but what string does it try to decode and jeeps failing?

Reasonably it's the second one, as the first clearly seems the tag of
the decoder that tried to translate it to Unicode.

As already explained, your immediate goal should be trying to understand
from *where* that byte string is coming. I can't help on that, sorry.

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 1:59 μμ, ο/η Lele Gaifax έγραψε:

Νίκος Gr33k ni...@superhost.gr writes:


Looks now when i print( repr(e)) i get

UnicodeDecodeError('utf-8', b'\xb6\xe3\xed\xf9\xf3

but what string does it try to decode and jeeps failing?


Reasonably it's the second one, as the first clearly seems the tag of
the decoder that tried to translate it to Unicode.


2nd one of what? 2nd byte in order?
Can ou show me form which characters does this string consist of so we 
migth have an idea of where its coming from if we know what it looks like?



As already explained, your immediate goal should be trying to understand
from *where* that byte string is coming. I can't help on that, sorry.


Thats what i'm trying to do.
If i completely remove the gethostbyaddr fucntion adds function then 
there is nor problem.


The problem is recreating when the script tries to decode a hostname.

For some bizarre reason if i exclude my domain from CloudFlare then the 
reverse DNS resolution of the visitors hostname would be returned properly.


I will do it right now for you to see.
--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Lele Gaifax
Νίκος Gr33k ni...@superhost.gr writes:

 Στις 5/7/2013 1:59 μμ, ο/η Lele Gaifax έγραψε:
 Νίκος Gr33k ni...@superhost.gr writes:

 UnicodeDecodeError('utf-8', b'\xb6\xe3\xed\xf9\xf3

 but what string does it try to decode and jeeps failing?

 Reasonably it's the second one, as the first clearly seems the tag of
 the decoder that tried to translate it to Unicode.

 2nd one of what? 2nd byte in order?

You asked “what string” (although you probably meant “which string”):

UnicodeDecodeError('utf-8', b'\xb6\xe3\xed\xf9\xf3

first string---^^^
second string---^^

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 2:05 μμ, ο/η Νίκος Gr33k έγραψε:

Thats what i'm trying to do.
If i completely remove the gethostbyaddr fucntion adds function then
there is nor problem.

The problem is recreating when the script tries to decode a hostname.

For some bizarre reason if i exclude my domain from CloudFlare then the
reverse DNS resolution of the visitors hostname would be returned properly.

I will do it right now for you to see.



Precisely as i have said it would happen:

I removed the domain form CloudFlare and your domains visting my website 
appearing as usual.


Its only when i cloudflare it and the UnicodeError happens.

But why?!?! I see no reason as to why when my domain becomes Cloudflared 
the gethostbyaddr() fails.


What kind of weird strings does it return back?


--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread Νίκος Gr33k

Στις 5/7/2013 2:16 μμ, ο/η Lele Gaifax έγραψε:

UnicodeDecodeError('utf-8', b'\xb6\xe3\xed\xf9\xf3

first string---^^^
second string---^^



Hold on please!

From where do these dashes and carets characters come from?
Also from where do you see 2 strings?

Looking at that: UnicodeDecodeError('utf-8', b'\xb6\xe3\xed\xf9\xf3

ic an understandn onlt that utf-8 has failsed decoding some byte stream 
satrting with \xb6


I totally not follow...
--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread feedthetroll
Am Freitag, 5. Juli 2013 12:33:05 UTC+2 schrieb Νίκος Gr33k:
 ...
 Wait!
 Are you saying that the ip address is being returned as a byte string 
 which then i have to decode with something like:
 
 host = socket.gethostbyaddr( os.environ['REMOTE_HOST'].decode('utf-8') )[0]

Wait!
I get a decode error when python tries to automatically decode a bytestring 
assuming it to be utf-8 encoded.
I am sure the error will disappear, when I try to decode it explicit using 
utf-8. Heureka! I got it!

Or in other words:
If a big stone falls on my foot accidently it hurts.
But I am sure it will not hurt, if take that same stone and throw it on my foot.
Heureka! I got it!

P.S.:

Am 14.06.2013 10:35, schrieb Fábio Santos:
 Also you have been shown this link and I feel you really need to read it.
 http://slash7.com/2006/12/22/vampires/
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread feedthetroll
Am Freitag, 5. Juli 2013 13:27:25 UTC+2 schrieb Νίκος Gr33k:
 Στις 5/7/2013 2:16 μμ, ο/η Lele Gaifax έγραψε:
 UnicodeDecodeError('utf-8', b'\xb6\xe3\xed\xf9\xf3
 first string---^^^
 second string---^^
 
 Hold on please!
  From where do these dashes and carets characters come from?

ROTFL
Nikos, you made my day, again! Fun is back in these threads!

 
 Also from where do you see 2 strings?

Look, my little dumb baby: The dashes and carets point to the strings.
The first one being 'utf-8', the second one starting with '\xb6\xe3\xed' (being 
a bytestring, therefore the b before the ')
Sorry, I forgot. You are not using python for your business, therefore you 
can't know, that strings in python can for example be identified by surrounding 
'.

 ic an understandn onlt that utf-8 has failsed decoding some byte stream 
 satrting with \xb6
So ... where did you call utf-8() so that it could try to decode something?
-- 
http://mail.python.org/mailman/listinfo/python-list


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

2013-07-05 Thread feedthetroll
Am Freitag, 5. Juli 2013 12:33:05 UTC+2 schrieb Νίκος Gr33k:
 ...
 Wait!
 Are you saying that the ip address is being returned as a byte string 
 which then i have to decode with something like:
 
 host = socket.gethostbyaddr( os.environ['REMOTE_HOST'].decode('utf-8') )[0]

Wait!
I get a decode error when python tries to automatically decode a bytestring
assuming it to be utf-8 encoded.
I am sure the error will disappear, when I try to decode it explicit using
utf-8. Heureka! I got it!

Or in other words:
If a big stone falls on my foot accidently, it hurts.
--^
But I am sure it will not hurt, if take that same stone and throw it on my foot.

Heureka! I got it!



P.S.:

Am 14.06.2013 10:35, schrieb Fábio Santos:
 Also you have been shown this link and I feel you really need to read it.
 http://slash7.com/2006/12/22/vampires/
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   >