[issue18764] The pdb print command prints repr instead of str in python3

2013-09-23 Thread Connor Osborn

Connor Osborn added the comment:

In 2.7 there is no documented command *print, the docs are explicit on this 
(it's just the built in statement). However, 3.4 treats print like a feature of 
2.7. Is this to maintain backwards compatibility? I would suggest preserving 
the original direction of the pdb, where a user has access to a p command but a 
user can always use the built in python print function.

in short:
-remove print from documented commands
-remove print alias

*This is my first patch :P Let me know if this is the correct direction, and 
what needs to be changed for acceptance, thanks.

--
keywords: +patch
Added file: http://bugs.python.org/file31855/18764.patch

___
Python tracker 

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



[issue19081] zipimport behaves badly when the zip file changes while the process is running

2013-09-23 Thread Gregory P. Smith

New submission from Gregory P. Smith:

If you are

1) using zipimport
2) zipimport.c has cached the zip file's central index during an import.
3) the .zip file is modified or replaced while the process is running
4) you try to import something new from that .zip file.

you're gonna have a bad time... Typically a ZipImportError or some other form 
of ImportError.

What happen's is that Modules/zipimport.c is caching the end-of-zipfile central 
index for the .zip file and reusing that data on subsequent imports from that 
.zip without either (a) keeping the file handle open or (b) confirming that the 
.zip file has not changed.

I doubt many users are running into this.  But one situation where you do is 
when you zip up the Python standard library for your installed python and a 
long running process encounters data using a different encoding which triggers 
an import of an encodings.foo module after another process has come along and 
upgraded the standard library .zip file as part of updating your python 
installation...

I've got a fix in the works.  Test attached.

For the fix I am going with option (b) to reconfirm the validity of the .zip 
file any time something is imported from it rather than option (a) as leaving a 
new file handle open for the duration of the process, while the _correct ideal 
design_ seems intrusive for stable bug fix release.

I have only confirmed the bug on Python 2.7 & 3.3; i'll test default (3.4) 
after working on those two.

--
assignee: gregory.p.smith
files: zipimport_modify_zip_test.patch
keywords: patch
messages: 198351
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: zipimport behaves badly when the zip file changes while the process is 
running
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31854/zipimport_modify_zip_test.patch

___
Python tracker 

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



[issue11176] give more meaningful argument names in argparse documentation

2013-09-23 Thread Westley Martínez

Westley Martínez added the comment:

I've skimmed through the patches.  Good job kids.  This is much better than it 
was before.  No more of that silly command-line calculator or the foobar 
nonsense that sounds drier than the POSIX standard.

Is there anything else that needs to be done?

--

___
Python tracker 

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



