[issue6471] errno and strerror attributes incorrectly set on socket errors wrapped by urllib

2010-02-27 Thread Ezio Melotti

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

Can this be fixed without breaking compatibility?
It also affects Python2.7 and maybe also Python 3.x (there the error is 
different and might be intentional).

Copy/pastable snippet to reproduce the error on 2.x:
from urllib import urlopen
try:
urlopen('http://www.pythonfoobarbaz.org')
except Exception, err:
print 'err:', err
print 'repr(err):', repr(err)
print 'err.errno:', err.errno
print 'err.strerror:', err.strerror
print 'err.strerror.errno:', err.strerror.errno
print 'err.strerror.strerror:', err.strerror.strerror

Result on 2.7:
err: [Errno socket error] [Errno -2] Name or service not known
repr(err): IOError('socket error', gaierror(-2, 'Name or service not known'))
err.errno: socket error
err.strerror: [Errno -2] Name or service not known
err.strerror.errno: -2
err.strerror.strerror: Name or service not known


Copy/pastable snippet to reproduce the error on 3.x:
from urllib.request import urlopen
try:
urlopen('http://www.pythonfoobarbaz.org')
except Exception as exc:
err = exc
print('err:', err)
print('repr(err):', repr(err))
print('err.errno:', err.errno)
print('err.strerror:', err.strerror)
print('err.reason:', err.reason)
print('err.reason.errno:', err.reason.errno)
print('err.reason.strerror:', err.reason.strerror)

Result on 3.2:
err: urlopen error [Errno -2] Name or service not known
repr(err): URLError(gaierror(-2, 'Name or service not known'),)
err.errno: None
err.strerror: None
err.reason: [Errno -2] Name or service not known
err.reason.errno: -2
err.reason.strerror: Name or service not known

--
nosy: +orsenthil
stage:  - needs patch
versions: +Python 2.7, Python 3.1, Python 3.2

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



[issue6519] Reorder 'with' statement for files in Python Tutorial

2010-02-27 Thread Ezio Melotti

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

All the examples there assume that a file object called f has already been 
created. Using a 'with' there it's not a good idea because the users will have 
to keep the instructions indented under the 'with'.
However I agree that it would be better to move that example earlier. Maybe in 
7.2 both the forms can be shown and discussed briefly.

--
stage:  - needs patch
versions:  -Python 3.0

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



[issue8027] distutils fail to determine c++ linker with unixcompiler if using ccache

2010-02-27 Thread Alexander Sulfrian

New submission from Alexander Sulfrian alexan...@sulfrian.net:

Hi,
if using ccache (CC=ccache gcc --flags, CXX=g++) distutils will try to 
execute something like g++ gcc --flags as linker for c++ libraries.

Patch attached.


Alex

--
assignee: tarek
components: Distutils
files: fix-distutils-with-ccache.patch
keywords: patch
messages: 100186
nosy: Alexander.Sulfrian, tarek
severity: normal
status: open
title: distutils fail to determine c++ linker with unixcompiler if using ccache
type: compile error
versions: Python 2.6
Added file: http://bugs.python.org/file16388/fix-distutils-with-ccache.patch

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



[issue7793] regrtest fails with RuntimeError: maximum recursion depth exceeded in some cases

2010-02-27 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

Fixed in r78497.

--
resolution: accepted - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue4199] add shorthand global and nonlocal statements

2010-02-27 Thread Georg Brandl

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

I do think a brief discussion after the moratorium is over would be good.

--

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



[issue8028] self.terminate() from a multiprocessing.Process raises AttributeError exception

2010-02-27 Thread 5houston

New submission from 5houston cadab...@gmail.com:

Try to execute python -OO crashingMain.py using python 3.1 or 3.1.1.

It creates and starts 5 SendingProcess(es).
SendingProcess inherits from multiprocessing.Process and 
multiprocessing.queue.Queue.

Each process starts a loop.

In the meanwhile the main, calling close() method of each SendingProcess, puts 
1 into each SendingProcess and each SendingProcess, when it self.get(s) it, 
calls self.terminate.

This causes a AttributeError exception for each SendingProcess.

workingMain.py instead does not call close() method.
It calls directly the terminate method of each SendingProcess.

--
files: pythonProcBug.tar.bz2
messages: 100191
nosy: 5houston
severity: normal
status: open
title: self.terminate() from a multiprocessing.Process raises AttributeError 
exception
versions: Python 3.1
Added file: http://bugs.python.org/file16390/pythonProcBug.tar.bz2

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



[issue8029] bug in 2to3 dealing with print FOO, followed by sys.stdout.write('')

2010-02-27 Thread Trent Mick

New submission from Trent Mick tre...@gmail.com:

According to 
http://docs.python.org/reference/simple_stmts.html#the-print-statement the 
following with result in the print statement NOT printing a trailing space:

import sys
print uASD,; sys.stdout.write(u)

However, 2to3 currently translates this to:

import sys
print(ASD, end=' '); sys.stdout.write()

It *should* translate to:

import sys
print(ASD, end='')

You can also see the discussion of this on this lib3to2 bug report:
  
http://bitbucket.org/amentajo/lib3to2/issue/13/print-3-end-isnt-translated-properly
and translation of this between 2to3 and 3to2 here:
  http://pythontranslationparty.appspot.com/6004/

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 100194
nosy: trentm
severity: normal
status: open
title: bug in 2to3 dealing with print FOO, followed by sys.stdout.write('')

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



[issue7232] Support of 'with' statement fo TarFile class

2010-02-27 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

 What about changing the exception test to something like what I did in  
 issue7232.4.diff?

That is definitely more succinct, but Lars' solution provides more information 
about _why_ the test fails.  IMHO, the descriptiveness is
more important than succinctness.  Especially when debugging a failed
test.

--

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



[issue7162] 2to3 does not convert __builtins__.file

2010-02-27 Thread Ryan Coyner

Ryan Coyner rcoy...@gmail.com added the comment:

Patch attached. Unit test and documentation included.

COMMITMSG:

Adds a new fixer to lib2to3 which replaces the deprecated builtin file with 
open.

--
keywords: +patch
nosy: +rcoyner
Added file: http://bugs.python.org/file16392/issue7162.patch

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



[issue7232] Support of 'with' statement fo TarFile class

2010-02-27 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Good point. How about version 5? It uses base Exception in the context manager, 
which will allow us to differentiate between no exception being raised, and the 
wrong one being raised. After the context manager, we check the type of the 
exception to make sure it's correct.

I changed the exception being raised to an IOError. It could be anything, but 
given that AssertionError is what gets raised by the assert functions, it 
seemed better to avoid that one specifically. This is fairly minor, though.

If you change the raise IOError to be a pass statement, or another type of 
exception, you can see that the same level of information is given to you as in 
patch version 3 by Lars.

--
Added file: http://bugs.python.org/file16394/issue7232.5.diff

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



[issue7232] Support of 'with' statement fo TarFile class

2010-02-27 Thread Éric Araujo

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

Hello

Minor note: I think magic methods shouldn’t have docstrings, because their name 
is enough doc (or at least enough to go read the doc). At most a one-line 
comment like “context protocol” can be useful. (The exception is __init__, 
which doesn’t have a defined set of arguments.)

Cheers

--
nosy: +merwok

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