[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-08-21 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

What's the purpose of the new patch, particularly 2/2 since it is equivalent to 
multiple push() calls?
I.e. since this issue has laid dormant for two years, what prompts the sudden 
activity?

--

___
Python tracker 

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



[issue15746] test_winsound bombing out on 2003 buildslave

2012-08-21 Thread Trent Nelson

Trent Nelson added the comment:

Affirmative:


E:\Apps\activestate-python-2.7.2.5-x86>python
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import test.test_winsound
>>> test.test_winsound._have_soundcard()
False
>>> import winsound
>>> winsound.PlaySound('!"$%&/(#+*', winsound.SND_ALIAS | 
>>> winsound.SND_NODEFAULT)
>>>

No exception raised.  (No sound is played, either, FWIW.)

I like the approach taken by the method before test_alias_nofallback():

def test_alias_fallback(self):
# This test can't be expected to work on all systems.  The MS
# PlaySound() docs say:
#
# If it cannot find the specified sound, PlaySound uses the
# default system event sound entry instead.  If the function
# can find neither the system default entry nor the default
# sound, it makes no sound and returns FALSE.
#
# It's known to return FALSE on some real systems.

# winsound.PlaySound('!"$%&/(#+*', winsound.SND_ALIAS)
return

I suspect that'll solve all our problems ;-)

--

___
Python tracker 

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



[issue15759] "make suspicious" doesn't display instructions in case of failure

2012-08-21 Thread Ezio Melotti

New submission from Ezio Melotti:

I was running "make suspicious" in Doc/ and this was the output after finding 3 
suspicious markups:

 writing output... [ 52%] library/inspect
 WARNING: [library/inspect:437] ":int" found in ">>> def foo(a, *, b:int, 
**kwargs):"
 WARNING: [library/inspect:437] ":int" found in "'(a, *, b:int, **kwargs)'"
 WARNING: [library/inspect:437] ":int" found in "'b:int'"
 writing output... [100%] whatsnew/index
 build finished with problems, 3 warnings.
 make: *** [build] Error 1

After figuring out how to mark these as false positives and adding the relevant 
entries to susp-ignored.csv, I ran "make suspicious" again, and got this useful 
message at the end:

 writing output... [100%] whatsnew/index
 build succeeded.

 Suspicious check complete; look for any errors in the above output or in 
build/suspicious /suspicious.csv.  If all issues are false positives, append 
that file to tools/sphinxext/susp-ignored.csv.

The problem is that this message should be displayed when there are failures, 
but it's not.

Attached an attempt to fix the Makefile to avoid exiting in case of failures 
when the builder is "suspicious".  Given that I'm not really familiar with 
makefiles, it probably doesn't make much sense.

--
assignee: docs@python
components: Documentation
files: issue15759.diff
keywords: patch
messages: 168842
nosy: docs@python, eric.araujo, ezio.melotti, georg.brandl
priority: normal
severity: normal
stage: patch review
status: open
title: "make suspicious" doesn't display instructions in case of failure
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26956/issue15759.diff

___
Python tracker 

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



[issue665194] datetime-RFC2822 roundtripping

2012-08-21 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> So since the other tests were passing before, presumably there
> is some test that could be added to exercise the bug you were
> fixing.  Do you remember what that was?

Yes, the issue was the one that was mentioned in an XXX comment: in many places 
UTC offset was different at different historical times but standard C library 
and Python's time module provides a single constant for it.  There are plenty 
of examples that can be found in Olson's database (Europe/Kiev comes to mind), 
but it is not easy to devise a test that will work cross-platform.  Maybe we 
should just restrict the test to Linux/BSD family of OSes?

--

___
Python tracker 

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



[issue15316] runpy swallows ImportError information with relative imports

2012-08-21 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
keywords: +3.2regression

___
Python tracker 

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



[issue665194] datetime-RFC2822 roundtripping

2012-08-21 Thread R. David Murray

R. David Murray added the comment:

And my tests and code were wrong, and I was wrong about what you were trying to 
fix.  So since the other tests were passing before, presumably there is some 
test that could be added to exercise the bug you were fixing.  Do you remember 
what that was?

--
Added file: http://bugs.python.org/file26955/localtime.patch

___
Python tracker 

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



[issue15750] test_localtime_daylight_false_dst_true raises OverflowError: mktime argument out of range

2012-08-21 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> So you are saying that if the current timezone is UTC, FreeBSD's mktime
> just arbitrarily returns -1 for any time passed to it with the 'guess
> the DST flag' value set for is_dst?

I don't know about FreeBSD, but I recall seeing a comment in mxDT sources that 
some systems only allow isdst flag of -1 in mktime.

Adding Marc-Andre.

--
nosy: +lemburg

___
Python tracker 

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



[issue665194] datetime-RFC2822 roundtripping

2012-08-21 Thread R. David Murray

R. David Murray added the comment:

Heh, I was just copying the previous code, and didn't think about being able to 
update it.  Will make that change.

--

___
Python tracker 

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



[issue665194] datetime-RFC2822 roundtripping

2012-08-21 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I noticed this part:

+# We have an aware datetime.  Use aware datetime arithmetic to find the
+# seconds since the epoch.
+delta = dt - datetime.datetime(*time.gmtime(0)[:6],
+   tzinfo=datetime.timezone.utc)
+seconds = delta.total_seconds()

Why don't you just return dt.astimezone() here?  A round trip through a 
floating point timestamp always makes me nervous.  I doubt loss of precision is 
a problem for the e-mail package, but who knows.

--

___
Python tracker 

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



[issue15750] test_localtime_daylight_false_dst_true raises OverflowError: mktime argument out of range

2012-08-21 Thread R. David Murray

R. David Murray added the comment:

So you are saying that if the current timezone is UTC, FreeBSD's mktime just 
arbitrarily returns -1 for any time passed to it with the 'guess the DST flag' 
value set for is_dst?  And for is_dst set to 1 as well?  This isn't mentioned 
on the FreeBSD man page for mktime, as far as I can see.

If this is the real problem, we can fix it with the support.run_with_tz 
decorator, but...compiling and running your program on my linux box, I get -1 
in both prints.

--

___
Python tracker 

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



[issue665194] datetime-RFC2822 roundtripping

2012-08-21 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I'll take a look tomorrow morning. (EDT:-)

--

___
Python tracker 

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



[issue665194] datetime-RFC2822 roundtripping

2012-08-21 Thread R. David Murray

R. David Murray added the comment:

Alexander, this slipped off my radar.

Some of the tests Brian added fail with the patch applied.  I fixed most of 
them by adding back the support for converting an aware datetime to an aware 
localtime.  The remaining two I believe are what you are fixing with this patch 
(in addition to converting to using astimezone for the current-localtime case). 
 So there I fixed the tests.

Hopefully I got this right, and hopefully you can find time to review it.  I'll 
probably check it in before the RC regardless, since it looks like an 
improvement to me.

--
Added file: http://bugs.python.org/file26954/localtime.patch

___
Python tracker 

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



[issue15207] mimetypes.read_windows_registry() uses the wrong regkey, creates wrong mappings

