[issue11450] Py_GetBuildInfo() truncates when there are many hg tags

2011-03-09 Thread Scott Dial

New submission from Scott Dial sc...@scottdial.com:

I'm not sure if it's intended to be a supported workflow, but I personally have 
come to like using mq for projects where I am an outsider submitting small 
changes as patches. However, this appears to be a broken workflow due to way 
getbuildinfo module choose to limit the buildinfo string to 50 characters:

$ hg qnew dummy-patch
$ echo /* dummy change */  Modules/getbuildinfo.c
$ ./python -c 'import sys; print(sys.version)' 
3.3a0 (dummy-patch qbase qtip tip:191f047a07b4+, Mar  9 ) 
[GCC 4.4.5]

This breaks the platform module and therefore breaks the regrtest code, which 
makes it a show-stopper for using mq to manage your workflow. Is there any 
reason that length of buildinfo can't be chosen at compile-time based on the 
sizeof(HGTAG)?

--
components: Build
messages: 130432
nosy: scott.dial
priority: normal
severity: normal
status: open
title: Py_GetBuildInfo() truncates when there are many hg tags
type: feature request

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



[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2011-03-09 Thread Johannes Schönberger

Johannes Schönberger johannes.schoenber...@tum.de added the comment:

sorry, I totally forgot about this...

--

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



[issue11441] compile() raises SystemError if called from except clause

2011-03-09 Thread July Tikhonov

July Tikhonov july.t...@gmail.com added the comment:

There is an XXX just before the definition of ast_error. Wouldn't it be
useful?

The idea is to merge ast_error() and ast_error_finish().
This requires redefinition of most functions in ast.c, adding const char
*filename to their parameters.

--
Added file: http://bugs.python.org/file21061/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11441
___There is an XXX just before the definition of ast_error. Wouldn#39;t it be 
useful?divbr/divdivThe idea is to merge ast_error() and 
ast_error_finish().br clear=allThis requires redefinition of most functions 
in ast.c, adding quot;const char *filenamequot; to their parameters./div

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



[issue11435] Links to source code should now point to hg repo

2011-03-09 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

The svn repos and viewvc won't disappear soon because they are used for other 
things (e.g. the tracker).  I think it's better to avoid redirects until svn 
and/or viewvc are definitely gone.

--

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



[issue11441] compile() raises SystemError if called from except clause

2011-03-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

 That's why I thought that calling PyErr_NormalizeException with the new
 tuple is the simplest thing to do, becuase I guess that'll take care of
 all fields automatically.

You could also call PyErr_NormalizeException at the beginning, and update the 
fields directly in the PySyntaxErrorObject structure.  No need to deal with any 
tuple.

--

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



[issue11449] tarfile tries to file_.tell() even when creating a new archive

2011-03-09 Thread Lars Gustäbel

Lars Gustäbel l...@gustaebel.de added the comment:

If I understand correctly, the solution to your problem would be to use the 
stream mode w| instead of w. Could you please try that?

--
assignee:  - lars.gustaebel

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



[issue10969] Make Tcl recommendation more prominent

2011-03-09 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

I've added a more prominent warning to the 3.2 download page 
(http://python.org/download/releases/3.2/) along the lines suggested by Raymond 
(although I wasn't able to get it formatted as a separate line without causing 
other spacing to change):

* Mac OS X 64-bit/32-bit Installer (3.2) for Mac OS X 10.6 [2] (sig). [You may 
need an updated Tcl/Tk install to run IDLE or use Tkinter, see note 2 for 
instructions.]

I also updated the 2.7.1 download page 
(http://python.org/download/releases/2.7.1/) with the applicable warning there:

* Mac OS X 64-bit/32-bit x86-64/i386 Installer (2.7.1) for Mac OS X 10.6 [2] 
(sig). [You may not be able to run IDLE or use Tkinter with this installer, see 
note 2 for instructions.]

The OS X Tcl/Tk web page (http://python.org/download/mac/tcltk) has also been 
substantially expanded and now includes a very prominent Important summary at 
the top of the page.

Thanks for the suggestions.  I think the issue can now be closed.

--
nosy: +benjamin.peterson
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue5622] wrong error from curses.wrapper if curses initialization fails

2011-03-09 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset c731e02472c5 by Ned Deily in branch '2.7':
Issue #5622: Fix curses.wrapper to raise correct exception if curses
http://hg.python.org/cpython/rev/c731e02472c5

--
nosy: +python-dev

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



[issue11406] There is no os.listdir() equivalent returning generator instead of list

2011-03-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Can't we simply add os.xlistdir() leaving listdir() as is?

We could, but someone must:
1) provide a patch
2) demonstrate a significant improvement in some real-world situation

--

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



[issue11435] Links to source code should now point to hg repo

2011-03-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 The svn repos and viewvc won't disappear soon because they are used
 for other things (e.g. the tracker).  I think it's better to avoid
 redirects until svn and/or viewvc are definitely gone.

The redirect is only for the py3k branch, something nobody should use
anymore.

--

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



[issue1271] Raw string parsing fails with backslash as last character

2011-03-09 Thread Graham Wideman

Graham Wideman initcont...@grahamwideman.com added the comment:

(Not clear how to reopen this issue. Hopefully my change here does that.)

OK, so as it currently stands, backslash at end of string is prohibited in the 
interests of allowing backslash to escape quotes that might be embedded within 
the string. 

But the embedded quote scenario doesn't work because the backslash remains in 
the string.  So the current state of play is plain broken.  

Considering:
(a) We already have the ability to use either single or double quotes around 
the string which gives that chance to use the other quote within the string. 
(b) The principle of least surprise for raw string would be to have raw mean 
Never Escape Anything
(c) backslash on end of string is a trap waiting to happen for Windows users.
...I think there is strong motivation to abandon the currently broken 
backslash escapes quote behavior and just let raw strings be totally raw.  
Furthermore, it's hard to imagine that such a move would break anything.

--
nosy: +gwideman
type:  - behavior
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 -Python 
2.4

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



[issue11450] Py_GetBuildInfo() truncates when there are many hg tags

2011-03-09 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +georg.brandl
stage:  - needs patch
type: feature request - behavior
versions: +Python 3.3

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



[issue11451] Raw string parsing fails with backslash as last character

2011-03-09 Thread Graham Wideman

New submission from Graham Wideman initcont...@grahamwideman.com:

This is a copy of issue 1271 because I couldn't find a way to reopen it.

So, repeating my comment here:

As it currently stands, backslash at end of string is prohibited, apparently in 
the interests of supposedly allowing backslash to escape quotes that might be 
embedded within the string. 

But the supposedly beneficial backslash-escaping-embedded quote behavior is 
broken because the backslash remains in the string.

Consider:
(a) We already have the ability to use either single or double quotes around 
the string which gives that chance to use the other quote within the string. 
(b) The principle of least surprise for raw string would be to have raw mean 
Never Escape Anything
(c) backslash on end of string is currently a trap waiting to happen for 
Windows paths.
So I think there is strong motivation to abandon the currently broken 
backslash escapes quote behavior and just let raw strings be totally raw.  
Furthermore, it's hard to imagine that such a move would break anything.  
(Famous last words, I know... but I challenge anyone to contrive such a 
scenario!)

--
components: Interpreter Core
messages: 130443
nosy: QuantumTim, facundobatista, georg.brandl, gwideman
priority: normal
severity: normal
status: open
title: Raw string parsing fails with backslash as last character
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue5622] wrong error from curses.wrapper if curses initialization fails

