[issue13688] ast.literal_eval fails on octal numbers

2011-12-31 Thread Sergey Dorofeev

New submission from Sergey Dorofeev fido...@users.sourceforge.net:

Python 3.2.2 (default, Nov 16 2011, 10:58:44) [C] on sunos5
Type help, copyright, credits or license for more information.
 import ast
 ast.literal_eval('10')
10
 ast.literal_eval('0x10')
16
 ast.literal_eval('010')
Traceback (most recent call last):
  File stdin, line 1, in module
  File /opt/python322/lib/python3.2/ast.py, line 48, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
  File /opt/python322/lib/python3.2/ast.py, line 36, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
  File unknown, line 1
010
  ^
SyntaxError: invalid token

--
components: Library (Lib)
messages: 150414
nosy: fidoman
priority: normal
severity: normal
status: open
title: ast.literal_eval fails on octal numbers
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13688
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13688] ast.literal_eval fails on octal numbers

2011-12-31 Thread Sergey Dorofeev

Sergey Dorofeev fido...@users.sourceforge.net added the comment:

python 3 feature - should use 0o10
need to rebuild data file :(

--
resolution:  - rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13688
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13677] correct docstring for builtin compile

2011-12-31 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13677
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13663] pootle.python.org is outdated.

2011-12-31 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo
versions:  -Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13663
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13663] pootle.python.org is outdated.

2011-12-31 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Agreed with Martin.  I would be nice to get a statement on the status of 
pootle.python.org (social aspects like updating and publishing the translations 
+ organization of teams), but Georg seems busy.

(This would probably be more at home on a mailing list rather than in the 
CPython bug tracker.)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13663
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13663] pootle.python.org is outdated.

2011-12-31 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

I've never really had a hand in pootle.python.org; it was set up by Martin and 
Robert Lehmann, and Sandro Tosi also wanted to lend a hand...

--
nosy: +lehmannro, sandro.tosi

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13663
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13663] pootle.python.org is outdated.

2011-12-31 Thread Sandro Tosi

Sandro Tosi sandro.t...@gmail.com added the comment:

Yeah, I really would like to help with pootle, but it seems we don't have a 
current status of the thing + a roadmap to where we want to go.

From the top of my head, I think we need at least:

- the current setup of the machine/service
- updated packages for pootle + its deps (it should be a debian machine, so I 
can leverage my DD status to help here)
- plan the migration from the current pootle to the updated one
- start advertise pootle, which is much better than having a lot of people 
translating python doc on their own websites instead of a central (official) 
place
- maybe rename the service?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13663
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13609] Add os.get_terminal_size() function

2011-12-31 Thread Zbyszek Szmek

Zbyszek Szmek zbys...@in.waw.pl added the comment:

Thanks for the review!

New version is attached. The code is actually slightly shorter, but
there are more docs.

 Doc/library/os.rst|   52 +++
 Doc/whatsnew/3.3.rst  |5 +
 Lib/os.py |   43 +++
 Lib/test/test_termsize.py |   31 +++
 Misc/NEWS |3 +
 Modules/posixmodule.c |  125 ++
 configure |2 
 configure.in  |2 
 pyconfig.h.in |3 +
 9 files changed, 264 insertions(+), 2 deletions(-)

The patch also lacks some documentation update in Doc/library/os.rst.
Added as a subsection under File Descriptor Operations section.
I also added an entry to Misc/NEWS and Doc/whatsnew/3.3.rst.

 Lib/os.py:833: def get_terminal_size(columns=80, rows=25):
 The arguments seem ignored in the function body, so I think they should simply
 be removed.
The implementation was borked and didn't actually do what the
docstring said. It should be fixed now.

I want to retain the default values, because get_terminal_size()
should do the right thing in case stdout is not a terminal,
without the user needing to wrap it in a try..except block
or some other test. Putting the default values as parameters
makes it clear what will be returned in case query fails, and
makes it easy to override those defaults.