2012-08-21 Thread Yap Sok Ann

Yap Sok Ann added the comment:

On Python 2.7, I need to add this to the original diff by Dave, in the same 
try-except block:

mimetype = mimetype.encode(default_encoding) # omit in 3.x!

--
nosy: +sayap

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Graham Dumpleton

Graham Dumpleton added the comment:

If you have a Ex version of Ensure, then if the interpreter argument is NULL, 
then it should assume main interpreter. That way the normal version of Ensure 
can just call PyGILState_EnsureEx(NULL).

--

___
Python tracker 

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



[issue1207589] Right Click Context Menu

2012-08-21 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue15316] runpy swallows ImportError information with relative imports

2012-08-21 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I ran into this again because an error while running `./python.exe -m test` was 
getting masked.  The use of __main__.py in the package may be the 
distinguishing characteristic.

--

___
Python tracker 

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



[issue15316] runpy swallows ImportError information with relative imports

2012-08-21 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I randomly ran into this issue again.  I'm not sure this was ever resolved 
(i.e. I think it may always have been different from issue 15111).

I still get the above behavior in the default branch.

And here is what I get in the 3.2 branch (the error information is not 
swallowed):
 
$ ./python.exe -m foo
***
Traceback (most recent call last):
  File ".../Lib/runpy.py", line 161, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File ".../Lib/runpy.py", line 74, in _run_code
exec(code, run_globals)
  File ".../foo/__main__.py", line 1, in 
from foo import bar
  File "foo/bar.py", line 2, in 
raise ImportError('test...')
ImportError: test...

--
nosy: +brett.cannon, ncoghlan
resolution: duplicate -> 
status: closed -> open
superseder: Wrong ImportError message with importlib -> 
type:  -> behavior

___
Python tracker 

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



[issue15758] 500x speed up for Popen.communicate() on Windows

2012-08-21 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> FileIO.readall() already has an overallocation mechanism which should 
> yield linear complexity. Perhaps it needs to be tweaked a bit?
> (look at new_buffersize in Modules/_io/fileio.c)

I think it needs a bit more than a tweak;-)  Looks like it increases by 12.5% 
at time.  Does not seem to work as intended though.

> By the way, your results are bit weird. Why does the data rate increase 
> with the transfered amount?

The rates are completely unreliable for those benchmarks which take less than 
0.1 seconds.  They level off after 0.1 secs when the overheads become 
insignificant.

--

___
Python tracker 

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS

2012-08-21 Thread Trent Nelson

Trent Nelson added the comment:

Oh, heh, yes, I meant double :-)

--

___
Python tracker 

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



[issue15747] Various chflags tests failing on FreeBSD/ZFS

2012-08-21 Thread Trent Nelson

Changes by Trent Nelson :


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

___
Python tracker 

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



[issue15747] Various chflags tests failing on FreeBSD/ZFS

2012-08-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f986d523e93d by Trent Nelson in branch 'default':
Issue #15747: skip chflags UF_IMMUTABLE tests if EOPNOTSUPP is raised.
http://hg.python.org/cpython/rev/f986d523e93d

--

___
Python tracker 

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



[issue15758] 500x speed up for Popen.communicate() on Windows

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

FileIO.readall() already has an overallocation mechanism which should yield 
linear complexity. Perhaps it needs to be tweaked a bit?
(look at new_buffersize in Modules/_io/fileio.c)

By the way, your results are bit weird. Why does the data rate increase with 
the transfered amount?

--

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
resolution: works for me -> invalid
stage: needs patch -> committed/rejected

___
Python tracker 

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



[issue15758] 500x speed up for Popen.communicate() on Windows

2012-08-21 Thread Richard Oudkerk

Richard Oudkerk added the comment:

RawIOBase.readall() does the sensible thing already.  Maybe FileIO should be 
allowed to inherit it.

The alternative patch (which probably only works for raw unbuffered case)

diff -r ca54c27a9045 Lib/subprocess.py
--- a/Lib/subprocess.py Tue Aug 21 14:54:22 2012 +0100
+++ b/Lib/subprocess.py Wed Aug 22 00:39:32 2012 +0100
@@ -1152,7 +1152,7 @@


 def _readerthread(self, fh, buffer):
-buffer.append(fh.read())
+buffer.append(io.RawIOBase.readall(fh))
 fh.close()

produces

amount = 1 MB; time taken = 0.01 secs; rate = 71.42 MB/s
amount = 2 MB; time taken = 0.02 secs; rate = 83.33 MB/s
amount = 4 MB; time taken = 0.04 secs; rate = 105.26 MB/s
amount = 8 MB; time taken = 0.06 secs; rate = 135.59 MB/s
amount = 16 MB; time taken = 0.09 secs; rate = 170.20 MB/s
amount = 32 MB; time taken = 0.17 secs; rate = 190.46 MB/s
amount = 64 MB; time taken = 0.32 secs; rate = 202.52 MB/s
amount = 128 MB; time taken = 0.61 secs; rate = 211.56 MB/s

--

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread John Taylor

John Taylor added the comment:

Please close this ticket. This is not a bug.

As per cjerdonek's suggestion, defining a constraint as follows:

constraint my_name check (...)

returns the actual name of the constraint, when it fails:

sqlite3.IntegrityError: constraint my_name failed

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue15747] Various chflags tests failing on FreeBSD/ZFS

2012-08-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 019a2390b014 by Trent Nelson in branch '3.2':
Issue #15747: skip chflags UF_IMMUTABLE tests if EOPNOTSUPP is raised.
http://hg.python.org/cpython/rev/019a2390b014

--
nosy: +python-dev

___
Python tracker 

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS

2012-08-21 Thread Larry Hastings

Larry Hastings added the comment:

mtime is never converted into a "decimal".  Do you perhaps mean "double"?

--

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread Ned Deily

Ned Deily added the comment:

The magic for building the standard library's dynamically loaded extensions is 
in the top-level setup.py.  It uses Distutils to do the work with a lot of 
hacking around in setup.py.  Without modifying setup.py, it can be a little 
tricky to override the search order if you are trying to substitute a library 
that already exists in one of the normal system locations, particularly if you 
only want to override for that particular library.  Perhaps the easiest and 
surest approach is to build and install the library (in this case libsqlite3) 
into a unique install root and then include the paths to the include and lib 
directories in the ./configure command for Python, so something like:

   ./configure [other options] LDFLAGS='-L /path/to/sqlite3/lib ' CPPFLAGS='-I 
/path/to/sqlite3/include '

--

___
Python tracker 

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



[issue13520] Patch to make pickle aware of __qualname__

2012-08-21 Thread Richard Oudkerk

Richard Oudkerk added the comment:

There is a cute way to use operator.attrgetter to produce backwards compatible 
pickles using the qualname:

import pickle, copyreg, operator, sys, pickletools, types

class AttrGetter(object):
def __init__(self, name):
self.name = name
def __call__(self): # pretend to be callable
raise RuntimeError
def __reduce__(self):
return operator.attrgetter, (self.name,)