[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Suppress the traceback, avoid printing the exception repr and instead
display something more like "Broken pipe: receiving end of stdout closed
prior to interpreter shutdown"

--

___
Python tracker 

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



[issue19078] Allow reversed(memoryview), like memoryview

2013-09-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Aye, with the 3.3 changes, I think we should continue down the
multi-dimensional array path. I suggest we run with whatever NumPy uses for
ndarray, which I believe is "number of items in the first dimension".

--
title: Allow reversed(memoryview), like memoryview[::-1] -> Allow 
reversed(memoryview), like memoryview

___
Python tracker 

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



[issue19079] chameleon benchmark fails on 3.4

2013-09-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I guess version ranges could be feasible. Perhaps with benchmark-skipping 
decorators?

--

___
Python tracker 

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



[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> My specific suggestion was aimed at 3.4 - I think reporting the failure to
> flush stdout on stderr is the right thing to do (since data may have been
> lost and people can suppress it by closing stdout early, including in an
> atexit handler), but I also think it's worth improving the error message in
> the specific case of a broken pipe error.

How would you improve it?

--

___
Python tracker 

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



[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Nick Coghlan

Nick Coghlan added the comment:

My specific suggestion was aimed at 3.4 - I think reporting the failure to
flush stdout on stderr is the right thing to do (since data may have been
lost and people can suppress it by closing stdout early, including in an
atexit handler), but I also think it's worth improving the error message in
the specific case of a broken pipe error.

However, I also agree the error output is more wrong in 2.7, so improving
that would be good, too.

--

___
Python tracker 

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



[issue16038] ftplib: unlimited readline() from connection

2013-09-23 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Sep 23, 2013, at 06:33 PM, Giampaolo Rodola' wrote:

>Barry can you paste the traceback caused by the race condition? What's not
>clear to me is when (what line) it occurs.  One solution might be to send a
>"NOOP" command (self.client.sendcmd('noop')) in order to synchronize client
>and server.

There's no traceback other than the test failure that I posted.  It's a race
condition because with a little sleep, the test passes.  Without it, it fails.

This is on various flavors of Ubuntu (only up to 10.04 which is the last
version I can build a full 2.6 against) and Debian.

--

___
Python tracker 

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



[issue18682] [PATCH] remove bogus codepath from pprint._safe_repr

2013-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

To made some sense in Python 3 context we should remove the check for the 
locale module and replace repr() by ascii().

--

___
Python tracker 

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



[issue19078] Allow reversed(memoryview), like memoryview[::-1]

2013-09-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

So the dilemma with len() was: does it return the number of bytes, or the 
number of items?
Given the new memoryview semantics, I'd say it should return the number of 
items.

--
nosy: +ncoghlan, skrah

___
Python tracker 

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



[issue19080] Enrich SyntaxError with additional information

2013-09-23 Thread alon horev

New submission from alon horev:

Some context for this feature request:
I'm using the wonderful ast module for a library that translates python code to 
MongoDB queries (https://github.com/alonho/pql). I also did the same for SQL 
queries using sqlalchemy as a part of another project 
(https://github.com/alonho/pytrace).

One of the things I find lacking in python's parser is additional information 
about SyntaxErrors. This could help users of the 'ast' module, IDE and 
developers.

Here are some examples of what I'd like to see
1. ast.parse('* 2') -> SyntaxError('Unexpected operator at start of an 
expression')
2. ast.parse('2 *') -> SyntaxError('Missing right hand side operand')
3. ast.parse('if a = 1: pass') -> SyntaxError('Cannot assign inside an 
expression')

There are several challenges here:
1. Does the parser have this information and doesn't surface it?
2. Can such messages be automatically generated without filling the code with 
error handling code? 3. Which part of the code could be responsible for this 
kind of a task? I've looked at the BNF and it contains more than just syntax 
legality but operator precedence and such. Perhaps there's another (simpler) 
grammar definition somewhere?

I was curious to see what Ruby does, and it uses a simple solution of providing 
raw information along with the exception:
>> a == * 1
SyntaxError: compile error
(irb):17: syntax error, unexpected tSTAR
a == * 1
  ^
from (irb):17

--
components: Interpreter Core
messages: 198341
nosy: alonho
priority: normal
severity: normal
status: open
title: Enrich SyntaxError with additional information
type: enhancement

___
Python tracker 

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



[issue4366] cannot find -lpythonX.X when building Python on FreeBSD with --enable-shared

2013-09-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Koobs, have you signed a contributor's agreement?
See http://www.python.org/psf/contrib/

--

___
Python tracker 

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



[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is a patch, lacking tests.
How important it is to fix this in 2.7 I'm not sure. People are certainly used 
to the quirk now, and it's generally harmless.

--
keywords: +patch
Added file: http://bugs.python.org/file31853/flush_stdout_at_shutdown.patch

___
Python tracker 

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



[issue19028] tkinter.tkapp.merge() fails on non-strings

2013-09-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue19028] tkinter.tkapp.merge() fails on non-strings

2013-09-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5c1c67d980bb by Serhiy Storchaka in branch '3.3':
Issue #19028: Fixed tkinter.Tkapp.merge() for non-string arguments.
http://hg.python.org/cpython/rev/5c1c67d980bb

--
nosy: +python-dev

___
Python tracker 

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



[issue13824] argparse.FileType opens a file and never closes it

2013-09-23 Thread paul j3

paul j3 added the comment:

In this patch I implement a FileContext class.  It differs from FileType
in 2 key areas:

- it returns a 'partial(open, filename, ...)'
- it wraps '-' (stdin/out) in a dummy context protecting the file from closure.

The resulting argument is meant to be used as:

with args.input() as f:
f.read()
etc

The file is not opened until value is called, and it will be closed after the 
block.  stdin/out can also be used in this context, but without closing.

The signature for this class is the same as for FileType, with one added 
parameter, 'style'. (alternative name suggestions welcomed).

class argparse.FileContext(mode='r', bufsize=-1, encoding=None, errors=None, 
style='delayed')

The default behavior, "style='delayed'", is as described above.

"style='evaluate'" immediately calls the partial, returning an opened file.  
This is essentially the same as FileType, except for the stdin/out context 
wrapping.

"style='osaccess'", adds os.acccess testing to determine whether the 'delayed' 
file can be read or written.  It attempts to catch the same sort of OS errors 
that  FileType would, but without actually opening or creating the file.

Most of the added tests in test_argparse.py copy the FileType tests.  I had to 
make some modifications to the testing framework to handle the
added levels of indirection.

I have not written the documentation changes yet.

A sample use case is:

import argparse, sys
p = argparse.ArgumentParser()
p.add_argument('-d','--delayed', type=argparse.FileContext('r'))
p.add_argument('-e','--evaluated', type=argparse.FileContext('r', 
style='evaluate'))
p.add_argument('-t','--test', dest='delayed', 
type=argparse.FileContext('r', style='osaccess'))
p.add_argument('-o','--output', type=argparse.FileContext('w', 
style='osaccess'), default='-')
p.add_argument('--unused', type=argparse.FileContext('w', 
style='osaccess'),help='unused write file')
args = p.parse_args()

with args.output() as o:
if args.delayed:
with args.delayed() as f:
print(f.read(), file=o)
if args.evaluated:
with args.evaluated as f:
print(f.read(), file=o)
# f and o will be closed if regular files
# but not if stdin/out
# the file referenced by args.unused will not be created

--
keywords: +patch
Added file: http://bugs.python.org/file31852/patch_3.diff

___
Python tracker 

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



[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ah, actually, the real issue is that sys.stderr is gone by the time we try to 
print the exception (which explains the "lost sys.stderr" message).

--

___
Python tracker 

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



[issue19079] chameleon benchmark fails on 3.4

2013-09-23 Thread Brett Cannon

Brett Cannon added the comment:

I guess either we introduce compatible version ranges or drop Chameleon from 
3.x compatibility and then add a new version of Chameleon if/when they update 
for Python 3.4 support.

--

___
Python tracker 

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



[issue19034] More useful repr for Tcl_Obj

2013-09-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ece634a69ba8 by Serhiy Storchaka in branch 'default':
Issue #19034: repr() for tkinter.Tcl_Obj now exposes string reperesentation.
http://hg.python.org/cpython/rev/ece634a69ba8

--
nosy: +python-dev

___
Python tracker 

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



[issue18996] unittest: more helpful truncating long strings

2013-09-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue19034] More useful repr for Tcl_Obj

2013-09-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18996] unittest: more helpful truncating long strings

2013-09-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5bb83faa8818 by Serhiy Storchaka in branch 'default':
Issue #18996: TestCase.assertEqual() now more cleverly shorten differing
http://hg.python.org/cpython/rev/5bb83faa8818

--
nosy: +python-dev

___
Python tracker 

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



[issue19078] Allow reversed(memoryview), like memoryview[::-1]

2013-09-23 Thread Claudiu.Popa

New submission from Claudiu.Popa:

Hello. The following seems a little weird:

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit 
(Intel)] on win32
>>> m = memoryview(b'123')
>>> list(m[::-1])
[51, 50, 49]
>>> list(reversed(m))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object of type 'memoryview' has no len()
>>>

The attached patch allows `reversed` to be called with memoryviews and it could 
potentially fix issue18690.

--
components: Interpreter Core
files: memoryview.patch
keywords: patch
messages: 198324
nosy: Claudiu.Popa
priority: normal
severity: normal
status: open
title: Allow reversed(memoryview), like memoryview[::-1]
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file31850/memoryview.patch

___
Python tracker 

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



[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,
 _WTERMSIG=os.WTERMSIG, _WIFEXITED=os.WIFEXITED,
-_WEXITSTATUS=os.WEXITSTATUS):
+_WEXITSTATUS=os.WEXITSTATUS, _SubprocessError=SubprocessError):
 # This method is called (indirectly) by __del__, so it cannot
 # refer to anything outside of its local scope."""

The non-effective """ should be removed. Otherwise LFTM.
Good catch on the non-local dependencies that violated the comment.

--

___
Python tracker 

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



[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'm not sure I understand Nick's suggestion. As far as I can tell, the issue is 
to detect that write() (really fwrite() in 2.x) failed and output the error.

--

___
Python tracker 

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



[issue19079] chameleon benchmark fails on 3.4

2013-09-23 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Not sure what to do about this, but it seems the bundled Chameleon lib doesn't 
work on 3.4:

RuntimeError: Benchmark died: Traceback (most recent call last):
  File "./performance/bm_chameleon.py", line 38, in 
util.run_benchmark(options, options.num_runs, main)
  File "/home/antoine/cpython/benchmarks/performance/util.py", line 30, in 
run_benchmark
data = bench_func(num_runs, *args)
  File "./performance/bm_chameleon.py", line 19, in main
tmpl = PageTemplate(BIGTABLE_ZPT)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/zpt/template.py",
 line 163, in __init__
super(PageTemplate, self).__init__(body, **config)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/template.py",
 line 117, in __init__
self.write(body)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/template.py",
 line 208, in write
self.cook(body)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/template.py",
 line 147, in cook
program = self._cook(body, digest, names)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/template.py",
 line 218, in _cook
source = self._make(body, builtins)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/template.py",
 line 251, in _make
return self._compile(module, builtins)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/template.py",
 line 245, in _compile
compiler = Compiler(self.engine, program, builtins, strict=self.strict)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/compiler.py",
 line 886, in __init__
generator = TemplateCodeGenerator(module)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/codegen.py",
 line 107, in __init__
super(TemplateCodeGenerator, self).__init__(tree)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 172, in __init__
self.visit(tree)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/codegen.py",
 line 192, in visit
super(TemplateCodeGenerator, self).visit(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 232, in visit
ret = visitor(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/codegen.py",
 line 110, in visit_Module
super(TemplateCodeGenerator, self).visit_Module(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 239, in visit_Module
self.visit(n)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/codegen.py",
 line 192, in visit
super(TemplateCodeGenerator, self).visit(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 232, in visit
ret = visitor(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 290, in visit_FunctionDef
self.visit(statement)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/codegen.py",
 line 192, in visit
super(TemplateCodeGenerator, self).visit(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 232, in visit
ret = visitor(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 290, in visit_FunctionDef
self.visit(statement)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/codegen.py",
 line 192, in visit
super(TemplateCodeGenerator, self).visit(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 232, in visit
ret = visitor(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 371, in visit_For
self.visit(statement)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/codegen.py",
 line 192, in visit
super(TemplateCodeGenerator, self).visit(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 232, in visit
ret = visitor(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 371, in visit_For
self.visit(statement)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/codegen.py",
 line 192, in visit
super(TemplateCodeGenerator, self).visit(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 232, in visit
ret = visitor(node)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/astutil.py",
 line 458, in visit_Try
self.visit(statement)
  File 
"/home/antoine/cpython/benchmarks/lib3/Chameleon-2.9.2/src/chameleon/codegen.py",
 line 192, in visit
super(Te

[issue19064] can't run py3 benchmarks

2013-09-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Now done.

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

___
Python tracker 

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



[issue19064] can't run py3 benchmarks

2013-09-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 88b6ef9aa9e9 by Antoine Pitrou in branch 'default':
Issue #19064: let perf.py decide which library path is required for which 
interpreter
http://hg.python.org/benchmarks/rev/88b6ef9aa9e9

--
nosy: +python-dev

___
Python tracker 

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



[issue16038] ftplib: unlimited readline() from connection

2013-09-23 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Barry can you paste the traceback caused by the race condition? What's not 
clear to me is when (what line) it occurs.
One solution might be to send a "NOOP" command (self.client.sendcmd('noop')) in 
order to synchronize client and server.

--

___
Python tracker 

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



[issue17400] ipaddress should make it easy to identify rfc6598 addresses

2013-09-23 Thread pmoody

pmoody added the comment:

ok, here's an is_global/is_private patch using the iana special registry for 
ipv4 and ipv6.

--
keywords: +patch
Added file: http://bugs.python.org/file31851/issue.17400.patch

___
Python tracker 

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



[issue16038] ftplib: unlimited readline() from connection

2013-09-23 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Sep 23, 2013, at 03:36 PM, Serhiy Storchaka wrote:

>What about time.sleep(0.1)?

I usually don't like introducing sleeps to fix race conditions, but if that's
the only option for landing this patch, maybe we'll have to hold our noses and
do it.

--

___
Python tracker 

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



[issue19078] Allow reversed(memoryview), like memoryview[::-1]

2013-09-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +pitrou

___
Python tracker 

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



[issue16038] ftplib: unlimited readline() from connection

2013-09-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +josiahcarlson, stutzbach

___
Python tracker 

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



[issue16038] ftplib: unlimited readline() from connection

2013-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What about time.sleep(0.1)?

--

___
Python tracker 

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



[issue19077] More robust TemporaryDirectory cleanup

2013-09-23 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The proposed patch solves the problem with TemporaryDirectory cleanup. If 
shutil.rmtree() failed because module globals are set to None, 
TemporaryDirectory now uses own rmtree implementation which does not depends 
from globals. The patch also fixes other minor problems related to __del__ and 
fixes do_create() in tests (it deleted subdirectories just after creation).

See also issue10188.

--
components: Library (Lib)
files: tempfile_tempdir_cleanup.patch
keywords: patch
messages: 198321
nosy: georg.brandl, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: More robust TemporaryDirectory cleanup
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31848/tempfile_tempdir_cleanup.patch

___
Python tracker 

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



[issue12085] subprocess.Popen.__del__ raises AttributeError if __init__ was called with an invalid argument list

2013-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch. It fixes also other issues with globals nullification (similar 
to issue19021).

--
Added file: http://bugs.python.org/file31849/subprocess_del.patch

___
Python tracker 

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



[issue19040] Problems with overriding Enum.__new__

2013-09-23 Thread Eli Bendersky

Eli Bendersky added the comment:

On Sun, Sep 22, 2013 at 9:04 PM, Ethan Furman wrote:

>
> Ethan Furman added the comment:
>
> Yup, just trying to add some explanation on how it currently works.
>
> Drekin, I'm sure you've already figured this out, but for those who may
> read this in the future:  what you need is a helper function:
>
> def OptionalEnum(value):
> "could also be OptionalEnum(enum, value)"
> try:
> return SomeEnum(value) # or return enum(value)
> except ValueError:
> return value
>

Hmm, looks suspiciously similar to _inienum_converter from socket.py ;-)

--

___
Python tracker 

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



[issue17777] Unrecognized string literal escape sequences give SyntaxErrors

2013-09-23 Thread Mark Egan-Fuller

Mark Egan-Fuller added the comment:

Python correctly throws a unicode error here, directing the user towards the 
fact that this is an issue specifically with the unicode escaping.

>>> "\u"
  File "", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in 
position 0-1: truncated \u escape


The documentation also states that "Any Unicode character can be encoded this 
way. Exactly eight hex digits are required."[0].

Propose closing this as Won't Fix.

[0]: http://docs.python.org/3/reference/lexical_analysis.html#literals

--
nosy: +markeganfuller, tim.golden

___
Python tracker 

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



[issue1185124] pydoc doesn't find all module doc strings

2013-09-23 Thread STINNER Victor

STINNER Victor added the comment:

+except:
+pass
...
+except TypeError:
+return None

I don't understand these try/except. First, "except: pass" must never be used, 
only catch specific exceptions (ex: AttributeError). Can you explain why you 
expect a TypeError?

If your patch fixes a bug, you must add a new unit test to test_pydoc to check 
for non-regression.

--
nosy: +haypo

___
Python tracker 

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



[issue19040] Problems with overriding Enum.__new__

2013-09-23 Thread Drekin

Drekin added the comment:

Yes, I've done it similarily using a class method. Thank you for help.

--

___
Python tracker 

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



[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Nick Coghlan

Nick Coghlan added the comment:

It seems this can be triggered easily with echo, since that appears to reliably 
close stdin on startup (Discovered via 
http://stackoverflow.com/questions/16314321).

Compare (using a recent trunk build, although I see the same behaviour with the 
system 3.3 installation):

$ ../py3k/python -c 'print("Hello world!")' | echo

Exception ignored in: <_io.TextIOWrapper name='' mode='w' 
encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe

$ ../py3k/python -c 'print("Hello world!")' | xargs echo
Hello world!

$ ../py3k/python -c 'print("Hello world!")' | cat
Hello world!

Given that flush/close related exceptions are automatically ignored in 
destructors, something else must be going on here.

It turns out that the *explicit* flush calls during interpreter finalization 
use PyErr_WriteUnraisable on failure to flush stdout instead of silently 
ignoring the exceptions 
(http://hg.python.org/cpython/file/ed011b0d7daf/Python/pythonrun.c#l457).

This is reasonable, since a broken pipeline *is* an error that the user may 
need to do something about (e.g. as with echo, they next pipeline stage may not 
being invoked correctly, thus breaking the pipe)

However, in the specific case of a broken pipe, I believe it is desirable for 
us to write out a cleaner message than the generic PyErr_WriteUnraisable output.

--
nosy: +ncoghlan, pitrou
title: "close failed in file object destructor" when "Broken pipe" happens on 
stdout -> Improve reporting of broken stdout pipe during interpreter shutdown

___
Python tracker 

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



[issue13404] Add support for system.methodSignature() to XMLRPC Server

2013-09-23 Thread Vajrasky Kok

Vajrasky Kok added the comment:

> How do you infer the data types for the parameters?

I don't think we can, unless we force them to use function annotation. If they 
don't use that feature, then we say the signature is not supported.

The problem is getting deeper if we are talking about return value type.

if a == 1:
  return 'spam'
else:
  return 3.14

I therefore embrace the dynamic nature of Python with this patch.

--
keywords: +patch
nosy: +vajrasky
Added file: 
http://bugs.python.org/file31847/add_method_signature_to_xmlrpc_server.patch

___
Python tracker 

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