To make it clearer that those are the fallback values, I renamed the
parameter to 'fallback=(c, r)', which should be understandable even
without reading the docstring. Having it as a single parameter might
also make it easier to add something like 'minimum=(c, r)' in the
future.

 I wonder if you shouldn't try to explicitly pass sys.stdout.fileno() here, or
 perhaps sys.__stdout__.fileno() since the former could be overriden.
OK, changed to sys.__stdout__.fileno().

I think that sys.__stdout__ is better, because when stdout is overridden,
it is usually with something that is not a terminal. Changing the output
terminal is probably pretty rare.

 Actually, perhaps get_terminal_size() should have an optional file descriptor
 argument.
Querying anything other than stdout should be pretty rare. If
necessary, query_terminal_size() can be called explicitly. Also,
the variables $COLUMNS and $ROWS are usually meant to refer to stdout,
so get_terminal_size() is about stdout and ROWS and COLUMNS, and the
other function allows full control.

 Lib/test/test_termsize.py:1: import unittest
 This file seems to lack an ``if __name__ == '__main__'`` like other test files
OK.

 Besides, why not simply put the tests in test_os.py?
The tests were nicely self-contained. I wanted to be able to do:
  ./python Lib/test/test_termsize.py
and
  ./python Lib/test/test_termsize.py | cat
but I guess it can be easily moved to test_os.py if necessary.

 Lib/test/test_termsize.py:7: def set_environ(**variables):
 There's already EnvironmentVarGuard in test.support.
OK.

 Lib/test/test_termsize.py:7: def set_environ(**variables):
 There's already EnvironmentVarGuard in test.support.
 Lib/test/test_termsize.py:25: self.assertTrue(0  size.columns)
 Better to use assertGreater here, failure messages will be more informative.
 Lib/test/test_termsize.py:33: self.assertTrue(size.columns == 777)
 And better to use assertEqual here.
OK.

 Typo here (imlmented).
OK.

 Modules/posixmodule.c:10571: return PyErr_Format(PyExc_ValueError)
 I don't think there's any point in changing the error here. Just let
 a normal OSError be raised.
OK, s/ValueError/OSError/ here and the the windows case below too.

 Modules/posixmodule.c:10573: return PyErr_SetFromErrno(PyExc_IOError);
 For the record, in 3.3, PyExc_IOError is an alias of PyExc_OSError.
OK, s/IOError/OSError/ for clarity.

 Modules/posixmodule.c:10599: return PyErr_Format(PyExc_IOError, error %i,
 (int) GetLastError());
 Just use PyErr_SetFromWindowsErr(GetLastError()).
OK.

 Modules/posixmodule.c:11086: {query_terminal_size, query_terminal_size,
 METH_VARARGS, termsize__doc__},
 I don't think there's any point in making this helper function public, so I'd
 rename it _query_terminal_size or something.
The idea is that query_terminal_size() can be used to do the
low-level query ignoring $COLUMNS and $ROWS and returing the real
error if something goes wrong. If is documented, so I think that
it can be public.

I've also improved the docstrings slightly.

--
Added file: http://bugs.python.org/file24117/termsize.diff.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13609
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13663] pootle.python.org is outdated.

2011-12-31 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

naoki: what is your actual complaint about the installation being outdated? Are 
you referring to the message catalog (documentation version), or the software?

As for the message catalog, I don't think it should be updated too often (only 
once per Python release), otherwise, translators will have to fight a moving 
target (which they will have to, anyway, given that the documentation evolves).

Whatever updating procedure is performed: preserving the existing translations 
and the existing accounts is an absolute must.

I'm not sure what good renaming the service would do; this sounds like bike 
shedding.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13663
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13688] ast.literal_eval fails on octal numbers

2011-12-31 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
resolution: rejected - invalid

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13688
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13689] fix CGI Web Applications with Python link in howto/urllib2