def reduce_by_qualname(obj):
mod = sys.modules[obj.__module__]
first, rest = obj.__qualname__.split('.', 1)
firstobj = getattr(mod, first)
assert operator.attrgetter(rest)(firstobj) is obj
return AttrGetter(rest), (firstobj,)

# FunctionType defaults to save_global but uses fallback if it fails
copyreg.pickle(types.FunctionType, reduce_by_qualname)

class A(object):
class B(object):
class C(object):
@staticmethod
def foo():
print("foo foo foo")

def bar():
print("bar bar bar")

for obj in [A.B.C.foo, bar]:
data = pickle.dumps(obj, 2)
pickletools.dis(data)
func = pickle.loads(data)
assert func is obj
func()

This produces

0: \x80 PROTO  2
2: cGLOBAL 'operator attrgetter'
   23: qBINPUT 0
   25: XBINUNICODE 'B.C.foo'
   37: qBINPUT 1
   39: \x85 TUPLE1
   40: qBINPUT 2
   42: RREDUCE
   43: qBINPUT 3
   45: cGLOBAL '__main__ A'
   57: qBINPUT 4
   59: \x85 TUPLE1
   60: qBINPUT 5
   62: RREDUCE
   63: qBINPUT 6
   65: .STOP
highest protocol among opcodes = 2
foo foo foo
0: \x80 PROTO  2
2: cGLOBAL '__main__ bar'
   16: qBINPUT 0
   18: .STOP
highest protocol among opcodes = 2
bar bar bar

--

___
Python tracker 

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



[issue15758] 500x speed up for Popen.communicate() on Windows

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Yes, I think FileIO.readall() should be fixed rather than avoided.

--
nosy: +pitrou
versions: +Python 3.4

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Those macros only work for general GIL releasing and pop straight
> away, not for the case where released, calls into some non Python C
> library, which then calls back into Python.

I see, so you are right that this new API could be useful. However, we
should also add a new GIL state API that fixes the issue for good (by
passing an interpreter), otherwise we will still have such discussions
in five years and it will be very silly.

> My recollection is, and so unless they have changed it, SWIG generated
> calls use the GILState calls. See:

Well, if SWIG isn't fixed, people should stop using an unmaintained and
buggy tool.

--

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> When building CPython yourself, it will use what version is found on your 
> system.