2011-03-09 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 6b6b8af33811 by Ned Deily in branch '3.1':
Issue #5622: Fix curses.wrapper to raise correct exception if curses
http://hg.python.org/cpython/rev/6b6b8af33811

New changeset e6c45cd46cb2 by Ned Deily in branch '3.2':
Issue #5622: merge fix from 3.1.
http://hg.python.org/cpython/rev/e6c45cd46cb2

New changeset ec717db610df by Ned Deily in branch 'default':
Issue #5622: merge fix from 3.2.
http://hg.python.org/cpython/rev/ec717db610df

--

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



[issue1271] Raw string parsing fails with backslash as last character

2011-03-09 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
status: closed - open

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



[issue11451] Raw string parsing fails with backslash as last character

2011-03-09 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

I reopened #1271, please continue the discussion there.

--
nosy: +ezio.melotti
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - Raw string parsing fails with backslash as last character

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



[issue5622] wrong error from curses.wrapper if curses initialization fails

2011-03-09 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
assignee:  - ned.deily
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue11450] Py_GetBuildInfo() truncates when there are many hg tags

2011-03-09 Thread SilentGhost

Changes by SilentGhost ghost@gmail.com:


--
nosy: +SilentGhost

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



[issue11441] compile() raises SystemError if called from except clause

2011-03-09 Thread July Tikhonov

Changes by July Tikhonov july.t...@gmail.com:


Removed file: http://bugs.python.org/file21061/unnamed

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



[issue11450] Py_GetBuildInfo() truncates when there are many hg tags

2011-03-09 Thread Nadeem Vawda

Nadeem Vawda nadeem.va...@gmail.com added the comment:

I don't seem to be able to reproduce the failure in test_platform. 
Nevertheless, the behaviour is broken. Here's a patch that should fix it 
without allocating too much extra space.

--
keywords: +patch
nosy: +nvawda
Added file: http://bugs.python.org/file21062/issue11450.diff

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



[issue11450] Py_GetBuildInfo() truncates when there are many hg tags

2011-03-09 Thread Nadeem Vawda

Nadeem Vawda nadeem.va...@gmail.com added the comment:

Ah, now I see - the code that fails isn't test_platform, it's the regrtest code 
that prints out the version info at the beginning of the test results. This 
doesn't get displayed when you explicitly tell regrtest what tests to run 
(./python [...] -m test test_platform), which is why I didn't see it at first.

--

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



[issue6490] os.popen documentation in 2.6 is probably wrong

2011-03-09 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

