[issue7833] Bdist_wininst installers fail to load extensions built with Issue4120 patch

2011-10-03 Thread Mark Hammond

Mark Hammond skippy.hamm...@gmail.com added the comment:

This is biting people (including me :) so I'm going to try hard to get this 
fixed.  One user on the python-win32 mailing list resorts to rebuilding every 
3rd party module he uses with this patch to get things working again (although 
apps which use only builtin modules or pywin32 modules - which already hacks 
this basic functionality in - don't see the problem.)

I'm attaching a different patch that should have the same default effect as 
Christoph's, but also allows the behaviour to be overridden.  Actually 
overriding it is quite difficult as distutils isn't setup to easily allow such 
compiler customizations - but at least it *is* possible.  To test this out I 
hacked both the pywin32 and py2erxe build processes to use those customizations 
and it works fine and allows them both to customize the behaviour to meet 
various modules' requirements.

Finally, this whole thing is still fundamentally broken for extensions which 
need a manifest (eg, to reference the common controls or the 
requestedExecutionLevel cruft).  These extension will still need to include the 
CRT reference in their manifest and thus will need a copy of the CRT next to 
each of them.  I *think* this also means they basically get a private copy of 
the CRT - they are not sharing the CRT with Python, which means they are at 
risk of hitting problems such as trying to share FILE * objects.  In practice, 
this means such modules are probably better of just embedding the CRT 
statically.  This is the route I've taken for one pywin32 module so the module 
can have a manifest and still work without a complete, private copy of the CRT 
needing to live next to it.  But even with that problem I think this patch 
should land.

It would be great if someone can review and test this version of the patch and 
I'll check it in.

--
versions: +Python 3.3, Python 3.4 -Python 2.6
Added file: 
http://bugs.python.org/file23305/bug-7833-overridable-manifest-settings.patch

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



[issue13071] IDLE refuses to open on windows 7

2011-10-03 Thread Terry J. Reedy

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

Are you using the .msi installer from python.org?
Or one from activestate or enthought?

--

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



[issue13071] IDLE refuses to open on windows 7

2011-10-03 Thread Ezio Melotti

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

Are you using some unusual keyboard layout?

--

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



[issue13071] IDLE refuses to open on windows 7

2011-10-03 Thread Amaury Forgeot d'Arc

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

This issue is very similar to issue5707: it is possible to define a custom key 
binding to Alt or Control: just click the Alt box and don't select a 
letter.
There is no check, it's possible to save this buggy key binding, and IDLE won't 
start anymore.

IDLE should:
- check the validity of the binding and refuse to save it when it is invalid
- gracefully skip invalid bindings from the config file

--
nosy: +amaury.forgeotdarc

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



[issue12804] make test fails on systems without internet access

2011-10-03 Thread Ezio Melotti

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

FWIW there's also support.open_urlresource that can be used to download test 
data.  open_urlresouce calls requires('urlfetch') and skips the test when the 
resource is not enabled.  For instance, test_normalization uses it:
try:
testdata = support.open_urlresource(TESTDATAURL, encoding=utf-8,
check=check_version)
except (IOError, HTTPException):
self.skipTest(Could not retrieve  + TESTDATAURL)
self.addCleanup(testdata.close)

This also saves the file on the disk and reuses it when the test is run again, 
so the connection is actually used once and only if available.

--
nosy: +ezio.melotti

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



[issue7425] Improve the robustness of pydoc -k in the face of broken modules

2011-10-03 Thread Ned Deily

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

It turns out that the proposed fix here for pydoc was independently added in 
the early days of Python 3 but was not backported.  That fix for 2.7 plus a 
fix-in-progress for Issue7367 (for both 2.7 and 3.x) and additional test cases 
(also in progress) should address most if not all of the pydoc crash issues.  
I'll also review the other open issues.

--
assignee:  - ned.deily

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2011-10-03 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

The automatic conversion of 'u' to 'I' or 'L' causes test_buffer
(PEP-3118 repo) to fail:


# Not implemented formats. Ugly, but inevitable. This is the same as
# issue #2531: equality is also used for membership testing and must
# return a result.
a = array.array('u', 'xyz')
v = memoryview(a)
self.assertNotEqual(v, a)
self.assertNotEqual(a, v)


I don't have a better idea though what to do about 'u' except
officially implementing it for struct and memoryview as well.

--

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2011-10-03 Thread Stefan Krah

Changes by Stefan Krah stefan-use...@bytereef.org:


--
nosy: +meador.inge

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



[issue12458] Tracebacks should contain the first line of continuation lines

2011-10-03 Thread Ezio Melotti

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

This is an interesting proposal.

The line number comes from Python/traceback.c:120:
tb-tb_lineno = PyFrame_GetLineNumber(frame);
and this function is defined in Objects/frameobject.c:35:
int PyFrame_GetLineNumber(PyFrameObject *f) {
if (f-f_trace)
return f-f_lineno;
else
return PyCode_Addr2Line(f-f_code, f-f_lasti);
}
and documented as Return the line number that frame is currently executing., 
so that would explain why it's pointing to the last line.

I'm not sure if there's an easy way to get the line where the beginning of the 
expression is, but if you find a way to get it, we could try to use it in 
PyFrame_GetLineNumber and see how it works.

--
nosy: +ezio.melotti, georg.brandl, ncoghlan
stage:  - test needed
versions: +Python 3.3 -Python 2.6

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2011-10-03 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

It would be better to use a format for a Py_UCS4 string, but struct doesn't 
support such type.

PEP-3118 suggests for the extended struct syntax:

'c' - ucs-1 (latin-1) encoding
'u' - ucs-2
'w' - ucs-4

--

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



[issue6632] Include more fullwidth chars in the decimal codec

2011-10-03 Thread Ezio Melotti

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


--
nosy: +tchrist

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



[issue12911] Expose a private accumulator C API

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

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

 It's not a container type, just a small C struct that 
 gets allocated on the stack. Think of it as a library, like stringlib.

That's what I call a container type: a structure with a library :-)

 That's another possibility. But we'd have to expose a 
 C API anyway, and this one is as good as any other.

No, it's not: it's additional clutter. If new API needs to be added,
adding it for existing structures is better. Notice that you don't
*need* new API, as you can use StringIO just fine from C also.

 Note that StringIO will copy data twice (once when calling 
 write(), once when calling getvalue()), while ''.join() only once (at 
 the end, when concatenating all strings).

Sounds like a flaw in StringIO to me. It could also manage a list of strings 
that have been written, rather than only using a flat buffer. Only when someone 
actually needs a linear buffer, it could convert it (and use a plain 
string.join when getvalue is called and there is no buffer at all).

--

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



[issue12911] Expose a private accumulator C API

2011-10-03 Thread Antoine Pitrou

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

  That's another possibility. But we'd have to expose a 
  C API anyway, and this one is as good as any other.
 
 No, it's not: it's additional clutter. If new API needs to be added,
 adding it for existing structures is better. Notice that you don't
 *need* new API, as you can use StringIO just fine from C also.

Yes, but using StringIO without a dedicated C API is more tedious and
quite slower.

  Note that StringIO will copy data twice (once when calling 
  write(), once when calling getvalue()), while ''.join() only once (at 
  the end, when concatenating all strings).
 
 Sounds like a flaw in StringIO to me. It could also manage a list of
 strings that have been written, rather than only using a flat buffer.
 Only when someone actually needs a linear buffer, it could convert it
 (and use a plain string.join when getvalue is called and there is no
 buffer at all).

That's what I thought as well. However, that's probably too much for a
bugfix release (and this issue is meant to allow test_bigmem to pass on
3.x).

--

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



[issue670664] HTMLParser.py - more robust SCRIPT tag parsing

2011-10-03 Thread Fred L. Drake, Jr.

Changes by Fred L. Drake, Jr. f...@fdrake.net:


--
nosy:  -fdrake

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2011-10-03 Thread STINNER Victor

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

 The automatic conversion of 'u' to 'I' or 'L' causes test_buffer
 (PEP-3118 repo) to fail:


 # Not implemented formats. Ugly, but inevitable. This is the same as
 # issue #2531: equality is also used for membership testing and must
 # return a result.
 a = array.array('u', 'xyz')
 v = memoryview(a)
 self.assertNotEqual(v, a)
 self.assertNotEqual(a, v)

I don't understand: a buffer format is a format for the struct module, 
or for the array module?

--

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2011-10-03 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

STINNER Victor rep...@bugs.python.org wrote:
  # Not implemented formats. Ugly, but inevitable. This is the same as
  # issue #2531: equality is also used for membership testing and must
  # return a result.
  a = array.array('u', 'xyz')
  v = memoryview(a)
  self.assertNotEqual(v, a)
  self.assertNotEqual(a, v)
 
 I don't understand: a buffer format is a format for the struct module, 
 or for the array module?

It's like this: memoryview follows the current struct syntax, which
doesn't have 'u'. memory_richcompare() does not understand 'u', but
is required to return something for __eq__ and __ne__, so it returns
'not equal'.

This isn't so important, since I discovered (see my later post)
that 'u' and 'w' were scheduled for inclusion in the struct
module anyway.

So I think we should focus on whether the proposed 'c', 'u' and 'w'
format specifiers still make sense after the PEP-393 changes.

--

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



[issue13094] setattr misbehaves when used with lambdas inside for loop

2011-10-03 Thread Tomáš Dvořák

New submission from Tomáš Dvořák dvto...@gmail.com:

I have this python script, and run it in python 2.7.2 (installed from EPD_free 
7.1-2 (32-bit), but I guess this has nothing to do with EPD.
8---fail.py--

class X(object):
pass

x = X()
items = [foo, bar, baz]

for each in items:
setattr(x, each, lambda: each)

print(foo, x.foo())
print(bar, x.bar())
print(baz, x.baz())

8---fail.py--

I'd naively expect it to print 
('foo', 'foo')
('bar', 'bar')
('baz', 'baz')

,but it surprisingly (and annoyingly) outputs
('foo', 'baz')
('bar', 'baz')
('baz', 'baz')

Please, tell me that this is a bug :) I'd hate it if this was the intended 
behaviour. I spent two hours today before I found out this was the cause of my 
program to fail.

Best regards,
  Tomáš Dvořák

--
components: None
messages: 144819
nosy: Tomáš.Dvořák
priority: normal
severity: normal
status: open
title: setattr misbehaves when used with lambdas inside for loop
versions: Python 2.7

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



[issue13094] setattr misbehaves when used with lambdas inside for loop

2011-10-03 Thread R. David Murray

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

Sorry.  It is intended behavior.  The lambda 'each' is bound to the local 
'each', and by the time the lambda's execute, the value of 'each' is 'baz'.

I'm going to turn this into a doc bug, because while I'm pretty sure this is 
documented *somewhere*, I don't see it in the programming FAQ, and it should be 
there.

--
assignee:  - docs@python
components: +Documentation -None
nosy: +docs@python, r.david.murray
stage:  - needs patch
type:  - behavior
versions: +Python 3.2, Python 3.3

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



[issue13094] Need Programming FAQ entry for the behavior of closures

2011-10-03 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
title: setattr misbehaves when used with lambdas inside for loop - Need 
Programming FAQ entry for the behavior of closures

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



[issue13094] Need Programming FAQ entry for the behavior of closures

2011-10-03 Thread Ezio Melotti

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

To understand better what's going on, try to change the value of 'each' after 
the 3 prints and then call again the 3 methods: you will see that they now 
return the new value of each.  This is because the lambdas refer to global 
'each' (that at the end of the loop is set to 'baz').
If you do setattr(x, each, lambda each=each: each), the each will be local to 
the lambda, and it will then work as expected.

An entry in the FAQ would be useful, I thought it was there already but 
apparently it's not (I'm pretty sure I saw this already somewhere in the doc, 
but I can't seem to find where).

--
assignee: docs@python - 
components: +None -Documentation
nosy: +ezio.melotti
stage: needs patch - 
type: behavior - 
versions:  -Python 3.2, Python 3.3

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



[issue13094] Need Programming FAQ entry for the behavior of closures

2011-10-03 Thread Tomáš Dvořák

Tomáš Dvořák dvto...@gmail.com added the comment:

Thank you all very much for the super-quick responses. I'm used to smalltalk, 
so the python variable binding behaviour is unnatural to me, but I guess there 
must have been some reasons for making it behave this way. 

Ezio, the 
lambda each=each: each 
trick works nicely, thanks a lot. But - what does it mean? :) I just don't know 
how to parse and understand it :-)