Ned, this is somewhat off-topic to the issue, but do you know of any ways to 
tell CPython to use a particular version of sqlite3 at compile time if a system 
has different versions installed at different locations?  Or perhaps by putting 
the SQLite source code at an appropriate location in the Python source 
hierarchy (e.g. using the SQLite amalgamation files: 
http://www.sqlite.org/download.html )

--

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Graham Dumpleton

Graham Dumpleton added the comment:

Those macros only work for general GIL releasing and pop straight away, not for 
the case where released, calls into some non Python C library, which then calls 
back into Python.

My recollection is, and so unless they have changed it, SWIG generated calls 
use the GILState calls. See:

https://issues.apache.org/jira/browse/MODPYTHON-217

--

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le mardi 21 août 2012 à 22:14 +, Graham Dumpleton a écrit :
> Any third party module then which uses the simplistic calling sequence
> of calling PyGILState_Release() on exiting Python code and thence
> within the same thread calling PyGILState_Ensure() when coming back
> into Python with a callback will work, as mod_wsgi has specified the
> interpreter context for that thread at that time.

Why would a module do that, instead of using
Py_{BEGIN,END}_ALLOW_THREADS?

--

___
Python tracker 

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



[issue15748] Various symlink test failures in test_shutil on FreeBSD

2012-08-21 Thread Trent Nelson

Trent Nelson added the comment:

Well, bugger me, check this out:


import os
import stat
import tempfile

d = tempfile.mkdtemp()
src = os.path.join(d, 'foo')
dst = os.path.join(d, 'bar')
src_link = os.path.join(d, 'baz')
dst_link = os.path.join(d, 'qux')

sf = open(dst, 'w')
sf.write('foo')
sf.flush()
sf.close()

df = open(dst, 'w')
df.write('bar')
df.flush()
df.close()

os.symlink(src, src_link)
os.symlink(dst, dst_link)

os.lchmod(src_link, stat.S_IRWXU | stat.S_IRWXO)

os.readlink(dst_link)
os.readlink(src_link)


Results of the last two calls:
>>> os.readlink(dst_link)

path 1: /tmp/tmpfz5v6h/qux, length 1: 18, buf 1: /tmp/tmpfz5v6h/bar
path 2: /tmp/tmpfz5v6h/qux, length 2: 18, buf 2: /tmp/tmpfz5v6h/bar
'/tmp/tmpfz5v6h/bar'
[73299 refs]
>>> os.readlink(src_link)

path 1: /tmp/tmpfz5v6h/baz, length 1: 24, buf 1: /tmp/tmpfz5v6h/foo
path 2: /tmp/tmpfz5v6h/baz, length 2: 24, buf 2: /tmp/tmpfz5v6h/foo
'/tmp/tmpfz5v6h/foo\x00\x00\x00\x00\x00\x00'
[73299 refs]

So, without the os.lchmod() call, the length is returned correctly.  With it, 
it gets returned as 24.  Looks like an OS bug.

--

___
Python tracker 

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



[issue15758] 500x speed up for Popen.communicate() on Windows

2012-08-21 Thread Richard Oudkerk

Changes by Richard Oudkerk :


--
keywords: +patch
Added file: http://bugs.python.org/file26953/popen_communicate.patch

___
Python tracker 

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



[issue15758] 500x speed up for Popen.communicate() on Windows

2012-08-21 Thread Richard Oudkerk

New submission from Richard Oudkerk:

Piping significant amounts of data through a subprocess using 
Popen.communicate() is crazily slow on Windows.

The attached program just pushes data through mingw's cat.exe.

Python 3.3:
amount = 1 MB; time taken = 0.07 secs; rate = 13.51 MB/s
amount = 2 MB; time taken = 0.31 secs; rate = 6.51 MB/s
amount = 4 MB; time taken = 1.30 secs; rate = 3.08 MB/s
amount = 8 MB; time taken = 5.43 secs; rate = 1.47 MB/s
amount = 16 MB; time taken = 21.64 secs; rate = 0.74 MB/s
amount = 32 MB; time taken = 87.36 secs; rate = 0.37 MB/s

Python 2.7:
amount = 1 MB; time taken = 0.02 secs; rate = 66.67 MB/s
amount = 2 MB; time taken = 0.03 secs; rate = 68.97 MB/s
amount = 4 MB; time taken = 0.05 secs; rate = 76.92 MB/s
amount = 8 MB; time taken = 0.10 secs; rate = 82.47 MB/s
amount = 16 MB; time taken = 0.27 secs; rate = 60.38 MB/s
amount = 32 MB; time taken = 0.88 secs; rate = 36.36 MB/s
amount = 64 MB; time taken = 3.20 secs; rate = 20.03 MB/s
amount = 128 MB; time taken = 12.36 secs; rate = 10.35 MB/s

For Python 3.3 this looks like O(n^2) complexity to me.  2.7 is better but 
still struggles for large amounts.

Changing Popen._readerthread() to read in chunks rather than using 
FileIO.readall() produces a huge speed up:

Python 3.3 with patch:
amount = 1 MB; time taken = 0.01 secs; rate = 76.92 MB/s
amount = 2 MB; time taken = 0.03 secs; rate = 76.92 MB/s
amount = 4 MB; time taken = 0.04 secs; rate = 111.10 MB/s
amount = 8 MB; time taken = 0.05 secs; rate = 148.14 MB/s
amount = 16 MB; time taken = 0.10 secs; rate = 156.85 MB/s
amount = 32 MB; time taken = 0.16 secs; rate = 198.75 MB/s
amount = 64 MB; time taken = 0.31 secs; rate = 205.78 MB/s
amount = 128 MB; time taken = 0.61 secs; rate = 209.82 MB/s

Maybe FileIO.readall() should do something similar for files whose size cannot 
be determined by stat().

--
components: Library (Lib)
files: push-thru-cat.py
messages: 168813
nosy: sbt
priority: normal
severity: normal
stage: patch review
status: open
title: 500x speed up for Popen.communicate() on Windows
type: performance
Added file: http://bugs.python.org/file26952/push-thru-cat.py

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Graham Dumpleton

Graham Dumpleton added the comment:

In both embedded mode and daemon mode of mod_wsgi, albeit how thread pool is 
managed is different, there is a fixed number of threads with those being 
dedicated to handling web requests.

On a request arriving next available thread from the thread pool handles 
accepting of request at C code level, that thread may then map to any WSGI 
application and so any sub interpreter, or even the main interpreter.

Thus there is no one to one mapping between thread and (sub)interpreter.

The way the mod_wsgi code works now is that when it knows it will be calling 
into the main interpreter, it uses PyGILState_Ensure(). If not, it will use a 
thread state for that thread specific to the sub interpreter it is calling in 
to. At the end of the request, the thread state is remembered and not thrown 
away so that thread locals still work for that thread across requests for that 
sub interpreter.

Thus, there can be more than one thread state per thread, but this is fine so 
long as it is only used against the sub interpreter it was created for.

This is actually an enforced requirement of Python, because if you create more 
than one thread state for a thread for the same sub interpreter, or even an 
additional one for the main interpreter when there is also the auto TLS, then 
Python will die if you compile and run it is in debug mode.

Now, since mod_wsgi always knows which interpreter it is calling into, the 
intent was that there was this single API call so that mod_wsgi could say that 
at this time, this thread is going to be calling into that interpreter. It 
could then just call PyGILState_Ensure().

Any third party module then which uses the simplistic calling sequence of 
calling PyGILState_Release() on exiting Python code and thence within the same 
thread calling PyGILState_Ensure() when coming back into Python with a callback 
will work, as mod_wsgi has specified the interpreter context for that thread at 
that time.

As pointed out, if a third party module was creating its own background threads 
at C level and calling PyGILState_Ensure() when calling back into Python code, 
this could pose a problem. This could also be an issue for Python created 
background threads.

In the case of the latter, if a Python thread is created in a specific sub 
interpreter, it should automatically designate for that thread that that is its 
interpreter context, so if it calls out and does the Release/Ensure dance, that 
it goes back into the same sub interpreter.

The C initiated thread is a bit more complicated though and may not be 
solvable, but a lot of the main third party modules which don't work in sub 
interpreters, such as lxml, don't use background threads, so the simplistic 
approach means that will work at least.

So, in summary, saw a single API call which allowed designation of which 
interpreter a thread is operating against, overriding the implicit default of 
the main interpreter. PyGILState API will need to manage a set of interpreter 
states for each interpreter, with potential for more than one thread state for 
a thread due to a thread being able to call into multiple interpreters at 
different times.

--

___
Python tracker 

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS

2012-08-21 Thread Trent Nelson

Trent Nelson added the comment:

>>> print(_have_functions)
['HAVE_FACCESSAT', 'HAVE_FCHDIR', 'HAVE_FCHMOD', 'HAVE_FCHMODAT', 
'HAVE_FCHOWN', 'HAVE_FEXECVE', 'HAVE_FDOPENDIR', 'HAVE_FPATHCONF', 
'HAVE_FSTATAT', 'HAVE_FSTATVFS', 'HAVE_FTRUNCATE', 'HAVE_FUTIMES', 
'HAVE_FUTIMESAT', 'HAVE_LINKAT', 'HAVE_LCHFLAGS', 'HAVE_LCHMOD', 'HAVE_LCHOWN', 
'HAVE_LSTAT', 'HAVE_LUTIMES', 'HAVE_MKDIRAT', 'HAVE_MKFIFOAT', 'HAVE_MKNODAT', 
'HAVE_OPENAT', 'HAVE_READLINKAT', 'HAVE_RENAMEAT', 'HAVE_SYMLINKAT', 
'HAVE_UNLINKAT']

/usr/include/utime.h exists.

FWIW, when I stepped through it a few nights ago, I remember that all the code 
paths eventually visited the point where the mtime gets converted into a 
decimal:

==
FAIL: test_utime (test.test_os.StatAttributeTests)
--
Traceback (most recent call last):
  File 
"/home/buildslave/cpython/3.x.snakebite-freebsd91-amd64/build/Lib/test/test_os.py",
 line 331, in test_utime
self._test_utime(self.fname, getattr, utime, 10)
  File 
"/home/buildslave/cpython/3.x.snakebite-freebsd91-amd64/build/Lib/test/test_os.py",
 line 318, in _test_utime
self.assertEqual(attr(st0, "st_mtime"), attr(st1, "st_mtime"))
AssertionError: 1345497270.8923829 != 1345497270.892382

However, for the other errors:
AssertionError: 1345497270884503433 != 1345497270884503000
AssertionError: 134549727047634 != 134549727047000
they'd get cast back before the assertEqual test would be done.

As for this:
1345497270.8923829 != 1345497270.892382

The trailing 9 is getting lopped off, which results in the rounding errors.

--

___
Python tracker 

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



[issue15757] ./configure --with-pydebug on FreeBSD results in -O2 -pipe eventually ending up in CFLAGS.

2012-08-21 Thread Trent Nelson

Trent Nelson added the comment:

So, looks like FreeBSD's /usr/share/mk/sys.mk is to blame here.  It 
unconditionally sets CFLAGS to `-O2 -pipe`.


[trent@hydrogen/ttypts/1(~s/cpython)%] uname -a
FreeBSD hydrogen.snakebite.net 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r0: Mon 
Jul 16 06:28:19 UTC 2012 
r...@hydrogen.snakebite.net:/usr/obj/src/freebsd/9/r238513m/sys/AMD64  amd64

[trent@hydrogen/ttypts/1(~s/cpython)%] grep -A3 'bsd_make_test' Makefile
bsd_make_test:
@echo "CFLAGS: $(CFLAGS)"
@echo "EXTRA_CFLAGS: $(EXTRA_CFLAGS)"

[trent@hydrogen/ttypts/1(~s/cpython)%] make bsd_make_test
CFLAGS: -O2 -pipe 
EXTRA_CFLAGS: 

[trent@hydrogen/ttypts/1(~s/cpython)%] make CFLAGS= bsd_make_test
CFLAGS: 
EXTRA_CFLAGS: 

I can think of a few ways to work around this... some better than others.

1. Change the FreeBSD buildbots to always invoke make via `make CFLAGS=`.

2. Hack configure.* to automatically invoke make via `make CFLAGS=` when `-O2 
-pipe` crops up in a `--with-pydebug` build.

Some of the less desirable ones:

3. Switch FreeBSD to gmake.

4. Patch FreeBSD make so that it is 'debug aware' and stops appending `-O2` 
everywhere.

--

___
Python tracker 

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



[issue15642] Integrate pickle protocol version 4 GSoC work by Stefan Mihaila

2012-08-21 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Some quick thoughts about the new implicit memoization scheme in Stefan's 
implementation. 

- The new scheme will need to be documented in PEP 3154 before we can accept 
the change.
- I don't really like the idea of changing the semantics of the PUT and GET 
opcodes. I would prefer new opcodes if possible.
- I would like to see benchmarks for this change.

--

___
Python tracker 

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS

2012-08-21 Thread Larry Hastings

Larry Hastings added the comment:

Can you tell me which code path it took?  Either by walking through the code as 
it runs, or by telling me about the preprocessor defines used by utime 
(HAVE_FUTIMES, HAVE_FUTIMENS, HAVE_FUTIMESAT, HAVE_UTIMENSAT, HAVE_UTIMES, 
HAVE_UTIME_H).  The easy way to do this would be to say

from posix import _have_functions
print(_have_functions)

and paste the result in.  Then also tell me if you have a file "utime.h" in 
either your standard include directory or in the "sys" subdirectory of that 
directory.

--

___
Python tracker 

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



[issue15757] ./configure --with-pydebug on FreeBSD results in -O2 -pipe eventually ending up in CFLAGS.

2012-08-21 Thread Trent Nelson

Trent Nelson added the comment:

Ah!


% gmake
gcc -pthread -c -fno-strict-aliasing -g -O0 -Wall -Wstrict-prototypes-I. 
-I./Include-DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c
gcc -pthread -c -fno-strict-aliasing -g -O0 -Wall -Wstrict-prototypes-I. 
-I./Include-DPy_BUILD_CORE -o Parser/acceler.o Parser/acceler.c
^C

% make

% make
gcc -pthread -c -fno-strict-aliasing -g -O0 -Wall -Wstrict-prototypes  -O2 
-pipe   -I. -I./Include-DPy_BUILD_CORE -o Modules/python.o 
./Modules/python.c
gcc -pthread -c -fno-strict-aliasing -g -O0 -Wall -Wstrict-prototypes  -O2 
-pipe   -I. -I./Include-DPy_BUILD_CORE -o Parser/acceler.o Parser/acceler.c
gcc -pthread -c -fno-strict-aliasing -g -O0 -Wall -Wstrict-prototypes  -O2 
-pipe   -I. -I./Include-DPy_BUILD_CORE -o Parser/grammar1.o 
Parser/grammar1.c
^C

So, the default BSD make likes to add in -O2 -pipe.  I'll do a bit more digging.

--

___
Python tracker 

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



[issue15748] Various symlink test failures in test_shutil on FreeBSD

2012-08-21 Thread Trent Nelson

Trent Nelson added the comment:

Hi Larry,

Funnily enough, I just tried to step through a heavily hacked version of 
posix_readlink again, only to get gdb telling me I couldn't 'print' the 
variables I had added in.

Turns out, `./configure --with-pydebug` on FreeBSD ends up with '-O2' being 
appended to CFLAGS some how.  I've raised a separate issue for this: 
http://bugs.python.org/issue15748.

--

___
Python tracker 

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



[issue15757] ./configure --with-pydebug on FreeBSD results in -O2 -pipe eventually ending up in CFLAGS.

2012-08-21 Thread Trent Nelson

New submission from Trent Nelson:

All the FreeBSD build slaves seem to be experiencing the same symptom: 
./configure --with-pydebug eventually results in this:

gcc -pthread -c -fno-strict-aliasing -g -O0 -Wall -Wstrict-prototypes  -O2 
-pipe -fno-strict-aliasing -Wall -march=native   -I. -I./Include
-DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c

What I find odd:

  % grep -e '-O2' Makefile | wc -l
 0

There are references to -O2 elsewhere, like in configure.ac|configure, but, the 
Makefile doesn't source any of those.  (Right?)

This is occurring on all of my slaves as well as others, so I'm pretty sure 
it's not just specific to my environment.

--
assignee: trent
messages: 168805
nosy: koobs, skrah, trent
priority: normal
severity: normal
status: open
title: ./configure --with-pydebug on FreeBSD results in -O2 -pipe eventually 
ending up in CFLAGS.
type: behavior
versions: Python 3.2, Python 3.3

___
Python tracker 

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



[issue15748] Various symlink test failures in test_shutil on FreeBSD

2012-08-21 Thread Larry Hastings

Larry Hastings added the comment:

I'll ask the obvious: was that an optimized build?  Not that that explains the 
bug--but that might explain why "length" appeared to contain 24.

It's hard to believe this is really an OS bug...

--

___
Python tracker 

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



[issue14468] Update cloning guidelines in devguide

2012-08-21 Thread Éric Araujo

Éric Araujo added the comment:

FWIW I agree with Antoine’s comments.

--

___
Python tracker 

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



[issue15637] Segfault reading null VMA (works fine in python 2.x)

2012-08-21 Thread R. David Murray

Changes by R. David Murray :


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

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread John Taylor

John Taylor added the comment:

Chris,

I will try naming the constraints and will then follow-up.

--

___
Python tracker 

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



[issue15748] Various symlink test failures in test_shutil on FreeBSD

2012-08-21 Thread Georg Brandl

Changes by Georg Brandl :


--
nosy: +larry

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I haven't been able to test this via Python because my system sqlite3 version 
isn't new enough.  But I was able to test this against sqlite3 directly.  I 
suspect there may be no issue.

John, have you tried naming your constraint?

http://www.sqlite.org/syntaxdiagrams.html#column-constraint

Specifically, if I try your example in sqlite3 3.7.13 (from the command-line, 
independent of Python), I get the generic error message:

"Error: constraint failed"

But if I add "CONSTRAINT name" to your test case SQL, e.g.

create table test1 (
db_insert_date   timestamp,
CONSTRAINT test_constraint1
check(cast(substr(db_insert_date,1,4) as integer) <= 2025),
CONSTRAINT test_constraint2
check(cast(substr(db_insert_date,6,2) as integer) <= 12)
);

I get the error message "Error: constraint test_constraint2 failed".

I suspect things will work fine in Python because the Python code seems simply 
to use whatever error message sqlite3 provides it:

case SQLITE_CONSTRAINT:
case SQLITE_MISMATCH:
PyErr_SetString(pysqlite_IntegrityError, sqlite3_errmsg(db));
break;

(from http://hg.python.org/cpython/file/ca54c27a9045/Modules/_sqlite/util.c#l92 
)

--

___
Python tracker 

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



[issue10712] 2to3 fixer for deprecated unittest method names

2012-08-21 Thread Ezio Melotti

Ezio Melotti added the comment:

Ping.

--

___
Python tracker 

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



[issue15756] subprocess.poll() does not handle errno.ECHILD "No child processes"

2012-08-21 Thread Todd Whiteman

Todd Whiteman added the comment:

The attached patch handles errno.ECHILD in the _internal_poll() method and I've 
updated the existing "sigchild_ignore.py" test file to perform polling as well.

An unpatched version of Pyhton would normally hang on this particular test, 
whilst the patched version will run successfully.

--
keywords: +patch
Added file: http://bugs.python.org/file26951/issue15756_poll_v1.patch

___
Python tracker 

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



[issue15756] subprocess.poll() does not handle errno.ECHILD "No child processes"

2012-08-21 Thread Todd Whiteman

Changes by Todd Whiteman :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue15756] subprocess.poll() does not handle errno.ECHILD "No child processes"