2011-12-31 Thread Sandro Tosi

New submission from Sandro Tosi sandro.t...@gmail.com:

Hi,
as discussed on irc, howto/urllib2 refers to CGI Web Applications with Python, 
Part One on 
http://www.pyzine.com/Issue008/Section_Articles/article_CGIOne.html which is no 
more accessible.

Given part two of that document is on Michael's website 
(http://www.voidspace.org.uk/python/articles/cgi_web_applications_two.shtml), 
maybe Michael could move Part One too so we can fix the broken link.

--
assignee: michael.foord
components: Documentation
messages: 150421
nosy: michael.foord, sandro.tosi
priority: normal
severity: normal
status: open
title: fix CGI Web Applications with Python link in howto/urllib2
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13689
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13663] pootle.python.org is outdated.

2011-12-31 Thread INADA Naoki

INADA Naoki songofaca...@gmail.com added the comment:

On Sat, Dec 31, 2011 at 11:31 PM, Martin v. Löwis
rep...@bugs.python.org wrote:

 Martin v. Löwis mar...@v.loewis.de added the comment:

 naoki: what is your actual complaint about the installation being outdated? 
 Are you referring to the message catalog (documentation version), or the 
 software?

I need Python 3.2's message catalog. But updating pootle version is
also nice to me.

 As for the message catalog, I don't think it should be updated too often 
 (only once per Python release), otherwise, translators will have to fight a 
 moving target (which they will have to, anyway, given that the documentation 
 evolves).


I agree with you about already released series (~3.2).
I think updating message catalog for beta versions may help releasing new
Python's translated document fast.

The way to manage multiple series is also needed when Python 3.3 is released.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13663
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13690] Add DEBUG flag to documentation of re.compile

2011-12-31 Thread Filip Gruszczyński

New submission from Filip Gruszczyński grusz...@gmail.com:

This is a useful flag and it would be good, if it was in documentation.

--
messages: 150423
nosy: gruszczy
priority: normal
severity: normal
status: open
title: Add DEBUG flag to documentation of re.compile

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13690
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13690] Add DEBUG flag to documentation of re.compile

2011-12-31 Thread Filip Gruszczyński

Changes by Filip Gruszczyński grusz...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file24118/13690.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13690
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13676] sqlite3: Zero byte truncates string contents

2011-12-31 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13676
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13659] Add a help() viewer for IDLE's Shell.

2011-12-31 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

I would like that to be a help() option, such as help(module, -b) or more 
verbosely, help(module, browser=True). This would be useful for the regular 
interactive interpreter as well.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13659
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13641] decoding functions in the base64 module could accept unicode strings

2011-12-31 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
keywords: +patch
nosy: +berkerpeksag
Added file: http://bugs.python.org/file24119/issue13641_v1.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13641
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12930] reindent.py inserts spaces in multiline literals

2011-12-31 Thread Jonathan Rogers

Jonathan Rogers jonathanrrog...@gmail.com added the comment:

I don't think reindent.py should change any bytes inside string literals since 
it can't know anything about what those strings mean or how they'll be used by 
the program at run time. Unfortunately, it starts out by unconditionally 
calling the .expandtabs() method on each input line, so tab characters are 
lost. The only change to a string literal I can imagine that would be safe is 
to replace tab characters with '\t'.

I am trying to use reindent.py on Python source files which include 
triple-quoted, multi-line string literals containing makefile and Python 
snippets. In both cases, running reindent.py changes the meaning of of that 
contained in the literal.

--
nosy: +Jonathan.Rogers

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12930
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12930] reindent.py inserts spaces in multiline literals

2011-12-31 Thread Jonathan Rogers

Jonathan Rogers jonathanrrog...@gmail.com added the comment:

Rather than expanding tab characters inside string literals, it's safer to 
replace them with '\t'.

--
Added file: http://bugs.python.org/file24120/save_strings.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12930
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com