Best regards,
  Tomáš Dvořák

--

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



[issue13045] socket.getsockopt may require custom buffer contents

2011-10-03 Thread Artyom Gavrichenkov

Changes by Artyom Gavrichenkov xima...@highloadlab.com:


--
nosy: +python-dev

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



[issue13094] Need Programming FAQ entry for the behavior of closures

2011-10-03 Thread Ezio Melotti

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

Maybe with a different name is less confusing: lambda return_value=each: 
return_value
This copies the value of 'each' in a variable called 'return_value' that is 
local to the lambda.  Since the copy happens when the lambdas are defined, 
'return_value' has then the right value.

--

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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-10-03 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +eric.snow

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



[issue13045] socket.getsockopt may require custom buffer contents

2011-10-03 Thread Artyom Gavrichenkov

Changes by Artyom Gavrichenkov xima...@highloadlab.com:


--
nosy: +neologix

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



[issue13045] socket.getsockopt may require custom buffer contents

2011-10-03 Thread Artyom Gavrichenkov

Changes by Artyom Gavrichenkov xima...@highloadlab.com:


--
nosy: +pitrou

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



[issue13045] socket.getsockopt may require custom buffer contents

2011-10-03 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

Hello,

method:: socket.getsockopt(level, optname[, optarg])

The overloading of the third parameter is confusing: it can already be an 
integer value or a buffer size, I don't think that adding a third possibility 
is a good idea. It might be better to add another optional `buffer` argument 
(and ignore `buflen` if this argument is provided).