2012-08-21 Thread Todd Whiteman

New submission from Todd Whiteman:

In the case of a "errno.ECHILD" exception - Python's subprocess module misses 
the fact that the process has already ended.

The following code will wait indefinitely, even though the launched process is 
quickly ended:

import subprocess, signal
signal.signal(signal.SIGCLD, signal.SIG_IGN)
p = subprocess.Popen(['echo','foo'])
while p.poll() is None:
   pass # wait for the process to exit

Note: This is the exact same issue as issue1731717, but applying to the 
subprocess.poll() method instead of the subprocess.wait() method.

--
components: Library (Lib)
messages: 168798
nosy: twhitema
priority: normal
severity: normal
status: open
title: subprocess.poll() does not handle errno.ECHILD "No child processes"
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue6422] timeit called from within Python should allow autoranging

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> In #5442, I proposed leaving the architecture of the module alone, and 
> simply exposing the main module functionality as a high level helper
> function:

Agreed with Nick's approach above.

Victor, if you want to improve timeit's reliability, please open a separate 
issue.

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue6422] timeit called from within Python should allow autoranging

2012-08-21 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread Ned Deily

Ned Deily added the comment:

Keep in mind that Python itself does not release with nor mandate a specific 
version of sqlite3.  When building CPython yourself, it will use what version 
is found on your system.  Distributors of built Pythons, including the 
python.org Windows and OS X installers, may supply a local version or, in some 
cases, may link dynamically with an operating system supplied version.  So any 
changes to Python's sqlite3 module and support extension module have to 
continue to check at either build or run time whether version-specific features 
are available.

