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


Groups > comp.lang.python > #46264

Re: Python error codes and messages location

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <fabiosantosart@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'programmer': 0.03; 'subject:error': 0.03; 'interpreter': 0.05; 'subject:Python': 0.06; 'developer.': 0.07; 'english,': 0.09; 'exception,': 0.09; 'exception.': 0.09; 'runtime': 0.09; 'subject:messages': 0.09; 'worse': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'bug': 0.12; 'language.': 0.14; 'random': 0.14; '&gt;&gt;': 0.16; '-&gt;': 0.16; 'barrier': 0.16; 'java.': 0.16; 'name).': 0.16; 'repr()': 0.16; 'skip:l 110': 0.16; 'str()': 0.16; 'unchanged': 0.16; 'exception': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'module': 0.19; 'implementing': 0.19; 'stack': 0.19; 'user.': 0.19; 'written': 0.21; '(the': 0.22; 'example': 0.22; 'email addr:gmail.com&gt;': 0.22; 'python?': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'recognize': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '&gt;': 0.26; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'array': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; '(which': 0.31; 'code': 0.31; 'that.': 0.31; '(maybe': 0.31; 'exceptions': 0.31; "user's": 0.31; 'this.': 0.32; 'everyone': 0.33; 'core': 0.34; 'could': 0.34; 'received:209.85': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'add': 0.35; 'really': 0.36; 'opposed': 0.36; 'shorter': 0.36; 'entry': 0.36; 'shows': 0.36; 'error.': 0.37; 'list': 0.37; 'received:209': 0.37; 'pm,': 0.38; 'skip:& 20': 0.39; 'sure': 0.39; 'mailing': 0.39; 'major': 0.40; 'even': 0.60; 'hope': 0.61; 'new': 0.61; 'show': 0.63; 'name': 0.63; 'different': 0.65; 'to:addr:gmail.com': 0.65; 'user,': 0.69; 'directed': 0.83; 'localized': 0.84; 'subject:location': 0.84; 'try.': 0.91; 'deal,': 0.93; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RHt7rTjLpUW2rzwY2+r2axV+7ww89rA2rpgGWZ0xhTs=; b=mUNx0e7cT4VgCK+m4HCpZ3NvnG5THgPjUTYKwBAzZdBcpFWgklKS31QJAufg7Waf3n PWaRJTrgWvyoTt40pPybfD+YulxwHRMZVZMi5WwatVfqU+Ai43bNG1CKaaa3Eq+fdQS3 YrZpu5ablJKHxXQvNUCzdtYwKnxbHxOEucqSTPIWjEVmK+xR02j5NdJhR2RnUwb4LDns yz9IlYbA+hAKnYWjMOQVbKrbRlWBPIU8T6bwkiuzKQggyEXlmF571ewh7Nthl6nSjQ41 G0eElFrmOebNdebR2CbzREY/TtFW7Mp3j91C5/ea4IsarWsstNLjU279UBH1VNkELU9B 6Hyg==
MIME-Version 1.0
X-Received by 10.224.61.1 with SMTP id r1mr30683578qah.93.1369728651756; Tue, 28 May 2013 01:10:51 -0700 (PDT)
In-Reply-To <CAPTjJmpeq1Wq8-+11eiwZjwnYApHubMeNSBRW3yynFyWNQw87w@mail.gmail.com>
References <BLU176-W2F86295ACD2E1CD29375BD7960@phx.gbl> <20130527061154.GA3301@cskk.homeip.net> <knvggn$sjn$1@ger.gmane.org> <CAA=1kxTjywHHbUeRbpJS86vh5r0toAhvMghLNLh+xbsYzYu9Sg@mail.gmail.com> <ko083m$udv$1@ger.gmane.org> <CAA=1kxT7AAMJcm9hokgtisFSjMi_5v=w+zesh-i2VgaYFochKg@mail.gmail.com> <CAA=1kxTucYUr0++Y10y3npj2MSnLtQ6MvAsaS3SkqF4U3Bbnpw@mail.gmail.com> <ko1asv$tgg$1@ger.gmane.org> <CAA=1kxSmg3r=wL3acL0fFD8E+G1OzPWYySdLco25Ex91oLkfPQ@mail.gmail.com> <CAPTjJmpeq1Wq8-+11eiwZjwnYApHubMeNSBRW3yynFyWNQw87w@mail.gmail.com>
Date Tue, 28 May 2013 09:10:51 +0100
Subject Re: Python error codes and messages location
From Fábio Santos <fabiosantosart@gmail.com>
To Chris Angelico <rosuav@gmail.com>
Content-Type multipart/alternative; boundary=001a11c3f4d4ba24ae04ddc2cdf6
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2287.1369728660.3114.python-list@python.org> (permalink)
Lines 118
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1369728660 news.xs4all.nl 15982 [2001:888:2000:d::a6]:39978
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:46264

Show key headers only | View raw


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

On 28 May 2013 08:19, "Chris Angelico" <rosuav@gmail.com> wrote:
>
> On Tue, May 28, 2013 at 4:57 PM, Fábio Santos <fabiosantosart@gmail.com>
wrote:
> >
> > On 28 May 2013 05:17, "Vito De Tullio" <vito.detullio@gmail.com> wrote:
> >> I really hope really far... have you never tried to google a localized
> >> error
> >> message? :\
> >
> > Never. I don't even try.
>
> Same happens when someone pastes an error onto a mailing list like
> this. Unless there's some easily-identifiable token (maybe the
> exception type doesn't get localized, though that has its own
> consequences) by which everyone world-over can recognize the
> exception, this would be a major nuisance.

Just to clarify, I am suggesting to have the unchanged messages in
tracebacks, but having some methods in the exception to get the exception
and message localised. Just like repr() and str() are directed at different
audiences (the programmer vs. The user), so is a traceback vs a message box.

In English, we could "translate" the exception name (which is limited as a
python name). EG. RuntimeError -> Runtime error. Of course, this is not a
big deal, but it would let us show the error message to the user, together
with the exception.

It would be much harder to search for an error or ask for help if it was a
message written by some random developer.

OpenERP for example shows stack traces to the user. It could show a shorter
message in the user's language.

> Also, once the interpreter
> core and a few parts of the stdlib get localized, this would add a
> barrier to entry for new modules... not sure this is a good thing.

I think that would be a job for a per-language team as opposed to someone
implementing a bug fix or pushing a PEP? Even that would only be necessary
for the exceptions a module raises.

> Can we internationalize English instead of localizing Python?
>

That is worse than saying, "why don't we all just code in python?". Or c.
Or java. Or JavaScript.

Let's not get into that. I prefer len() to new
LengthCalculatorFactoryBuilder().createLengthCalculatorFactory().createLengthCalculator().calculateLengthOf().
And a good old Python list or JavaScript array to a collection of segfaults.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python error codes and messages location Fábio Santos <fabiosantosart@gmail.com> - 2013-05-28 09:10 +0100

csiph-web