Also, it would be nice to have a corresponding unit test: since I doubt this 
buffer argument is supported by many Unices out there, you can probably reuse a 
subset of what ipset does (just take care and guard it by 
@support.requires_linux_version() if applicable).

--

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

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

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

 There are no official English titling rules and as you noted,
 publishers vary. 
 
 If there aren't any rules, then how come all book and movie titles always
 look the same?  :)

Can we please leave the English language out of this issue?
Else I will ask that Python uses German text-processing rules,
just so that this gets fewer comments :-)

As a point of order, please all try to stick at the issue at hand.
Linguistics discussions or general Unicode discussion have better
places than this bug tracker. I just had to stop reading Tom's
comments as too verbose (which is more difficult since it's in
a foreign language).

--
title: \N{...} neglects formal aliases and named sequences from Unicode 
charnames namespace - \N{...} neglects formal aliases and named sequences from 
Unicode charnames namespace

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-03 Thread Ezio Melotti

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

The patch is pretty much complete, it just needs a review (I left some comments 
on the review page).
One thing that can be added is some compression for the names of the named 
sequences.  I'm not sure I can reuse the same compression used for the other 
names easily.  Does the size of the db really matters?  Are the new names using 
too much extra space?

--
keywords: +needs review

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



[issue13001] test_socket.testRecvmsgTrunc failure on FreeBSD 7.2 buildbot