--
nosy: +ned.deily

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I would be happy to take a look at this and propose a patch.

--
nosy: +cjerdonek

___
Python tracker 

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



[issue8109] Server-side support for TLS Server Name Indication extension

2012-08-21 Thread danblack

danblack added the comment:

test_sni not working. getpeercert() not returning a certificate.

--
keywords: +patch
nosy: +daniel-black
Added file: http://bugs.python.org/file26950/issue8109_server_side_sni.patch

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Umm, no. The whole point of the GILState API is that you can call it
> from a thread which knows *nothing* about Python.

No to what? Any sane callback API allows to pass it some user data, that
user data can just as well include the pointer to the desired
interpreter. Really, that's the right way to do it. Since a new API is
required, we can indeed add tweaks to the current API until the
migration is done, but I'm quite sure any proper solution to the problem
requires explicitly passing the interpreter.

> There are going to be limitations on how effective this will be - it
> still won't support *all* extension modules that use the PyGILState
> APIs. It will, however, support many more of them than the status quo

I still don't understand how that allows to "support some extension
modules" (which ones?).
A typical mod_wsgi setup uses several threads per daemon process, and
each thread (AFAIU) uses a separate subinterpreter for its WSGI
application instance (Graham, is that false?). Therefore, an
externally-launched thread can relate to *any* of these subintepreters,
which are themselves scheduled by the OS.

> And you absolutely can control when the OS switches threads -
> controlling that is what synchronisation primitives are *for*.

I don't think mod_wsgi has access to enough hooks or information to do
that satisfyingly (like the OS would do). Besides, I don't understand
how mod_wsgi could have control over the scheduling of
externally-launched threads. Therefore, an externally-launched thread
could be scheduled at any time, and not only after the "right"
interpreter thread was interrupted.

--

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread R. David Murray

R. David Murray added the comment:

Well, it would be patching the sqlite extension module.  Not that that is much 
different :)

Hopefully the current sqlite extension maintainer will think this is worthwhile 
doing.  Short of waiting for that, you could perhaps ask on the python-list 
email list to see if there is anyone with the requisite skill set interested in 
contributing a patch.  I will mention it on the core-mentorship mailing list, 
and perhaps someone there will decided to pick it up (there's a pretty decent 
chance of that, I think).

--

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Umm, no. The whole point of the GILState API is that you can call it from a 
thread which knows *nothing* about Python.

It will then use the *process global* state in the pystate.c statics to 
initialise that thread with a Python thread state. Currently, that thread state 
will always be for the main Python interpreter for the process.

All Graham wants is an officially supported way to change which interpreter the 
pystate.c globals reference *without* shutting down and reinitialising Python 
completely.

There are going to be limitations on how effective this will be - it still 
won't support *all* extension modules that use the PyGILState APIs. It will, 
however, support many more of them than the status quo (which is zero, unless 
you force your WSGI app to use the main interpreter, which has its own 
problems).

And you absolutely can control when the OS switches threads - controlling that 
is what synchronisation primitives are *for*.

--

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> If we expose an official way to switch the destination of the
> PyGILState APIs, then what it means is that mod_wsgi can, over the
> lifecycle of a single process in the pool, *switch* the virtual host
> and WSGI endpoint that process is handling by changing the active
> interpreter.

I don't understand what that means. It's the OS which switches threads,
including interpreter threads.

(by the way, the real fix to the GILState vs. subinterpreters issue
would be to create new API functions which take an interpreter as
argument, so that you have a distinct TLS key per interpreter)

--

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread John Taylor

John Taylor added the comment:

I believe patching Python is beyond my programming capability.  I would be very 
interested in seeing this in 3.3.1.  How else could I assist in making this 
happen? Thanks!

--

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Nick Coghlan

Nick Coghlan added the comment:

s/slightly/completely/ (I believe my description of the core problem was right, 
but my description of why that problem exists was wrong - it actually has to do 
with the way mod_wsgi handles virtual hosts and endpoints)

If we expose an official way to switch the destination of the PyGILState APIs, 
then what it means is that mod_wsgi can, over the lifecycle of a single process 
in the pool, *switch* the virtual host and WSGI endpoint that process is 
handling by changing the active interpreter. There are still some extension 
modules where that won't work (because they create persistent threads that 
periodically call back into Python, so they may still end up calling back in to 
the wrong interpreter), but it will allow those that just do callbacks from 
external worker threads (or other operations that are similarly bound by the 
lifecycle of a request) to start working properly.