STINNER Victor wrote:
 
 STINNER Victor victor.stin...@haypocalc.com added the comment:
 
 r55334 removed popen2, popen3 and popen4 from the os module from Python 3 
 (before the 3.0 release), but not os.popen.
 
 Python 3.2 has now convenience functions in subprocess to get the output of a 
 program:
 
 - check_output()
 - getstatusoutput()
 - getoutput()
 
 They have a better API then os.popen because you can:
 
  - avoid the shell process and use a list of arguments (to avoid ugly shell 
 quoting using ' or )
  - change the current directory
  - decide if signal are restored or not
  - get easily the exit code (not  8 magical operation on the close() output)
  - use a different executable name
  - pass file descriptor
  - etc.

Right, but not all applications need all those features and
os.popen() has a nice, simple and well-known interface.

Since os.popen() is already implemented using subprocess, all
applications using os.popen() will benefit from any bug fixes
immediately, so the support effort in keeping it around is very low.

 I think that it's time to move forward and remove os.popen(). But... there 
 are 66 calls to os.popen() in:
 
 Doc/tools/docutils/writers/odf_odt
 Lib
 Lib/ctypes
 Lib/distutils
 Lib/distutils/command
 Lib/distutils/tests
 Lib/idlelib
 Lib/multiprocessing
 Lib/pydoc_data
 Lib/test
 Lib/tkinter/test/test_tkinter
 Mac/BuildScript
 Mac/Tools
 PCbuild
 PC/VC6
 PC/VS7.1
 PC/VS8.0
 Tools/msi
 Tools/scripts
 
 So we can maybe start with:
  - Restore the documentation

+1

As for the other popen() variants: those are already gone and are
indeed better implemented using subprocess directly.

--
nosy: +lemburg

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



[issue11443] Zip password issue

2011-03-09 Thread Yaroslav

Yaroslav sbojc...@gmail.com added the comment:

Ok, i try that example in new versions 3+, and it works there. Thanks

--
status: open - closed

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



[issue11450] Py_GetBuildInfo() truncates when there are many hg tags

2011-03-09 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 0f9e5042907c by Antoine Pitrou in branch '3.1':
Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when
http://hg.python.org/cpython/rev/0f9e5042907c

New changeset 605c74139754 by Antoine Pitrou in branch '3.2':
Merge fix for issue #11450
http://hg.python.org/cpython/rev/605c74139754

New changeset 1e00b161f5f5 by Antoine Pitrou in branch 'default':
Merge fix for issue #11450
http://hg.python.org/cpython/rev/1e00b161f5f5

New changeset a7412744822d by Antoine Pitrou in branch '2.7':
Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when
http://hg.python.org/cpython/rev/a7412744822d

--
nosy: +python-dev

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



[issue11450] Py_GetBuildInfo() truncates when there are many hg tags

2011-03-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Thanks you for the patch! Fixed now.

--
nosy: +pitrou
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed
versions: +Python 2.7, Python 3.1, Python 3.2

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



[issue11452] Test suite not symlink-install clean

2011-03-09 Thread Steffen Daode Nurpmeso

New submission from Steffen Daode Nurpmeso sdao...@googlemail.com:

I'm now using a completely brain-damaged way to have two 3.x python(1)s
installed: symlinks; i.e. 3.2rc2 is ~/usr/opt/.py-3.2rc2 and tip is
~/usr/opt/.cpython.  Whenever i need to test the thing i'm working on
in my free time with the old version i'm temporarily replacing a
~/usr/opt/py3k symlink (which points to .cpython otherwise).
(I'm doing this because only py3k is in $PATH, $LD_LIBRARY_PATH etc.,
but like i said...)

I don't know if you consider this to be misbehaviour, but a
moment ago i've run the test suite on an installed python(1) tip
and got these symlink-path is not --prefix-path related errors,
just if anyone is concerned (stripping output a bit):

==
FAIL: test_getsourcefile (test.test_inspect.TestRetrievingSourceCode)
--
Traceback (most recent call last):
  File /Users/steffen/usr/opt/.cpython/lib/python3.3/test/test_inspect.py, 
line 279, in test_getsourcefile
self.assertEqual(normcase(inspect.getsourcefile(mod.spam)), modfile)
AssertionError: 
'/Users/steffen/usr/opt/.cpython/lib/python3.3/test/inspect_fodder.py' != 
'/Users/steffen/usr/opt/py3k/lib/python3.3/test/inspect_fodder.py'
- /Users/steffen/usr/opt/.cpython/lib/python3.3/test/inspect_fodder.py
?--  
+ /Users/steffen/usr/opt/py3k/lib/python3.3/test/inspect_fodder.py
?  ^^

==
FAIL: test_findsource_code_in_linecache (test.test_inspect.TestBuggyCases)
--
Traceback (most recent call last):
  File /Users/steffen/usr/opt/.cpython/lib/python3.3/test/test_inspect.py, 
line 387, in test_findsource_code_in_linecache
self.assertRaises(IOError, inspect.findsource, co)
AssertionError: IOError not raised by findsource

==
FAIL: test_stack (test.test_inspect.TestInterpreterStack)
--
Traceback (most recent call last):
  File /Users/steffen/usr/opt/.cpython/lib/python3.3/test/test_inspect.py, 
line 163, in test_stack
(modfile, 16, 'eggs', ['st = inspect.stack()\n'], 0))
AssertionError: Tuples differ: ('/Users/steffen/usr/opt/.cpyt... != 
('/Users/steffen/usr/opt/py3k/...

First differing element 0:
/Users/steffen/usr/opt/.cpython/lib/python3.3/test/inspect_fodder.py
/Users/steffen/usr/opt/py3k/lib/python3.3/test/inspect_fodder.py

- ('/Users/steffen/usr/opt/.cpython/lib/python3.3/test/inspect_fodder.py',
?  --  

+ ('/Users/steffen/usr/opt/py3k/lib/python3.3/test/inspect_fodder.py',
?^^

==
FAIL: test_trace (test.test_inspect.TestInterpreterStack)
--
Traceback (most recent call last):
  File /Users/steffen/usr/opt/.cpython/lib/python3.3/test/test_inspect.py, 
line 174, in test_trace
(modfile, 43, 'argue', ['spam(a, b, c)\n'], 0))
AssertionError: Tuples differ: ('/Users/steffen/usr/opt/.cpyt... != 
('/Users/steffen/usr/opt/py3k/...

First differing element 0:
/Users/steffen/usr/opt/.cpython/lib/python3.3/test/inspect_fodder.py
/Users/steffen/usr/opt/py3k/lib/python3.3/test/inspect_fodder.py

- ('/Users/steffen/usr/opt/.cpython/lib/python3.3/test/inspect_fodder.py',
?  --  

+ ('/Users/steffen/usr/opt/py3k/lib/python3.3/test/inspect_fodder.py',
?^^

...

==
FAIL: test_loop_caller_importing (test.test_trace.TestCallers)
--
Traceback (most recent call last):
  File /Users/steffen/usr/opt/py3k/lib/python3.3/test/test_trace.py, line 
286, in test_loop_caller_importing
self.assertEqual(self.tracer.results().callers, expected)
AssertionError: {(('/Users/steffen/usr/opt/.cpython/lib/python3.3/trace.py', 
'trace', 'Trace.run [truncated]... != 
{(('/Users/steffen/usr/opt/py3k/lib/python3.3/test/test_trace.py', 
'test_trace', [truncated]...

--
components: Tests
messages: 130452
nosy: sdaoden
priority: normal
severity: normal
status: open
title: Test suite not symlink-install clean
type: behavior
versions: Python 3.3

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



[issue11441] compile() raises SystemError if called from except clause

2011-03-09 Thread Daniel Urban

Daniel Urban urban.dani...@gmail.com added the comment:

 You could also call PyErr_NormalizeException at the beginning, and
 update the fields directly in the PySyntaxErrorObject structure.  No
 need to deal with any tuple.

Sorry, but I don't really understand.  If I call PyErr_NormalizeException at 
the beginning, the SyntaxError instance will be initialized with the wrong 
3-tuple: (errstr, lineno, offset).  If after that I update the msg, filename, 
... fields, they will be correct, but I think the args field still will be the 
wrong 3-tuple.  So I'll have to still create the new tuple, and replace the 
args field, right?

--

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



[issue11441] compile() raises SystemError if called from except clause

2011-03-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

hmm, you are right, of course. I forgot that e.args is part of the SyntaxError 
members.

--

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



[issue11435] Links to source code should now point to hg repo

2011-03-09 Thread SilentGhost

Changes by SilentGhost ghost@gmail.com:


--
versions: +Python 3.3

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



[issue11445] python.exe on OS X shared-llbrary build erroneously linked to MacPorts python library

2011-03-09 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

It is --enable-shared that is the culprit, but in the negated form...

The OSX linker will search the entire link path for a shared library before 
trying to look for a static library. As a workaround you could use 
'--enable-shared', and that should ensure that you get linked to the python 
version you're actually building as it is earlier on the path.

A proper fix is to add -Wl,-search_paths_first to the linker flags on OSX, 
with that flag the linker behaves just like the linker on any other unix 
platform.

--

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



[issue9270] distutils.util.getplatform and sysconfig.getplatform differ

2011-03-09 Thread Éric Araujo

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

Checked distutils2 too, it’s okay.

--
type: compile error - behavior

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



[issue10617] Collections ABCs can’t be linked to

2011-03-09 Thread Sandro Tosi

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

but that will generate class collections.abc.Container as text in the first 
column of the table: do you really like it? I don't :)

--

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



[issue11453] asyncore.file_wrapper should implement __del__ and call close there to prevent resource leaks and behave like socket.socket does.

2011-03-09 Thread Aldona Majorek

New submission from Aldona Majorek pyt...@ada.majorek.org:

asyncore.file_wrapper duplicates file descriptor of given file and closes it in 
it's close method.

But unlike socket.socket class it does not automatically call close when object 
is garbage collected.

Users of regular sockets and asyncore.dispatcher do not experience resource 
leaks when they forget to call self.close() in handle_close().

But people using file_dispatcher do loose file descriptor every time 
file_wrapper object is garbage collected without calling self.close() first.

--
components: Library (Lib)
messages: 130458
nosy: amajorek
priority: normal
severity: normal
status: open
title: asyncore.file_wrapper should implement __del__ and call close there to 
prevent resource leaks and behave like socket.socket does.
type: resource usage
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue5679] cleanUp stack for unittest

2011-03-09 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Apparently during a merge from trunk (r72477) the addCleanup and other methods 
ended up in 3.1rc1, even if they are documented as new in 3.2. I'll update the 
doc to say new in 3.1.

--
nosy: +ezio.melotti

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



[issue11452] Test suite not symlink-install clean

2011-03-09 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso sdao...@googlemail.com added the comment:

This sounds even more silly now, but i can't reproduce the problem 
any more! 
I could do so easily this noon, before i've opened this issue! 
You *do* see the tracebacks!

I wanted to (try to) write a patch (use os.path.realpath()), but 
even with drop of __pycache__'s, complete recompiles and 
reinstallations: i can't reproduce these faults. 
I've neither updated my repo, nor have i done anything else. 
The options are the same, too (python3 -E -Wd -m test -r -w). 

I leave this issue open until tomorrow noon, maybe someone with 
glue reads it and has one or two minutes to give me a hint on what 
is happening here.  (Thank you!) 
I'll close it, then?!

--

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



[issue11454] urllib.request import time

2011-03-09 Thread Ross Lagerwall

New submission from Ross Lagerwall rosslagerw...@gmail.com:

While importing most modules has little effect on the start up time,
importing urllib.request seems to take a considerable time.

E.g.: without importing urllib.request:
real0m0.072s
user0m0.070s
sys 0m0.000s

with importing urllib.request:
real0m0.127s
user0m0.120s
sys 0m0.010s

--
components: Library (Lib)
messages: 130461
nosy: orsenthil, rosslagerwall
priority: normal
severity: normal
status: open
title: urllib.request import time
type: resource usage
versions: Python 3.3

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



[issue11455] issue a warning when populating a CPython type dict with non-string keys

2011-03-09 Thread Michael Foord

New submission from Michael Foord mich...@voidspace.org.uk:

It is valid in CPython to create a new type with non-string keys in the dict. 
This is a problem for other implementations (neither pypy nor jython support 
it).

This should raise a warning.

--
components: Interpreter Core
messages: 130462
nosy: michael.foord
priority: normal
severity: normal
status: open
title: issue a warning when populating a CPython type dict with non-string keys
type: behavior
versions: Python 3.3

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



[issue6818] remove/delete method for zipfile/tarfile objects

2011-03-09 Thread Yuval Greenfield

Yuval Greenfield ubershme...@gmail.com added the comment:

I fixed the bugs I found, added tests and documentation. What do you guys think?

--
keywords: +patch
Added file: http://bugs.python.org/file21063/zipfile.remove.patch

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



[issue11455] issue a warning when populating a CPython type dict with non-string keys

2011-03-09 Thread Alex

Alex alex.gay...@gmail.com added the comment:

2 ways to do it:

class A(object):
locals()[42] = abc

or

type(A, (object,), {42: abc})

--
nosy: +alex

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



[issue11455] issue a warning when populating a CPython type dict with non-string keys

2011-03-09 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

Note that other implementations not supporting this has been agreed by Guido. 
The language spec says that the class dict is a namespace and should have 
string keys.

--

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



[issue6818] remove/delete method for zipfile/tarfile objects

2011-03-09 Thread Éric Araujo

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


--
nosy: +eric.araujo

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



[issue10617] Collections ABCs can’t be linked to

2011-03-09 Thread Éric Araujo

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

I don’t either.  The one thing I’d like is that :class:`collections.Set` 
generates a link to the table which documents the ABCs.

--
nosy: +georg.brandl

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



[issue11406] There is no os.listdir() equivalent returning generator instead of list

2011-03-09 Thread Vetoshkin Nikita

Vetoshkin Nikita nikita.vetosh...@gmail.com added the comment:

We could, but someone must:
1) provide a patch
While working on a straightforward patch for linux, I had to make a lot of 
copy-paste job. posixmodule.c is quite a mess already :(
2) demonstrate a significant improvement in some real-world situation
suppose we have a directory with several millions of files and a cron script 
which must process just a bunch of them at a time. There's no need to gather 
them all.
As mmarkk mentioned - readdir already provides generator style access to the 
directory contents, it could be nice to provide such API in Python.

http://pastebin.com/NCGmfF49 - here's a kind of test (cached and uncached)
http://pastebin.com/tTKRTiNc - here's a testcase for batch processing of 
directory contenst (first is xlistdir(), second - listdir()) both uncached.

--

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



[issue10617] Collections ABCs can’t be linked to

2011-03-09 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue11456] Documentation csv RFC4180

2011-03-09 Thread Tony Wallace

New submission from Tony Wallace t...@tony.gen.nz:

Change to documentation preamble for csv module:

From:

There is no “CSV standard”, so the format is operationally defined by the many 
applications which read and write it. The lack of a standard means that subtle 
differences often exist in the data produced and consumed by different 
applications.

To:

CSV has been used for many years prior to attempts to standardise it in 
RFC4180.  This has resulted in  subtle differences often exist in the data 
produced and consumed by different applications.

--
assignee: docs@python
components: Documentation
messages: 130469
nosy: docs@python, tonywallace
priority: normal
severity: normal
status: open
title: Documentation csv RFC4180
type: feature request
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue11456] Documentation csv RFC4180

2011-03-09 Thread Éric Araujo

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

Thanks for the report.  I’ve added Skip, at his request on the CSV list.

--
assignee: docs@python - skip.montanaro
keywords: +patch
nosy: +eric.araujo, skip.montanaro
stage:  - patch review
versions:  -Python 2.5, Python 2.6

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



[issue11072] Add MLSD command support to ftplib

2011-03-09 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Thanks for the great review Eric.
Patch in attachment provides the following changes:

- return a generator object
- remove callback parameter
- each yielded entry is a (name, {...}) tuple
- fix for ; in file name
- fix for   in file name
- fix for = in fact value
- raise on missing = in fact
- no longer converts numbers in integers
- all dictionary keys (fact names) are lower-cased
- extended test suite covering a lot of cases
- no new lines in MLSD_DATA
- updated doc with deprecation warnings for dir() and nslt() methods


 Aren't you modifying the state on the server (via OPTS MLST), 
 and then if you make a subsequent call without specifying facts
 you'll be using the value of facts from the previous call to MLSD? 

Correct. This is how OPTS/MLSD are supposed to work.
Not sure whether we can or *should* reset initial default facts.
I think we shouldn't.

--
Added file: http://bugs.python.org/file21064/ftplib_mlsd_v2.patch

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



[issue1706039] Added clearerr() to clear EOF state

2011-03-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I'm afraid there's a misunderstanding here about the scope of the issue. 
fileobject.c is not really used in py3k (except for a couple very specific uses 
such as the tokenizer or the import machinery).
The standard I/O stack uses object in the _io module (that is, in 
Modules/_io/*.c).
That's also why you won't see the tests failing, even without the patch...

--
stage: test needed - patch review
versions:  -Python 3.1, Python 3.2

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



[issue3080] Full unicode import system

2011-03-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I created the features/unicode_import repository with a unicode_import branch:
http://hg.python.org/features/unicode_import/

It's my huge patch splitted into small and atomic commits.

--

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



[issue11072] Add MLSD command support to ftplib

2011-03-09 Thread SilentGhost

SilentGhost ghost@gmail.com added the comment:

facts_found.strip( ).rstrip(;)

strip is redundant since facts_found is a first element of partitioning by the 
same string. rstrip is wrong since you're potentially deleting more than one 
character (there is no test for that).

In your test you're checking whether returned facts contain every requested 
fact, this is not guaranteed by RFC. Also, not sure what the last for statement 
is supposed to mean. Is it a typo?

--

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



[issue3722] print followed by exception eats print with doctest

2011-03-09 Thread Terry J. Reedy

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

Temporary output will break all doctests, not just those with exception 
traceback. One should fix, disable debug output, and then rerun doctest to make 
sure fix did not break anything else.

A function that prints and raises *can* be tested as by separately testing both 
output and silencing of expected exception as follows:

 def test():
...   print(hello)
...   raise IndexError()
...
 try:
...   test()
...   raise BaseException()
... except IndexError:
...   pass
hello

This passes but will not if function prints anything else or does anything 
other than raise that exception (or a subclass thereof). In practice, catching 
subclasses should be ok, but if not, the except clause can be expanded to

... except IndexError as msg:
...   if type(msg) is not IndexError:
... raise BaseException

I am only leaving this open for a possible doc addition showing something like 
the simpler fix above.

--
assignee:  - docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
stage:  - needs patch
Added file: http://bugs.python.org/file21065/doctest_solution.py

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



[issue11072] Add MLSD command support to ftplib

2011-03-09 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

You're right about r/strip(), thanks (new patch in attachment).

 In your test you're checking whether returned facts 
 contain every requested fact, this is not guaranteed by RFC.

Yes, but we're using a dummy FTP server returning static MLSD_DATA, so this is 
not important.

 Also, not sure what the last for statement 
 is supposed to mean. Is it a typo?

It makes sure whether in case of directory empty (see: no data returned) we 
don't enter in the for block.
Probably it's not even necessary because this is already tested by:
self.assertRaises(StopIteration, next, self.client.mlsd())
...but... whathever.

--
Added file: http://bugs.python.org/file21066/ftplib_mlsd_v3.patch

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



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-03-09 Thread Nasos Dousis

Nasos Dousis ndou...@gmail.com added the comment:

I'm upgrading from Python 2.6.5 to 2.7.1, and I'm getting the error below when 
compiling my code using Boost 1.45 and gcc 4.2.1 in OSX 10.6.6.  The following 
thread describes similar symptoms related to the ordering of header files and 
macro definitions:
http://code.google.com/p/unladen-swallow/issues/detail?id=87#c13

The suggested patch to pyport.h 
(http://codereview.appspot.com/179049/patch/1/2) does not fix my problem.  
However, prepending 

#include Python.h

to each source file (e.g., bend.cc below) does fix the problem.  Is there a 
simple way to fix this without adding Python.h to every source file in my 
codebase?

I've installed Boost and Python from source to non-standard directories, Boost 
1.45 by:
cd $(BOOST); ./bootstrap.sh --prefix=$(CURDIR)/$(BOOST) 
--with-python-root=$(CURDIR)/$(PYTHON_DIR) --with-python-version=2.7 
--with-libraries=mpi

and Python 2.7 by:
cd $(PYTHON_SRCDIR) ; ./configure --enable-shared 
--prefix=$(CURDIR)/$(PYTHON_DIR)
cd $(PYTHON_SRCDIR) ; make -j $(NUMPROC)  make install

Any guidance will be greatly appreciated.

Kind regards,
Nasos

===
...
darwin.compile.c++ bin/darwin-4.2.1/release/threading-multi/bend.o
In file included from /usr/include/c++/4.2.1/ios:47,
 from /usr/include/c++/4.2.1/ostream:45,
 from /usr/include/c++/4.2.1/iterator:70,
 from boost/boost/next_prior.hpp:15,
 from boost/boost/utility.hpp:17,
 from boost/boost/python/instance_holder.hpp:10,
 from boost/boost/python/object/pointer_holder.hpp:14,
 from boost/boost/python/to_python_indirect.hpp:10,
 from boost/boost/python/converter/arg_to_python.hpp:10,
 from boost/boost/python/call.hpp:15,
 from boost/boost/python/object_core.hpp:14,
 from boost/boost/python/args.hpp:25,
 from boost/boost/python.hpp:11,
 from bend.hh:6,
 from bend.cc:1:
/usr/include/c++/4.2.1/bits/localefwd.h:58:34: error: macro isspace passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:70:34: error: macro isupper passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:74:34: error: macro islower passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:78:34: error: macro isalpha passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:94:34: error: macro isalnum passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:102:34: error: macro toupper passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:106:34: error: macro tolower passed 2 
arguments, but takes just 1
In file included from /usr/include/c++/4.2.1/bits/basic_ios.h:44,
 from /usr/include/c++/4.2.1/ios:50,
 from /usr/include/c++/4.2.1/ostream:45,
 from /usr/include/c++/4.2.1/iterator:70,
 from boost/boost/next_prior.hpp:15,
 from boost/boost/utility.hpp:17,
 from boost/boost/python/instance_holder.hpp:10,
 from boost/boost/python/object/pointer_holder.hpp:14,
 from boost/boost/python/to_python_indirect.hpp:10,
 from boost/boost/python/converter/arg_to_python.hpp:10,
 from boost/boost/python/call.hpp:15,
 from boost/boost/python/object_core.hpp:14,
 from boost/boost/python/args.hpp:25,
 from boost/boost/python.hpp:11,
 from bend.hh:6,
 from bend.cc:1:
/usr/include/c++/4.2.1/bits/locale_facets.h:242:53: error: macro toupper 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:271:53: error: macro tolower 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:814:53: error: macro toupper 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:847:53: error: macro tolower 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4611:44: error: macro isspace 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4629:44: error: macro isupper 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4635:44: error: macro islower 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4641:44: error: macro isalpha 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4665:44: error: macro isalnum 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4677:44: error: macro toupper 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4683:44: error: macro tolower 
passed 2 arguments, but takes just 1
In file included from /usr/include/c++/4.2.1/ios:47,
   

[issue11457] Expose nanosecond precision from system calls

2011-03-09 Thread Kris Henriksson

New submission from Kris Henriksson kthenriks...@gmail.com:

The most recent (issue 7) release of the POSIX standard mandates support for 
nanosecond precision in certain system calls. For example, the stat structure 
include a timespec struct for each of mtime, atime, and ctime that provides 
such nanosecond precision.[1] There is also an futimens call that allows 
setting the time accurate to the nanosecond.[2] Support for such precision is 
available at the least on 2.6 Linux kernels.

1. http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html
2. http://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html

Currently, the Python float type is used everywhere to express times in a 
single value (such as the result from os.stat). However, since this is 
implemented in CPython using type double (and possibly similarly elsewhere) it 
is impossible to obtain sufficient precision using a float.

Therefore, it would be useful to expose the number of seconds and nanoseconds 
separately
to allow full precision. Perhaps adding these values as additional members to 
the return value from os.stat would be most useful, something like 
.st_atimensec that Linux sometimes uses, or else just follow the POSIX standard 
to include a sub-struct.

This is important for example with the tarfile module with the pax tar format. 
The POSIX tar standard[3] mandates storing the mtime in the extended header (if 
it is not an integer) with as much precision as is available in the underlying 
file system, and likewise to restore this time properly upon extraction. 
Currently this is not possible.

3. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html

--
components: Library (Lib)
messages: 130478
nosy: khenriksson
priority: normal
severity: normal
status: open
title: Expose nanosecond precision from system calls
type: feature request

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



[issue11457] Expose nanosecond precision from system calls

2011-03-09 Thread Kris Henriksson

Kris Henriksson kthenriks...@gmail.com added the comment:

Also, a new function similar to os.utime would be needed as well, perhaps 
something named like os.utimens. This would be needed to allow setting times 
with nanosecond precision.

--

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



[issue11457] Expose nanosecond precision from system calls

2011-03-09 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +mark.dickinson
versions: +Python 3.3

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



[issue7867] Proposed FAQ entry on pass-by-? semantics and the meaning of 'variable' in python

2011-03-09 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

This patch isn't going to be accepted, so I'm closing the issue.  Someone else 
can propose a different wording in a new issue if they wish.

--
resolution:  - rejected
stage:  - committed/rejected
status: open - closed

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



[issue1706039] Added clearerr() to clear EOF state

2011-03-09 Thread Scott Dial

Scott Dial sc...@scottdial.com added the comment:

I'm well aware of the limited use of Py_UniversalNewlineFgets() in py3k, but it 
remains the case that it is a public API that fails to work correctly under the 
conditions specified by the reporter, and Alexander confirmed the original 
patch fixed the issue. AFAICT, there no longer are any test cases (beyond the 
indirect testing of the dependent code) for Py_UniversalNewlineFgets().

One of the issues with applying the patch to tip was due to commenting out some 
code in it:

 /* if ( c == EOF  skipnextlf )
 newlinetypes |= NEWLINE_CR; */

For issue8914, which really should've just deleted those two lines, but there 
was not such an extensive review of that change.

The unittests have there own merit. The file object API is supposed to behave 
in the manner that the tests exercise them. There are currently no tests that 
would inform us if any change broke this documented behavior. If you want to 
split the patch in two to treat them as independent items, then fine.

Otherwise, close the issue as WONTFIX due to obsolescence.

--

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



[issue11458] tarfile with socket incompatability

2011-03-09 Thread Alex Leach

New submission from Alex Leach beamesle...@gmail.com:

Hi,

I'm trying to parse the contents of tar archives (.tgz) on the fly, and failing 
to do so. The tar archives in question have directory hierarchies, and only if 
a TarInfo object is a file (.isreg() ) will I try and read it's contents.

I figured a sensible idea would be to pass a socket(.makefile()) object to the 
fileobj attribute of tarfile.open. This doesn't work because a socket file 
descriptor does not have a tell() method. I understand that a socket object 
shouldn't need to have a tell method, but why should the fileobj passed to 
tarfile.open need it?

Code:-

def get_headers( self, file_name ):
sock = socket.socket()
sock.bind(('localhost',0))
fd = sock.makefile()
handle = tarfile.open( file_name,'r',fileobj=fd ) # This line breaks

I'm currently testing on Python v2.6.6 EPD 6.3-2 64 bit, on an Autumn 2010 Mac 
Pro.

My dirty bug-fix idea is to subclass tarfile.TarFile, and give it a tell() 
method, to just return 0. I don't want to have to do that. Any alternative 
suggestions would be greatly appreciated.

Cheers,
Alex

--
components: Extension Modules
messages: 130482
nosy: Alex.Leach
priority: normal
severity: normal
status: open
title: tarfile with socket incompatability

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



[issue11454] urllib.request import time

2011-03-09 Thread Martin v . Löwis

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

What operating system is that on?

--
nosy: +loewis

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



[issue11455] issue a warning when populating a CPython type dict with non-string keys

2011-03-09 Thread Martin v . Löwis

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

I fail to see the need to warn about this, though. Users using the feature are 
likely aware that this violates the language specification, and will find out 
quickly when they do port it to another Python implementation.

There are many many other aspects of CPython that don't, and often even can't, 
work on other Python implementations that are not warned about (such as usage 
of extensions modules, or development of extension modules).

--
nosy: +loewis

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



[issue11406] There is no os.listdir() equivalent returning generator instead of list

2011-03-09 Thread Martin v . Löwis

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

 a cron script which must process just a bunch of them at a time.
  There's no need to gather them all.

Can you please be more explicit? What's the application in which you
have several millions of files in a directory? What's the task that
the processing script needs to perform?

 http://pastebin.com/NCGmfF49 - here's a kind of test (cached and uncached)

This isn't really convincing - the test looks at all files, so it isn't 
clear why xlistdir should do any better than listdir. And indeed, with
a cold cache, xlistdir is slower (IIUC).

 http://pastebin.com/tTKRTiNc - here's a testcase for batch processing of 
 directory contenst (first is xlistdir(), second - listdir()) both uncached.

This is not a real-world application - there is no actual processing done.

BTW, can you publish your xlistdir implementation somewhere?

--

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



[issue11458] tarfile with socket incompatability

2011-03-09 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

I believe you are looking for mode 'r|'.

--
nosy: +r.david.murray
resolution:  - works for me
stage:  - committed/rejected
status: open - closed

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



[issue11454] urllib.request import time

2011-03-09 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

Ubuntu 10.10.

I haven't investigated whether it is actually urllib.request that is causing 
the long import time or a module that it is dependent on.

--

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



[issue11459] Python select.select does not correctly report read readyness

2011-03-09 Thread Novimir Pablant

New submission from Novimir Pablant amici...@gmail.com:

I am trying to get the output from an external program into python using 
`subprocess.Popen` and `select.select`.   For some reason though select.select 
is at times telling me that stdout is not ready to read, even when it is 
(reading from it works).   

This problem exists in python 3.1  3.2 but not in python 2.7.



For my particular application I am connecting to external program via ssh.  I 
would not expect that the ssh connection would be an issue.

The program that I am calling produces some output and eventually asks for user 
input.  In the example below I only get a portion of the output, then at some 
point select.select tells me that read is not available.  If I try to read 
anyway I can keep getting more output.  As soon as I press a key (passing 
something to stdin),  select.select tells me that I can read again and I get 
the rest of the output.   

Any ideas?


def wrapExternal(host=None):

   command = [ssh, -t, host, some_program]

   child = subprocess.Popen(command
,bufsize=0
,stdout=subprocess.PIPE
,stderr=subprocess.STDOUT)

   out = ''
   while True:
  r, w, x = select.select([child.stdout], [], [], 1.0)

  if child.poll() is not None:
 break

  if r:
 out = child.stdout.read(1)
 print(out.decode(), end='')
 sys.stdout.flush()

   return child.returncode

--
components: Library (Lib)
messages: 130488
nosy: amicitas
priority: normal
severity: normal
status: open
title: Python select.select does not correctly report read readyness
type: behavior
versions: Python 3.1, Python 3.2

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



[issue11459] Python select.select does not correctly report read readyness

2011-03-09 Thread Novimir Pablant

Novimir Pablant amici...@gmail.com added the comment:

I forgot to mention, I am running on OS X 10.6.6.

--

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



[issue11445] python.exe on OS X shared-llbrary build erroneously linked to MacPorts python library

2011-03-09 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

I see the problem now. Using a --enable-shared configure similar to Skip's, the 
gcc step that builds python.exe is:

  gcc -L/opt/local/lib -u _PyMac_Error -o python.exe \
  Modules/python.o \
  -L. -lpython2.7 -ldl  -framework CoreFoundation

What I failed to notice originally is that the MacPorts python27 port, which 
both Skip and I have installed, adds a link in /opt/local/lib to its framework 
lib:

/opt/local/lib/libpython2.7.dylib@ - 
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python

So since /opt/local/lib comes first on the lib list, that libpython2.7 is going 
to be found before the build directory's dylib.  Moving -L /opt/local/lib to 
after -L. does seem to fix the problem.

In the non-shared case, the gcc link step is:

  gcc -L/opt/local/lib -u _PyMac_Error -o python.exe \
  Modules/python.o libpython2.7.a \
  -ldl  -framework CoreFoundation

so the local static lib is explicitly loaded and there shouldn't be a problem.

The shared-lib case is nasty in that you can easily link to the wrong lib 
without realizing it.  The Makefile (for 2.7 - py3k is similar) is:

# Build the interpreter
$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
Modules/python.o \
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)

I wonder whether $(LDFLAGS) can be safely moved to after $(BLDLIBRARY) without 
breaking some platform. And I suspect the problem is not unique to OS X but 
perhaps more likely there.

--

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



[issue2142] difflib.unified_diff(...) produces invalid patches

2011-03-09 Thread Ray.Allen

Ray.Allen ysj@gmail.com added the comment:

Updated patch which can apply to current py3k cleanly and with changes follow 
eric's review comments.

--
Added file: http://bugs.python.org/file21067/issue_2142.diff

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



[issue11457] Expose nanosecond precision from system calls

2011-03-09 Thread Lars Gustäbel

Changes by Lars Gustäbel l...@gustaebel.de:


--
nosy: +lars.gustaebel

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