2011-10-03 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 4378bae6b8dc by Charles-François Natali in branch 'default':
Issue #13001: Fix test_socket.testRecvmsgTrunc failure on FreeBSD  8, which
http://hg.python.org/cpython/rev/4378bae6b8dc

--
nosy: +python-dev

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



[issue13045] socket.getsockopt may require custom buffer contents

2011-10-03 Thread Artyom Gavrichenkov

Artyom Gavrichenkov xima...@highloadlab.com added the comment:

Hi Charles-François,

I've attached an update for the previous patch. Now there's no more overloading 
for the third argument and socket.getsockopt accepts one more optional argument 
-- a buffer to use as an input to kernel.

I can provide a manual sample script, with getsockopt being used this way, that 
depends on Linux ipset kernel module being installed and modprobe'd. However, 
automatic unit test is not that easy to implement. Generally ipset requires 
certain kernel modules to operate, and we either have to install ipset in order 
to run a unit test, or to implement some mock Linux kernel module purely for 
testing and support it against all possible kernel versions. Not to mention 
that such a test should be carried out by root user only.

By the way, I don't really think that any POSIX-compliant UNIX out there would 
treat the buffer given to getsockopt in any way different from what Linux does. 
It is very easy to copy the buffer from user to kernel and back, and it is so 
inconvenient to prevent kernel from reading it prior to modification, that I 
bet no one has ever bothered to do this.

--
Added file: http://bugs.python.org/file23306/getsockopt_buffer_input_v2.patch

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



[issue12555] PEP 3151 implementation

2011-10-03 Thread Antoine Pitrou

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

 Should the input of OSError be checked?

It could, but pre-PEP it is not, so I assumed it's better to minimize 
compatibility-breaking changes.

--

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



[issue12555] PEP 3151 implementation

2011-10-03 Thread Antoine Pitrou

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


Added file: http://bugs.python.org/file23307/554524a74bbe.diff

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



[issue12555] PEP 3151 implementation

2011-10-03 Thread Antoine Pitrou

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

Patch update against latest default. There shouldn't be anything interesting to 
see.

--

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



[issue13095] Support for splitting lists/tuples into chunks

2011-10-03 Thread Cal Leeming

New submission from Cal Leeming cal.leem...@simplicitymedialtd.co.uk:

After a while of digging around, I noticed that the core libs don't provide an 
easy way of splitting a list/tuple into chunks - as per the following 
discussion:

http://www.aspwinhost.com/In-what-way-do-you-split-an-list-into-evenly-sized-chunks-on-Python/

Therefore, I'd like to +1 feature request this.

Any thoughts??

Cal

--
components: Library (Lib)
messages: 144831
nosy: sleepycal
priority: normal
severity: normal
status: open
title: Support for splitting lists/tuples into chunks
type: feature request

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

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

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