--

___
Python tracker 

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



[issue10852] SSL/TLS sni use in smtp, pop, imap, nntp, ftp client libs by default

2012-08-21 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue15637] Segfault reading null VMA (works fine in python 2.x)

2012-08-21 Thread Alberto Milone

Alberto Milone added the comment:

I can confirm that the suggested changes solve the problem here. Thanks 
everyone!

--
resolution:  -> invalid

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread R. David Murray

R. David Murray added the comment:

Having said this is a feature, since it would only affect the error message, 
I'm actually open to it as a bug fix.  It won't make it into 3.3.0 even if 
someone proposes a patch, though, given that we are so late in the release 
process.

--

___
Python tracker 

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



[issue14452] SysLogHandler sends invalid messages when using unicode

2012-08-21 Thread Jody McIntyre

Changes by Jody McIntyre :


--
nosy: +scjody

___
Python tracker 

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



[issue10852] SSL/TLS sni use in smtp, pop, imap, nntp, ftp client libs by default

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

By the way, could you sign a contributor agreement? You can find instructions 
at http://www.python.org/psf/contrib/

--

___
Python tracker 

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



[issue10852] SSL/TLS sni use in smtp, pop, imap, nntp, ftp client libs by default

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks for the patch, Daniel. 3.3 is nearing the release candidate phase, so 
I'm re-targetting to 3.4. I'll take a detailed look soon.

(I suppose there's no easy way to write automated tests for this, unfortunately)

--
stage:  -> patch review
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread R. David Murray

R. David Murray added the comment:

This is a new feature (ie: adding support for a new feature of sqlite).

Would you like to propose a patch?

--
nosy: +r.david.murray
stage:  -> needs patch
type: behavior -> enhancement
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue10852] SSL/TLS sni use in smtp, pop, imap, nntp, ftp client libs by default

2012-08-21 Thread danblack

danblack added the comment:

previous patch had dumb error and even failed test suit. Now fixed.

--
Added file: http://bugs.python.org/file26949/issue10852-sni.patch

___
Python tracker 

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



[issue10852] SSL/TLS sni use in smtp, pop, imap, nntp, ftp client libs by default

2012-08-21 Thread danblack

Changes by danblack :


Removed file: 
http://bugs.python.org/file26918/issue_10852_pop-smtp-imap-nntp.patch

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> My understanding of the mod_wsgi architecture is that it uses
> subinterpreters to maintain a persistent process, while still
> providing a relatively pristine interpreter state to handle each new
> request.

I don't think that's true. On hg.python.org, the hglookup application
keeps a cached mapping of changeset ids to repo URLs, which wouldn't be
possible if its interpreter was re-bootstrapped for each new request.

--

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Sorry, I mischaracterised the way mod_wsgi works slightly. However, my 
understanding is still that the scope of this particular fix is merely to allow 
all external threads to be redirected to a different subinterpreter at various 
times over the life of a process. It does not need to allow different external 
threads to be redirected to different subinterpreters.

(Note: I am assuming that any hooks Apache/mod_wsgi has into external thread 
creation could already just create an appropriate thread state if that was the 
desired behaviour. It may be I'm incorrect on this, and what Graham really 
wants is the ability to change the target interpreter state just for the 
current thread. However, if that's what he wants, then there's additional 
background info I need on mod_wsgi and its ability to influence thread creation 
within a process, because I didn't get the impression on the weekend that that 
is what he was after)

--

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread John Taylor

John Taylor added the comment:

When I run this under Windows 7:

Platform : CPython 3.3.0b2
SQLite   : 3.7.12

Traceback (most recent call last):
  File "C:bug.py", line 34, in 
c.execute(query, ("2012-18-20", ) )
sqlite3.IntegrityError: constraint failed

--

___
Python tracker 

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



[issue15754] Traceback message not returning SQLite check constraint details

2012-08-21 Thread John Taylor

New submission from John Taylor:

According to:
http://www.sqlite.org/releaselog/3_7_12.html

SQLite has the ability to, "Report the name of specific CHECK constraints that 
fail."

CPython 3.3.0b2 which uses SQLite version 3.7.12 does not report which 
constraint failed.
--
import platform, sqlite3

print("Platform : %s %s" % 
(platform.python_implementation(),platform.python_version()))
print("SQLite   : %s" % (sqlite3.sqlite_version))
print()

tbl="""\
create table test1 (
db_insert_date   timestamp,
check( cast(substr(db_insert_date,1,4) as integer) >= 2000 and 
cast(substr(db_insert_date,1,4) as integer) <= 2025),
check( cast(substr(db_insert_date,6,2) as integer) >= 1and 
cast(substr(db_insert_date,6,2) as integer) <= 12),
check( cast(substr(db_insert_date,9,2) as integer) >= 1and 
cast(substr(db_insert_date,9,2) as integer) <= 31)
)
"""

conn = sqlite3.connect(":memory:")
c = conn.cursor()
c.execute(tbl)

query = "insert into test1 values( ? )"
c.execute(query, ("2012-08-20", ) )
conn.commit() # this works

c.execute(query, ("2012-18-20", ) )
conn.commit() # returns: sqlite3.IntegrityError: constraint failed (but which 
constraint?)

"""
Traceback (most recent call last):
  File "C:bug.py", line 34, in 
c.execute(query, ("2012-18-20", ) )
sqlite3.IntegrityError: constraint failed
"""

--
components: Extension Modules
messages: 168777
nosy: ghaering, jftuga
priority: normal
severity: normal
status: open
title: Traceback message not returning SQLite check constraint details
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Nick Coghlan

Nick Coghlan added the comment:

My understanding of the mod_wsgi architecture is that it uses subinterpreters 
to maintain a persistent process, while still providing a relatively pristine 
interpreter state to handle each new request. This means even when you're using 
multiple processes with a single request handling thread per process, you're 
running a subinterpreter unless you explicitly configure mod_wsgi to always run 
in the main interpreter (which, I believe, will result in additional state 
persistence across requests).

The proposed API change can only fix scenarios where *at a given point in 
time*, *all* PyGILState_Ensure calls should be directed to a particular 
subinterpreter. The target subinterpreter may change *later*, but there still 
cannot be two desired targets within the same process at the same time.

However, at the moment, PyGILState doesn't even allow that - all externally 
created threads are handled in the *main* interpreter even if that isn't what 
the embedding application wants.

--

___
Python tracker 

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



[issue15740] test_ssl failure when cacert.org CA cert in system keychain on OSX

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Attached cleaner version of the test:
> 
> * use self.addCleanup instead of a tearDown method
> * add comment that explains why the code is present
> * setUp method is only active on OSX

Looks good to me, thank you.

--

___
Python tracker 

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



[issue15740] test_ssl failure when cacert.org CA cert in system keychain on OSX

2012-08-21 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Attached cleaner version of the test:

* use self.addCleanup instead of a tearDown method
* add comment that explains why the code is present
* setUp method is only active on OSX

--
Added file: http://bugs.python.org/file26948/issue15740-2.txt