The patch needs to take versioning into account. It seems that NamedSequences 
where added in 4.1, and NameAliases in 5.0. So for the moment, when using 3.2 
(i.e. when self is not NULL), it is fine to lookup neither. Please put an 
assertion into makeunicodedata that this needs to be reviewed when an old 
version other than 3.2 needs to be supported.

The size of the DB does matter; there are frequent complaints about it. The 
named sequences take 20kB on my system; not sure whether that's too much. If 
you want to reduce the size (and also speedup lookup), you could use 
private-use characters, like so:
- add the named sequences as PUA characters to the names table of 
makeunicodename, in the range(P, P+418) (for some P).
- in lookup, check whether the _getcode result is in range(P,P+418). If so, 
subtract P from the code and use this as an index into _namedsequences.
- add a _getcode wrapper that filters out all private use characters, for 
regular lookup.

--

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



[issue13095] Support for splitting lists/tuples into chunks

2011-10-03 Thread Ezio Melotti

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

This sounds like the grouper() recipe of itertools.  You could try to convince 
Raymond and see if he wants to include it in itertools.

--
nosy: +ezio.melotti, rhettinger
versions: +Python 3.3

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



[issue13095] Support for splitting lists/tuples into chunks

2011-10-03 Thread Cal Leeming

Cal Leeming cal.leem...@simplicitymedialtd.co.uk added the comment:

Oh - and while we are at it - how about having merge_list() and unique_list() 
as part of the core too??


def unique_list(seq): # Dave Kirby
# Order preserving
seen = set()
return [x for x in seq if x not in seen and not seen.add(x)]

def merge_list(seq):
merged = []
for s in seq:
for x in s:
merged.append(x)
return merged

Raymond - any thoughts on these 3 requests???

Cal

--

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-03 Thread Tom Christiansen

Tom Christiansen tchr...@perl.com added the comment:

Ezio Melotti rep...@bugs.python.org wrote
   on Mon, 03 Oct 2011 04:15:51 -: 

 But it still has to happen at compile time, of course, so I don't know
 what you could do in Python.  Is there any way to change how the compiler
 behaves even vaguely along these lines?

 I think things like from __future__ import ... do something similar,
 but I'm not sure it will work in this case (also because you will have
 to provide the list of aliases somehow).

Ah yes, that's right.  Hm.  I bet then it *would* be possible, just perhaps
a bit of a run-around to get there.  Not a high priority, but interesting.

 less readable than:
 
 def my_capitalize(s):
return s[0].upper() + s[1:].lower()

 You could argue that the first is much more explicit and in a way
 clearer, but overall I think you agree with me that is less readable.

Certainly.

It's a bit like the way bug rate per lines of code is invariant across
programming languages.  When you have more opcodes, it gets harder to
understand because there are more interactions and things to remember.

 That really isn't right.  A cased character is one with the Unicode Cased
 property, and a lowercase character is one wiht the Unicode Lowercase
 property.  The General Category is actually immaterial here.

 You might want to take a look and possibly add a comment on #12204 about this.

 I've spent all bloody day trying to model Python's islower, isupper, and 
 istitle
 functions, but I get all kinds of errors, both in the definitions and in the
 models of the definitions.

 If by model you mean trying to figure out how they work, it's
 probably easier to look at the implementation (I assume you know
 enough C to understand what they do).  You can find the code for
 str.istitle() at http://hg.python.org/cpython/file/default/Objects/un-
 icodeobject.c#l10358 and the actual implementation of some macros like
 Py_UNICODE_ISTITLE at
 http://hg.python.org/cpython/file/default/Objects/unicodectype.c.

Thanks, that helps immensely.  I'm completely fluent in C.  I've gone 
and built a tags file of your whole v3.2 source tree to help me navigate.

The main underlying problem is that the internal macros are defined in a
way that made sense a long time ago, but no longer do ever since (for
example) the Unicode lowercase property stopped being synonymous with
GC=Ll and started also including all code points with the
Other_Lowercase property as well.

The originating culprit is Tools/unicode/makeunicodedata.py.
It builds your tables only using UnicodeData.txt, which is
not enough.  For example:

if category in [Lm, Lt, Lu, Ll, Lo]:
flags |= ALPHA_MASK
if category == Ll:
flags |= LOWER_MASK
if 'Line_Break' in properties or bidirectional == B:
flags |= LINEBREAK_MASK
linebreaks.append(char)
if category == Zs or bidirectional in (WS, B, S):
flags |= SPACE_MASK
spaces.append(char)
if category == Lt:
flags |= TITLE_MASK
if category == Lu:
flags |= UPPER_MASK

It needs to use DerivedCoreProperties.txt to figure out whether
something is Other_Uppercase, Other_Lowercase, etc. In particular:

Alphabetic := Lu+Ll+Lt+Lm+Lo + Nl + Other_Alphabetic
Lowercase  := Ll + Other_Lowercase
Uppercase  := Ll + Other_Uppercase

This affects a lot of things, but you should be able to just fix it
in Tools/unicode/makeunicodedata.py and have all of them start
working correctly.

You will probably also want to add 

Py_UCS4 _PyUnicode_IsWord(Py_UCS4 ch)

that uses the UTS#18 Annex C definition, so that you catch marks, too.
That definition is:

Word := Alphabetic + Mc+Me+Mn + Nd + Pc

where Alphabetic is defined above to include Nl and Other_Alphabetic.

Soemwhat related is stuff like this:

typedef struct {
const Py_UCS4 upper;
const Py_UCS4 lower;
const Py_UCS4 title;
const unsigned char decimal;
const unsigned char digit;
const unsigned short flags;
} _PyUnicode_TypeRecord;

There are two different bugs here.  First, you are missing 

const Py_UCS4 fold;

which is another field from UnicodeData.txt, one that is critical 
for doing case-insensitive matches correctly.

Second, there's also the problem that Py_UCS4 is an int.  That means you
are stuck with just the character-based simple versions of upper-, title-,
lower-, and foldcase.  You need to have fields for the full mappings, which
are now strings (well, int arrays) not single ints.  I'll use ??? for the
int-array type that I don't know:

const ??? upper_full;
const ??? lower_full;
const ??? title_full;
const ??? fold_full;

You will also need to extend the API from just

Py_UCS4 _PyUnicode_ToUppercase(Py_UCS4 ch)

to something like

??? _PyUnicode_ToUppercase_Full(Py_UCS4 ch)

I don't know what the ??? return type is there, but it's whatever the
upper_full filed in 

[issue13081] Crash in Windows with unknown cause

2011-10-03 Thread Amorilia

Amorilia amorilia.game...@gmail.com added the comment:

I'm the author of the application. The tool is written in pure Python, and only 
uses libraries from stdlib.

It would be really nice to have a simple standalone script to reproduce the 
crash, however I am still trying to reproduce it myself. So far no success.

--
nosy: +amorilia

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



[issue13081] Crash in Windows with unknown cause

2011-10-03 Thread Brian Curtin

Brian Curtin br...@python.org added the comment:

I recently created minidumper to write Visual Studio MiniDump files of 
interpreter crashes, but it's currently only available on 3.x. If I port it to 
2.x, you could add import minidumper;minidumper.enable() to the top of your 
script, then we could probably get somewhere with it.

An additional example script, possibly including sample data to run through it, 
would be even better.

--
nosy: +brian.curtin

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