___
Python tracker 

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



[issue15637] Segfault reading null VMA (works fine in python 2.x)

2012-08-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

The example script has two errors IMO:
- XOpenDisplay accepts a char*, but display_url is certainly a unicode string; 
it should be converted to a bytes string::
xlib.XOpenDisplay(display_url.encode('utf-8'))
- XOpenDisplay.restype is not set, so it will be coerced to a C int (and 
truncated in the case of a 64bit pointer)

I strongly suggest to set .argtypes and .restype, to ensure proper type check 
and conversion.

--

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Just as they do today, all externally created threads will still go to
> *one* interpreter when they hit PyGILState_Ensure(). It's just that
> interpreter won't be the main one.

Uh but how does it solve the issue? (unless you create a mod_wsgi app
with only a single worker thread)

--

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Just as they do today, all externally created threads will still go to *one* 
interpreter when they hit PyGILState_Ensure(). It's just that interpreter won't 
be the main one.

Since the whole point of the PyGILState API is to support threads that don't 
have a previously created thread state, there's no getting around the 
requirement to have a single blessed interpreter that handles all externally 
created threads in a given process.

It will be up to mod_wsgi (and any other embedding application that uses the 
new function) to make sure it calls this at a time when there aren't any 
existing calls to PyGILState that would be disrupted. (Assuming we can't figure 
out a locking scheme that *ensures* no such threads are running when the switch 
occurs)

--

___
Python tracker 

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS

2012-08-21 Thread Stefan Krah

Stefan Krah added the comment:

Looks like a ZFS/nanosecond issue. My FreeBSD buildbot uses FFS and does not
have the failures.

--

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> As I understand the situation, mod_wsgi doesn't need arbitrary
> externally created threads to be able to call back into arbitrary
> subinterpreters, it just needs to be able to direct externally created
> threads in a process to a subinterpreter other than the main one.

But how does it know that the right externally created thread will point
to the right subinterpreter? The OS is free to schedule threads as it
desires.

--

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Graham, even better would be if you could try the following combination:

_PyGILState_Fini();
_PyGILState_Init(si, st);

(where si and st are the interpreter state and thread state for the target 
subinterpreter)

If a new PyGILState_SwitchInterpreter API is going to be able to solve this in 
3.4, then I believe those private APIs should be enough to make it possible in 
*current* versions.

If those private APIs *aren't* enough, then I'm missing something and this 
isn't going to be as easy as I thought.

--

___
Python tracker 

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



[issue15526] test_startfile crash on Windows 7 AMD64

2012-08-21 Thread Jeremy Kloth

Jeremy Kloth added the comment:

Here is the patch implementing option #2

--
keywords: +patch
nosy: +jkloth
Added file: http://bugs.python.org/file26947/test_startfile.diff

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Nick Coghlan

Nick Coghlan added the comment:

It would twiddle the autoInterpreterState and autoTLSkey entries in the 
pystate.c global variables to point to a different subinterpreter.

As I understand the situation, mod_wsgi doesn't need arbitrary externally 
created threads to be able to call back into arbitrary subinterpreters, it just 
needs to be able to direct externally created threads in a process to a 
subinterpreter other than the main one.

Graham, looking at the current impl - have you experimented with just calling 
_PyGILState_Init() with the interpreter state and current thread state for the 
desired subinterpreter to see what happens?

I think the new method could just be a cleaner combination of 
_PyGILState_ReInit and _PyGILState_Init. If I'm right, then calling 
_PyGILState_Init should convert the current crashes and deadlocks into a 
relatively less harmful memory leak (since the old entry in the TLS won't get 
deleted properly).

--

___
Python tracker 

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



[issue15740] test_ssl failure when cacert.org CA cert in system keychain on OSX

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> The attached (crufty) patch sets the environment variable during
> test_ssl.NetworkedTests and that also avoids the test failure. It might 
> be  useful to add this functionality to the test case (but less crufty, 
> and with a comment that explains why this is done).

I would prefer it to be done only under OS X platforms.

--

___
Python tracker 

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS

2012-08-21 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +skrah

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> a function that mod_wsgi can call to set the interpreter used by the
> GIL state APIs to implicitly create new thread states.

How would it work?

--
nosy: +pitrou

___
Python tracker 

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



[issue13299] namedtuple row factory for sqlite3

2012-08-21 Thread Russell Sim

Russell Sim added the comment:

Nick, Thanks for the tip.  I have removed the star unpacking.

--
Added file: http://bugs.python.org/file26946/issue_13299.2.patch

___
Python tracker 

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



[issue13299] namedtuple row factory for sqlite3

2012-08-21 Thread Nick Coghlan

Nick Coghlan added the comment:

You should be able to just use "tuple(col[0] for col in cursor.description)" 
instead of the current list comprehension in order to make the argument 
hashable.

--

___
Python tracker 

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



[issue15753] No-argument super in method with variable arguments raises SystemError

2012-08-21 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue13299] namedtuple row factory for sqlite3

2012-08-21 Thread Russell Sim

Russell Sim added the comment:

Raymond, Thanks for the comprehensive feedback! It's fantastic!  I have updated 
the patch with most of you feedback... but there was one part that I couldn't 
follow entirely.  I am now using the _make method but I have had to use star 
unpacking to allow the method to be cached, lru_cache won't allow a key to be a 
list because they aren't hash-able.

--
Added file: http://bugs.python.org/file26945/issue_13299.1.patch

___
Python tracker 

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



[issue15750] test_localtime_daylight_false_dst_true raises OverflowError: mktime argument out of range

2012-08-21 Thread R. David Murray

R. David Murray added the comment:

This is 3.3 only, as those tests and the function they test were only 
introduced in 3.3.

--
components: +email
nosy: +barry, r.david.murray
versions:  -Python 3.2

___
Python tracker 

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



[issue15751] Add PyGILState_SwitchInterpreter

2012-08-21 Thread Graham Dumpleton

Graham Dumpleton added the comment:

Just to clarify. One can still tell WSGI applications under mod_wsgi to run in 
the main interpreter and in that case modules using PyGILState* do work. By 
default though, sub interpreters are used as noted.

The mechanism for forcing use of main interpreter is the directive:

WSGIApplicationGroup %{GLOBAL}

Some details about this issue can be found in:

http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Python_Simplified_GIL_State_API

--
nosy: +grahamd

___
Python tracker 

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



[issue13922] argparse handling multiple "--" in args improperly

2012-08-21 Thread Steven Bethard

Steven Bethard added the comment:

@gcbirzan: Could you please open up a new issue? The current issue is fixed - 
it's just that the fix caused a new issue.

I would say that the `args` parameter was never intended to be anything but a 
list, so currently there's a documentation bug since that isn't stated 
explicitly anywhere. (But certainly the tests only test for lists, not any 
other sequences.)

Adding support for stuff other than lists feels more like a feature request, 
but given that it apparently worked by accident before, I guess we need to 
treat it as a bug. Probably the fix for that bug needs to have a ton of tests 
that check whether tuples work in all the various ways that parse_args is used.

--

___
Python tracker 

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



  1   2   >