[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-03 Thread Victor Semionov

Victor Semionov vsemio...@gmail.com added the comment:

Any plans to fix this in the next release?

--

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

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

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

 The main underlying problem is that the internal macros are defined in a
 way that made sense a long time ago, but no longer do ever since (for
 example) the Unicode lowercase property stopped being synonymous with
 GC=Ll and started also including all code points with the
 Other_Lowercase property as well.

Tom: PLEASE focus on one issue at a time. This is about formal
aliases and named sequences, NOT about upper and lower case.
If you want to have a discussion about upper and lower case,
please open a separate issue. There I would explain why I
think your reasoning is flawed (i.e. just because your interpretation
of Unicode differs from Python's implementation doesn't already
make Python's implementation incorrect - just different).

--
title: \N{...} neglects formal aliases and named sequences from Unicode 
charnames namespace - \N{...} neglects formal aliases and named sequences from 
Unicode charnames namespace

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



[issue13001] test_socket.testRecvmsgTrunc failure on FreeBSD 7.2 buildbot

2011-10-03 Thread Charles-François Natali

Changes by Charles-François Natali neolo...@free.fr:


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

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



[issue12156] test_multiprocessing.test_notify_all() timeout (1 hour) on FreeBSD 7.2

2011-10-03 Thread Charles-François Natali

Charles-François Natali neolo...@free.fr added the comment:

test_multiprocessing frequently hangs on FreeBSD  8 buildbots, and this 
probably has to do with the limit on the max number of POSIX semaphores:

==
ERROR: test_notify_all (test.test_multiprocessing.WithProcessesTestCondition)
--
Traceback (most recent call last):
  File 
/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_multiprocessing.py,
 line 777, in test_notify_all
cond = self.Condition()
  File 
/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/__init__.py,
 line 189, in Condition
return Condition(lock)
  File 
/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/synchronize.py,
 line 198, in __init__
self._lock = lock or RLock()
  File 
/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/synchronize.py,
 line 172, in __init__
SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1)
  File 
/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/synchronize.py,
 line 75, in __init__
sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
OSError: [Errno 23] Too many open files in system


There are probably dangling semaphores, since the test doesn't use that much 
POSIX semaphores. Either way, we can't do much about it...

--

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



[issue12210] test_smtplib: intermittent failures on FreeBSD

2011-10-03 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

I haven't seen this in a while, so let's assume it's fixed.

--
resolution:  - out of date
stage:  - committed/rejected
status: open - closed

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



[issue13071] IDLE refuses to open on windows 7

2011-10-03 Thread jfalskfjdsl;akfdjsa;l laksfj;aslkfdj;sal

jfalskfjdsl;akfdjsa;l laksfj;aslkfdj;sal christopherdar...@gmail.com added 
the comment:

ok i have solved the problem it was the same as issue 4765

--

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



[issue13071] IDLE refuses to open on windows 7

2011-10-03 Thread Amaury Forgeot d'Arc

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

What did you do to solve the problem?

--

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



[issue7689] Pickling of classes with a metaclass and copy_reg

2011-10-03 Thread Brent Payne

Changes by Brent Payne brent.pa...@gmail.com:


--
nosy: +Brent.Payne

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



[issue13081] Crash in Windows with unknown cause

2011-10-03 Thread Santoso Wijaya

Santoso Wijaya santoso.wij...@gmail.com added the comment:

Without the aforementioned minidump library, you can also kick off the Python 
interpreter using a debugger (or have a debugger break into an already-running 
one) [1]. When the crash happens--presumably the debugger will break at this 
point--you can export the mini dump into a file for us to look at [2].

[1] I like using windbg 
(http://msdn.microsoft.com/en-us/windows/hardware/gg463009).

[2] It would be something like, `.dump /ma C:\path\to\crash.DMP`

--
nosy: +santa4nt

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



[issue13071] IDLE accepts, then crashes, on invalid key bindings.

2011-10-03 Thread Terry J. Reedy

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

While this issue and #4765 are about the same effect, with a similar 
workaround, Amaury has indentified a separate bug in the custom key mechanism. 
So I retitled it to refer to that bug.

--
title: IDLE refuses to open on windows 7 - IDLE accepts, then crashes, on 
invalid key bindings.

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



[issue4765] IDLE fails to Delete Custom Key Set properly

2011-10-03 Thread Terry J. Reedy

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

Note the config-main.cfg contains all custom configurations and appears if you 
make any one of them. Mine currently says

[EditorWindow]
font = lucida sans unicode

[General]
autosave = 1

So deleting it is a hack workaround until the bug is fixed.

--
nosy: +terry.reedy

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



[issue13095] Support for splitting lists/tuples into chunks

2011-10-03 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

These have been rejected before.  There is always a trade-off in adding tools 
such as this -- it can take more time to learn and remember them than to write 
a trivial piece of code to do it yourself.  Another issue is that people tend 
to disagree on how to handle an odd sized left-over group -- different use 
cases require different handling.

We're trying to keep the core toolset reasonably small so that python remains 
simple and learnable.  That raises the threshold for adding new tools.

--
resolution:  - rejected
status: open - closed

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



[issue13081] Crash in Windows with unknown cause

2011-10-03 Thread Santoso Wijaya

Changes by Santoso Wijaya santoso.wij...@gmail.com:


--
type:  - crash

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



[issue12053] Add prefetch() for Buffered IO (experiment)

2011-10-03 Thread John O'Connor

John O'Connor tehj...@gmail.com added the comment:

Here is an update with the C implementation. I think a working prototype will 
be helpful before another round on python-dev. 


I'm not sure how to handle unseekable, non-blocking streams where the read 
returns before `skip` bytes are exhausted. If prefetch() returns 0, then the 
caller would then have to use tell() to ensure subsequent reads are sane. In 
other words it seems prefetch() will leave the stream in an unpredictable 
state. Antoine, what are your thoughts?

--
Added file: http://bugs.python.org/file23308/prefetch.patch

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



[issue1887] distutils doesn't support out-of-source builds

2011-10-03 Thread Matt Joiner

Changes by Matt Joiner anacro...@gmail.com:


--
nosy: +anacrolix

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



[issue12881] ctypes: segfault with large structure field names

2011-10-03 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset aa3ebc2dfc15 by Meador Inge in branch '2.7':
Issue #12881: ctypes: Fix segfault with large structure field names.
http://hg.python.org/cpython/rev/aa3ebc2dfc15

New changeset d05350c14e77 by Meador Inge in branch '3.2':
Issue #12881: ctypes: Fix segfault with large structure field names.
http://hg.python.org/cpython/rev/d05350c14e77

New changeset 2eab632864f6 by Meador Inge in branch 'default':
Issue #12881: ctypes: Fix segfault with large structure field names.
http://hg.python.org/cpython/rev/2eab632864f6

--
nosy: +python-dev

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



[issue13096] ctypes: segfault with large POINTER type names

2011-10-03 Thread Meador Inge

New submission from Meador Inge mead...@gmail.com:

Reproducible in 2.7 and tip:

[meadori@motherbrain cpython]$ ./python 
Python 3.3.0a0 (default:61de28fa5537+d05350c14e77+, Oct  3 2011, 21:47:04) 
[GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux
Type help, copyright, credits or license for more information.
 from ctypes import *
 T = type('x' * 2 ** 25, (Structure,), {})
 p = POINTER(T)
Segmentation fault (core dumped)

--
components: Extension Modules, ctypes
messages: 144850
nosy: amaury.forgeotdarc, belopolsky, meador.inge
priority: normal
severity: normal
stage: needs patch
status: open
title: ctypes: segfault with large POINTER type names
type: crash
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue13096] ctypes: segfault with large POINTER type names

2011-10-03 Thread Meador Inge

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

There is similar crasher to this one that can be reproduced like:

[meadori@motherbrain cpython]$ ./python 
Python 3.3.0a0 (default:61de28fa5537+d05350c14e77+, Oct  3 2011, 21:47:04) 
[GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux
Type help, copyright, credits or license for more information.
 from ctypes import *
 p = POINTER('x' * 2 ** 25)
Segmentation fault (core dumped)

It should be fixed as well.

--

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



[issue13097] ctypes: segfault with large number of callback arguments

2011-10-03 Thread Meador Inge

New submission from Meador Inge mead...@gmail.com:

Reproducible in 2.7 and tip:

[meadori@motherbrain cpython]$ ./python 
Python 3.3.0a0 (default:61de28fa5537+d05350c14e77+, Oct  3 2011, 21:47:04) 
[GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux
Type help, copyright, credits or license for more information.
 from ctypes import *
 NARGS = 2 ** 20
 proto = CFUNCTYPE(None, *(c_int,) * NARGS)
 def func(*args):
...return (1, abc, None)
... 
 cb = proto(func)
 cb(*(1,) * NARGS)
Segmentation fault (core dumped)

--
components: ctypes
messages: 144852
nosy: amaury.forgeotdarc, belopolsky, meador.inge
priority: normal
severity: normal
stage: needs patch
status: open
title: ctypes: segfault with large number of callback arguments
type: crash
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue12881] ctypes: segfault with large structure field names

2011-10-03 Thread Meador Inge

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

Fixed.  Opened issue13096 and issue13097 for the other crashers.

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

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



[issue12880] ctypes: clearly document how structure bit fields are allocated

2011-10-03 Thread Meador Inge

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

On Fri, Sep 30, 2011 at 12:19 PM, Vlad Riscutia rep...@bugs.python.org wrote:

 I believe this is the better thing to do rather than detailing how GCC and 
 MSVC allocated their bitfields because that would just
 encourage people to use this feature incorrectly.

So clearly documenting how a feature works will cause people to use
the feature incorrectly?  I think not.  In any case, I agree that
documenting the low-level specifics of each compiler's algorithm is too much.

 Most bugs opened on bit fields are because people are toying with the 
 underlying buffer and get other results than what they expect.

The issues that I have looked at (issue6069, issue11920, and
issue11920) all involve fundamental misunderstandings of *how* the
structure layout is determined.  I don't know if I would generalize
these misunderstanding as toying with the underlying buffer.  Some
times people need to know the exact layout for proper C interop.  In
some of the bugs reported folks are casting buffers in an attempt
to discover the structure layout since it is not clearly documented.

The general content of your patch seems reasonable.  I will provide
more specific comments shortly.

--

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



[issue12880] ctypes: clearly document how structure bit fields are allocated

2011-10-03 Thread Meador Inge

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

Added some comments in rietveld.  P.S. watch out for trailing whitespace
when writing patches.  Use 'make patchcheck' to help find bad whitespace
formatting.

--

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



[issue7689] Pickling of classes with a metaclass and copy_reg

2011-10-03 Thread Lance Hepler

Lance Hepler nlhep...@gmail.com added the comment:

Hello all, sorry to be a bother, but what's the progress on this issue? I have 
a codebase that requires resolution of this issue to enable multiprocessing. 
What are the remaining outstanding problems herein preventing the attached 
patches from being merged?

--

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