[issue14330] don't use host python, use host search paths for host compiler

2012-07-26 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
priority: normal - release blocker

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



[issue15436] __sizeof__ is not documented

2012-07-26 Thread Chris Rebert

Changes by Chris Rebert pyb...@rebertia.com:


--
nosy: +cvrebert

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



[issue15269] Document dircmp.left and dircmp.right

2012-07-26 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

I think it can go into 3.3 but only if it gets reviewed by another core dev 
(we're in release candidate stage now). Senthil - can you review the patch 
together with me?

As for customizing the stream, yes, go ahead and open a new issue for it, and 
add me there as nosy.

--

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



[issue15360] Behavior of assigning to __dict__ is not documented

2012-07-26 Thread Chris Rebert

Changes by Chris Rebert pyb...@rebertia.com:


--
nosy: +cvrebert

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



[issue15451] PATH is not honored in subprocess.Popen in win32

2012-07-26 Thread Chris Rebert

Changes by Chris Rebert pyb...@rebertia.com:


--
nosy: +cvrebert

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



[issue15453] ctype with packed bitfields does not match native compiler

2012-07-26 Thread Mike Castle

New submission from Mike Castle dalg...@gmail.com:

On debian/testing with python 2.7.3rc2 and gcc 4.7.1.

I was trying to use ctypeslib to wrap libdvdnav and running into some issues 
porting my test C code to Python, eventually tracking it down to this 
difference between how ctypes and gcc handles bitfields in packed structs 
(i.e., affects real world problems).

Basically, by default, gcc treats 8, 16 and 32 bit types in bit fields as 1 
byte when using __attribute__ ((packed)) , while ctypes treats them each as 1, 
2 and 4 bytes even when using _pack_ = 1.  (and libdvdnav using packed a lot)

Output from the attached programs:

$ ./a.out
1
1
1
$ ./t.py
1
2
4

Removing the packed attribute or building with gcc -mms-bitfields both match 
the ctypes expectations (though -mms-bitfields is probably rarely used in 
Linux).

--
components: ctypes
files: t.py
messages: 166462
nosy: Mike.Castle
priority: normal
severity: normal
status: open
title: ctype with packed bitfields does not match native compiler
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file26521/t.py

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



[issue15453] ctype with packed bitfields does not match native compiler

2012-07-26 Thread Mike Castle

Mike Castle dalg...@gmail.com added the comment:

And the C version

--
Added file: http://bugs.python.org/file26522/t.c

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



[issue15453] ctype with packed bitfields does not match native compiler

2012-07-26 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
nosy: +mark.dickinson, meador.inge

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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-26 Thread Chris Jerdonek

New submission from Chris Jerdonek chris.jerdo...@gmail.com:

Currently, filecmp.dircmp's report(), report_partial_closure(), and 
report_full_closure() methods all only allow printing to stdout.

This issue is to provide some way for the caller to control the stream to which 
these methods print their output (e.g. a 'stream' argument on the three 
methods).

This suggestion was made by Eli in the discussion for issue 15269.

--
components: Library (Lib)
keywords: easy
messages: 166464
nosy: cjerdonek, eli.bendersky
priority: normal
severity: normal
status: open
title: Allow dircmp.report() output stream to be customized
type: enhancement
versions: Python 3.4

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



[issue15269] Document dircmp.left and dircmp.right

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Sounds good.  And for the record, new issue created here: issue 15454

--

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



[issue9914] trace/profile conflict with the use of sys.modules[__name__]

2012-07-26 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

This is a tricky one. Long term, the right approach is to migrate all the 
scripts that run other scripts over to runpy, but the runpy API needs work 
before we can do that (see #9325).

For bug fix purposes though, these modules can borrow some of runpy's 
infrastructure in order to fake the system state correctly. Specifically, the 
runpy._TempModule and runpy._ModifiedArgv0 context managers. (_TempModule may 
need a tweak to allow the module to be used to be passed in rather than always 
being implicitly created)

See runpy._run_module_code for an example of how to use them.

--

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



[issue15455] index entries not showing up in glossary

2012-07-26 Thread Chris Jerdonek

New submission from Chris Jerdonek chris.jerdo...@gmail.com:

I haven't tracked down the reason for this, but certain index entries seem to 
be getting skipped in the Glossary.  If you view source on the Glossary page 
and search for index-:

http://docs.python.org/dev/glossary.html

You will find that it skips from 'index-2' to 'index-5'.  Only :pep: index 
entries are getting included even though the Glossary's rst file contains 
explicit index directives (where 'index-3' and 'index-4' would otherwise be).

I tried some experiments, and this seems to occur even if the index directive 
text does not match the name of the Glossary term.

--
assignee: docs@python
components: Documentation
messages: 166467
nosy: cjerdonek, docs@python
priority: normal
severity: normal
status: open
title: index entries not showing up in glossary
type: behavior
versions: Python 3.3

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



[issue15452] Eliminate the use of eval() in the logging config implementation

2012-07-26 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

It's not actually the PEP 391 implementation - dictConfig() - that uses eval(). 
Rather, it's the older fileConfig() API which was part of the original logging 
package when added to Python 2.3. The use of eval() by fileConfig() was 
documented at that time, IIRC.

I have no problem in principle with updating fileConfig() - which uses eval() 
in just one private function - to use ast.literal_eval(), but it may break 
existing, innocuous code which can't be handled by ast.literal_eval().

--

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



[issue15456] Correct __sizeof__ support for code objects

2012-07-26 Thread Serhiy Storchaka

New submission from Serhiy Storchaka storch...@gmail.com:

Here is a patch that implements __sizeof__ for code objects (PyCodeObject) 
counting co_cell2arg array.

--
components: Interpreter Core
files: code_sizeof.patch
keywords: patch
messages: 166469
nosy: storchaka
priority: normal
severity: normal
status: open
title: Correct __sizeof__ support for code objects
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26523/code_sizeof.patch

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



[issue15455] index entries not showing up in glossary

2012-07-26 Thread Ezio Melotti

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


--
nosy: +eric.araujo, ezio.melotti, georg.brandl

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



[issue15456] Correct __sizeof__ support for code objects

2012-07-26 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

See also issue12399.

--
nosy: +benjamin.peterson, ncoghlan

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-26 Thread STINNER Victor

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

+@unittest.skipIf(sys.platform == 'win32',
+Win32 can fail cwd() with invalid utf8 name)
 def test_nonascii_abspath(self):

You should not always skip the test on Windows: the filename is decodable in 
code pages other than cp932. It would be better to add the following code at 
the beginning of test_nonascii_abspath():

name = b'\xe7w\xf0'
if sys.platform == 'win32':
  try:
os.fsdecode(name)
  except UnicodeDecodeError:
self.skipTest(the filename %a is not decodable from the ANSI code page 
(%s) % (name, sys.getfilesystemencoding()))

Note: Windows does not use UTF-8 for ANSI or OEM code pages, except if you 
change it manually.

+batfile = 
+chcp 932
+{exe} {scriptname}
+chcp {codepage}
+

chcp does only change the OEM code page, whereas Python uses the ANSI code page 
for sys.getfilesystemencoding().

It is possible to change the ANSI code page of the current thread 
(CP_THREAD_ACP) using SetThreadLocale(), but it doesn't help because Python 
uses the global ANSI code page (CP_ACP). I don't think that changing the 
CP_THREAD_ACP code page does change the CP_ACP code page of child processes.

Changing the ANSI code page manually is possible in the Control Panel, but it 
requires to reboot Windows.

--

Your patch expects that os.mkdir(b'\xe7w\xf0'); os.chdir(b'\xe7w\xf0') works 
whereas I tested manually in Python, and it doesn't work because Windows 
creates a directory called \u8f42 (b'\xe7w'), see my previous message 
(msg166441). At least with a NTFS filesystem on Windows 7.

--

Your last patch tries to decode the bytes filename from the filesystem 
encoding, or uses repr(filename). I may be better to keep the bytes filenames 
unchanged in OSError.filename, instead of using repr(). But it sounds like a 
good idea to patch all PyErr_Set*WithFilename(..., char*) functions. My patch 
for  path_error() avoids the creation of a temporary bytes objets.

--

test_support.temp_cwd(b'\xe7w\xf0') test was added by the changeset 
ebdc2aa730c0 and is related to the issue #3426. I'm not sure that it was really 
expected to test b'\xe7w\xf0', because a previous test was using u'\xe7w\xf0' :

-# Issue 3426: check that abspath retuns unicode when the arg is unicode
-# and str when it's str, with both ASCII and non-ASCII cwds
-for cwd in (u'cwd', u'\xe7w\xf0'):

We may use b'\xe7w' instead of b'\xe7w\xf0' if b'\xe7w\xf0' cannot be decoded.

--

Attached patch win32_bytes_filename.patch tries to solve both issues: the test 
and UnicodeDecodeError on raising the OSError.

I tries to decode the bytes filename from the FS encoding, or keeps it 
unchanged (as bytes). As Python 2 does with os.listdir(unicode).

--
nosy: +flox
Added file: http://bugs.python.org/file26524/win32_bytes_filename.patch

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



[issue15355] generator.__next__() docs should mention exception if already executing

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

This is a very simple patch.

--
keywords: +patch
Added file: http://bugs.python.org/file26525/issue-15355-1.patch

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



[issue15451] PATH is not honored in subprocess.Popen in win32

2012-07-26 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

I think env is used for specifying the environment used by the  child process 
once it has started.  env['PATH'] is not used by the parent process to find 
program to run.

Having said that, maybe if you used shell=True as well then the shell would 
find the program using env['PATH'].

--
nosy: +sbt

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



[issue15457] consistent treatment of generator terminology

2012-07-26 Thread Chris Jerdonek

New submission from Chris Jerdonek chris.jerdo...@gmail.com:

The documentation on generators (outside of PEP 255) does not currently educate 
the reader on the more specific  generator function and generator iterator 
terminology, or at least not in any consistent or systematic way.

For example, the glossary includes only a single entry for generator, and 
that entry does not mention the two more specific forms.

I think it would help for general discourse purposes if this distinction were 
made clearer, while still continuing to allow for the use of the generic word 
generator when the context makes it clear.

There are also cases where index entries can be improved in this regard, and 
where references to the section containing details about generators can still 
be added.  I am in the process of completing a proposed patch.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 166474
nosy: cjerdonek, docs@python
priority: normal
severity: normal
status: open
title: consistent treatment of generator terminology
versions: Python 3.3

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



[issue15355] generator.__next__() docs should mention exception if already executing

2012-07-26 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
stage:  - patch review

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



[issue15457] consistent treatment of generator terminology

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Attaching patch.

--
keywords: +patch
Added file: http://bugs.python.org/file26526/issue-15457-1.patch

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



[issue15438] Incredible issue in math.pow

2012-07-26 Thread andrea bergamini

andrea bergamini andrea.bergamini...@gmail.com added the comment:

Ok guys, ticket closed, but I'm still confused: I'm not a Python expert, I've 
understood that math is a sort of wrapper of C math.h or something like this, 
but:
- I can't find any reason in using math.pow if I can get errors like the one 
explained.
- I've used math.h in my C++ code without having experienced any problem in 
that pow operation.
I'm surely missing something but I'm a bit confused...

--
status: open - closed

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



[issue15457] consistent treatment of generator terminology

2012-07-26 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
nosy: +ncoghlan

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



[issue15355] generator.__next__() docs should mention exception if already executing

2012-07-26 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
nosy: +ncoghlan

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



[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-26 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

I see that the originally proposed patch is more or less what I suggested 
above.  Since this has been a critical issue for 5 years, I think such a 
minimal patch should be committed even though it is not a complete solution.

It seems to me that the more complicated patch exception_pickling_26.diff has a 
significant overlap with _common_reduce() in typeobject.c.

The patch actually attempts to be *more* general than _common_reduce() since it 
collects data from tp_getset and tp_members, whereas _common_reduce() only 
collects data from __slots__.  The patch does not seem to take account of 
read-only members/getsetters, which I think would cause exceptions when 
unpickling.

An alternative implementation piggy-backing on _common_reduce() (and using 
__reduce__ rather than __getstate__) would be

def __reduce__(self):
slots = None
func, args, state = object.__reduce__(self, 2)[:3]
if type(state) is tuple:
state, slots = state
newstate = {'args': self.args}
if state:
newstate.update(state)
if slots:
newstate.update(slots)
return func, args, newstate

This deals correctly with slots and works with all protocols.  However, the 
pickles produced can only be unpickled on versions where exceptions are 
new-style classes, ie Python 2.5 and later.

This would have the side effect that __init__() would no longer be called while 
unpickling.

--

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



[issue15438] Incredible issue in math.pow

2012-07-26 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 - I can't find any reason in using math.pow if I can get errors like the one 
 explained.

The reason is your intention to get the error.

 pow(-1, 0.5)
(6.123031769111886e-17+1j)
 math.pow(-1, 0.5)
Traceback (most recent call last):
  File stdin, line 1, in module
ValueError: math domain error

 - I've used math.h in my C++ code without having experienced any problem in 
that pow operation.

What you get in C++ as result of pow(43, 10)?

Technically, in C++ you should use cmath header, not math.h.

--

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



[issue15438] Incredible issue in math.pow

2012-07-26 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

- I can't find any reason in using math.pow if I can get errors like the one 
explained.

Yep---don't use math.pow if you want *exact* integer results.  If you're doing 
numerical calculations and errors of around 1 part in 1 thousand million 
million are acceptable to you, then math.pow works just fine.  Just like the 
other math functions (math.log, math.exp, math.sin, etc.), it's using 
floating-point arithmetic, so converts its inputs to float and gives a float 
result.  Unlike Python ints, which have unbounded precision, Python floats have 
a fixed size (64 bits), so there are only finitely many values (less than 
2**64) that can be represented exactly.  The fact is that the number you were 
expecting, 21611482313284249, isn't one of those numbers:  it *doesn't exist* 
as a float, because it's not exactly representable in the usual 64-bit 
floating-point type that Python uses internally.

- I've used math.h in my C++ code without having experienced any problem in 
that pow operation.

I'd be quite surprised if this were true:  if you're using the double type with 
C or C++, and the pow function from math.h / cmath, you should expect to see 
*exactly* the same issues.  With the 'long double' type, you may get a little 
more precision (depending on the platform), but that just delays the point at 
which those issues would appear.

By the way, don't close the issue just yet!  There's still ongoing discussion 
here about whether
there's potential for a documentation improvement.

--
status: closed - open

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



[issue14501] Error initialising BaseManager class with 'authkey' argument of string type.

2012-07-26 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

You could just do

Server_1=TestServer(address=(127.0.0.1,5),authkey=bpasskey)

so this is probably a documentation issue.  The examples in the documentation 
should at least be updated.

--

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



[issue15364] sysconfig confused by relative paths

2012-07-26 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

Any objection if I commit the last patch before the next beta?  This is the one 
which on installed Pythons have

get_config_var('srcdir') == os.path.dirname(get_makefile_filename())

on posix systems.

--

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

 chcp does only change the OEM code page, whereas Python uses the ANSI code 
 page for sys.getfilesystemencoding().

Sorry, I should have investigated the code more carefully.

 Attached patch win32_bytes_filename.patch tries to solve both issues: the 
 test and UnicodeDecodeError on raising the OSError.

Looks good to me. Thank you!

--

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



[issue15041] tkinter documentation: update see also list

2012-07-26 Thread Roundup Robot

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

New changeset aa296d685e02 by Andrew Svetlov in branch '3.2':
Issue #15041: update see also list in tkinter documentation.
http://hg.python.org/cpython/rev/aa296d685e02

New changeset e2ab56295b56 by Andrew Svetlov in branch 'default':
Issue #15041: update see also list in tkinter documentation.
http://hg.python.org/cpython/rev/e2ab56295b56

New changeset c947f493ccec by Andrew Svetlov in branch '2.7':
Issue #15041: Update see also list in tkinter documentation.
http://hg.python.org/cpython/rev/c947f493ccec

--
nosy: +python-dev

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



[issue10296] ctypes catches BreakPoint error on windows 32

2012-07-26 Thread Atsuo Ishimoto

Changes by Atsuo Ishimoto ishim...@gembook.org:


--
nosy: +ishimoto

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



[issue15452] Eliminate the use of eval() in the logging config implementation

2012-07-26 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

Initial evaluation indicates that ast.literal_eval doesn't cut the mustard: it 
doesn't do any name lookups, so you can't for example successfully evaluate 
something like 'handlers.WatchedFileHandler' or even 'FileHandler'. 

However, a limited evaluator which goes further than ast.literal_eval will 
probably work. One such is shown in this Gist:

https://gist.github.com/3182304

It supports a reasonable subset of Python expressions and also could be useful 
in other contexts than logging configuration.

--

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



[issue15402] Correct __sizeof__ support for struct

2012-07-26 Thread Martin v . Löwis

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

 What if use totalsize = object.__sizeof__(struct_obj) ?

That would defeat the purpose of the test. We want to test whether __sizeof__ 
is correct, so we shouldn't use __sizeof__ in the test to compute the expected 
result. I understand that object.__sizeof__ is actually a different 
implementation, but still: there might be errors e.g. in the type definition 
that cancel out errors in the sizeof implementation. The more directly the 
expected result is computed, the better.

I also realize that such tests will be fragile if the the structures change. 
This is a good thing, IMO: anybody changing the layout of some object should 
*have* to verify that the size computation is still correct, so it's good that 
the test breaks if the structures change.

--

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



[issue10296] ctypes catches BreakPoint error on windows 32

2012-07-26 Thread Antoine Pitrou

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


--
nosy: +meador.inge

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



[issue15093] ntpath.isdir returns False for directory symlinks

2012-07-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

On Windows, 'target_is_directory' is required for directory symlink.

python -c import os; os.mkdir('bar'); os.symlink('bar', 'foo', 
target_is_directory=True); print(os.path.isdir('foo'))
True

Should we automatically specify target_is_directory if target exists and the 
target is a directory?

--
nosy: +ishimoto

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



[issue15093] ntpath.isdir returns False for directory symlinks

2012-07-26 Thread Antoine Pitrou

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

 Should we automatically specify target_is_directory if target exists and the 
 target is a directory?

No, see issue14917 and issue13772.

--
nosy: +pitrou

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



[issue15093] ntpath.isdir returns False for directory symlinks

2012-07-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

ah, thank you for pointer! I should have googled before I wrote.

--

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



[issue15093] ntpath.isdir returns False for directory symlinks

2012-07-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

Jason: You can re-activate test you disabled if you use target_is_directory. 
Please take a look at a issue15093.patch.

--
keywords: +patch
Added file: http://bugs.python.org/file26527/issue15093.patch

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



[issue15093] ntpath.isdir returns False for directory symlinks

2012-07-26 Thread Atsuo Ishimoto

Atsuo Ishimoto ishim...@gembook.org added the comment:

I think we can close this ticket as won't fix.

--

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



[issue7996] concurrency problem in regrtest -jX

2012-07-26 Thread Ross Lagerwall

Changes by Ross Lagerwall rosslagerw...@gmail.com:


--
resolution:  - duplicate
status: open - closed
superseder:  - thread-safety issue in regrtest.main()

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



[issue11602] python-config code should be in sysconfig

2012-07-26 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
nosy: +barry

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



[issue15458] Add python-config --configdir option

2012-07-26 Thread Barry A. Warsaw

New submission from Barry A. Warsaw ba...@python.org:

To assist with vendor builds, Matthias has requested added a --configdir option 
to the python3-config script.  This would return 
sysconfig.get_config_var('LIBPL').  The value is embedded in the output for 
--ldflags, but not in a convenient way.

The change is fairly trivial; see attached patch.  I am assigning this to Georg 
and making it a release blocker because I would like to get a freeze exemption 
for Python 3.3.  If Georg agrees, I will commit the patch.  If not, please 
twiddle Priority, Versions, and Assigned To as appropriate.

--
assignee: georg.brandl
files: configdir.diff
keywords: patch
messages: 166491
nosy: barry, georg.brandl
priority: release blocker
severity: normal
status: open
title: Add python-config --configdir option
versions: Python 3.3
Added file: http://bugs.python.org/file26528/configdir.diff

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



[issue15360] Behavior of assigning to __dict__ is not documented

2012-07-26 Thread Antoine Pitrou

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

I think assigning to __dict__ is an implementation detail; we shouldn't 
document it before it is clearly agreed what it should do (which probably 
deserves asking on python-dev).

--
nosy: +pitrou

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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-26 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc amaur...@gmail.com:


--
stage:  - needs patch

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



[issue15438] Incredible issue in math.pow

2012-07-26 Thread Amaury Forgeot d'Arc

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

C comparison rules are different from Python's.
In the program below (which outputs 1), the mixed comparison will first convert 
the literal to a double, and lost some precision.
Python does the opposite: the (imprecise) float is converted to a long, so all 
digits are compared.


#include math.h
#include stdio.h
int main()
{
printf(result: %d\n, (pow(43,10) == 21611482313284249));
}

--
nosy: +amaury.forgeotdarc

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



[issue15133] tkinter.BooleanVar.get() behavior and docstring disagree

2012-07-26 Thread Christian Rickert

Christian Rickert m...@crickert.de added the comment:

Noticed this odd behaviour with BooleanVar.get() as well:

class MyCheckbutton(Checkbutton):
def __init__(self, parent, **options):
Checkbutton.__init__(self, parent, **options)
self.var = BooleanVar()
self.configure(indicatoron=False, command=self.cb, 
variable=self.var)
print(self.var.get) # bound method BooleanVar.get of 
tkinter.BooleanVar object at 0x245c310
print(self.var.get())   # 0
def cb(self, *events): # button callback (manual toggle)
print(self.var.get) # bound method BooleanVar.get of 
tkinter.BooleanVar object at 0x245c310
print(self.var.get())   # True

Python 3.2.3 (default, May  3 2012, 15:51:42) 
[GCC 4.6.3] on linux2

--
nosy: +crickert
versions:  -Python 2.7, Python 3.3

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



[issue15452] Eliminate the use of eval() in the logging config implementation

2012-07-26 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

Having reflected on this further, ISTM that limiting the scope of evaluation is 
not the correct answer. For example, a malicious user could still send a bogus 
configuration which, for example, just turns the verbosity of all loggers off, 
or configures a huge number of bogus loggers. This would certainly be allowed 
even by a limited-evaluation scheme if a user legitimately wanted to do so; but 
if a malicious user sends the exact same “legal” configuration, it is still a 
security exploit because the consequences may be undesirable to the victim.

But how is the listener to know whether or not the configuration is coming from 
a legitimate source (a client process controlled by the same user who is 
running the process which uses listen())  or a malicious user (a client process 
controlled by some other user)? The simplest answer would appear to be a shared 
secret: When listen() is called, it is passed a text passphrase, which is also 
known to legitimate clients. When handling a configuration request via the 
socket, the configuration is checked to see if it contains the passphrase. If 
it does, the request is processed; otherwise, it is ignored.

In the fileConfig() input data, the passphrase could be provided via a 
passphrase=secret entry in the [default] section. In the dictConfig() input 
data, the passphrase could be provided against the passphrase key in the dict 
which is passed to dictConfig(). The checking would be done in the request 
handler code before calling fileConfig() or dictConfig(). If the passphrase 
argument to the listen() call is None (the default, preserving the current 
behaviour) no passphrase checking would be done.

--

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



[issue15459] ctypes Structures with subclassed types in the _fields_ list

2012-07-26 Thread Thomas Heller

New submission from Thomas Heller thel...@ctypes.org:

When a ctypes Structure uses a subclass of c_int, c_short, c_byte in the 
_fields_ list to define bitfields, the results are wrong.

The attached script showbug.py demonstrates this behaviour.

--
components: ctypes
files: showbug.py
keywords: needs review, patch
messages: 166496
nosy: theller
priority: normal
severity: normal
status: open
title: ctypes Structures with subclassed types in the _fields_ list
versions: Python 2.7, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file26529/showbug.py

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



[issue15459] ctypes Structures with subclassed types in the _fields_ list

2012-07-26 Thread Thomas Heller

Thomas Heller thel...@ctypes.org added the comment:

The attached patch for branch default fixes this issue.  It also contains a 
unittest.

--
Added file: http://bugs.python.org/file26530/bitfields.patch

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



[issue15460] SQLite cursor.description is not DB-API compatible

2012-07-26 Thread Charlie Clark

New submission from Charlie Clark charlie.cl...@clark-consulting.eu:

It says in the docs:
This read-only attribute provides the column names of the last query. To 
remain compatible with the Python DB API, it returns a 7-tuple for each column 
where the last six items of each tuple are None.

According to the DB-API, however, the first two items, name and type, must be 
specified:

The first two items (name and type_code) are mandatory, the other five are 
optional and are set to None if no meaningful values can be provided.


Even with it's limited number of types SQLite is typed and should be able to 
return the type for column.

--
components: Library (Lib)
messages: 166498
nosy: CharlieX
priority: normal
severity: normal
status: open
title: SQLite cursor.description is not DB-API compatible
type: behavior

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



[issue15403] Refactor package creation support code into a common location

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

It occurs to me that the filecmp/dircmp tests in Lib/test/test_filecmp.py would 
also benefit from code like this (i.e. being able to create a nested directory 
of files in one or two lines).  And perhaps elsewhere in the tests.

This is an argument for slightly generalizing the test support API in the 
uploaded patch from creating modules/packages to creating files/directories.  A 
convenience wrapper for packages could still be included that includes an 
__init__.py in the calls to the underlying directory code.

--

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



[issue15459] ctypes Structures with subclassed types in the _fields_ list

2012-07-26 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue13772] listdir() doesn't work with non-trivial symlinks

2012-07-26 Thread Jason R. Coombs

Jason R. Coombs jar...@jaraco.com added the comment:

I apologize I missed this issue when it arose, so my comments come late.

The reason for inferring the directory status of the targets was so that use of 
os.symlink(link, target) would behave much the same on Unix as on Windows for 
the most common use cases. By requiring the directory status to be supplied 
when calling os.symlink, it makes the function barely portable (it becomes only 
portable for symlinks to files, not directories).

As was indicated by Larry Hastings in issue14917, there's an expectation that 
Python could easily detect the directory status of the target. There was 
apparently a bug in the earlier detection code for directories, which doesn't 
exist in the [reference 
implementation](https://bitbucket.org/jaraco/jaraco.windows/src/2.7/jaraco/windows/filesystem/__init__.py#cl-46)
 (done in ctypes):

PS C:\Users\jaraco\projects\jaraco.windows mkdir -p Lib/test/foo
PS C:\Users\jaraco\projects\jaraco.windows python
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on 
win32
Type help, copyright, credits or license for more information.
 from jaraco.windows import filesystem as fs
 fs.symlink('.\\test', 'Lib/bar')
 import os
 os.listdir('Lib/bar')
['foo']

I suspect this bug crept in as we worked through the various challenges with 
directory detection at that low level of Python. As you can see, the reference 
implementation is clean an straightforward and correct.

In my opinion, it would be worthwhile restoring the directory detection and 
creating tests to capture cases where detection fails, rather than removing the 
implementation.

I've been using the ctypes implementation for some time, and having automatic 
directory detection is a huge benefit to portability and simplicity of use.

It was pointed out that there is a race condition, and theoretically, that is 
true, but I believe this not to be a problem because the automatic detection is 
a best-effort. It's used to guess the best possible directory status for the 
symlink. If there's a directory there one millisecond, then the target is then 
removed, and the symlink is created as a directory symlink, that's most 
probably still what the user would have wanted.

As a heavy user of symlinks in Windows, I would strongly prefer inference of 
directory status. Of course, I can always continue to use the ctypes 
implementation in my environments, but I imagine that other potential users 
would feel the same as I do and would appreciate a more portable implementation.

Without the directory feature, many uses of os.symlink are not portable and 
will fail (with ugly results) on Windows. With the directory detection feature, 
most (if not all) will simply work as expected. Removal of this feature is a 
regression of the intended functionality, and I'd like it to be considered to 
be restored.

--
nosy: +jason.coombs

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



[issue15093] ntpath.isdir returns False for directory symlinks

2012-07-26 Thread Roundup Robot

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

New changeset 5bf7afd944a2 by Jason R. Coombs in branch 'default':
Restored test by specifying that the symlink links to a target (currently 
required for Windows symlinks). See issue15093 for details.
http://hg.python.org/cpython/rev/5bf7afd944a2

--

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



[issue15093] ntpath.isdir returns False for directory symlinks

2012-07-26 Thread Jason R. Coombs

Jason R. Coombs jar...@jaraco.com added the comment:

Thanks ishimoto for getting to the bottom of this. Thanks pitrou for the links 
to the symlink implementation changes.

Yes, this issue as reported was invalid.

--
resolution:  - invalid
status: open - closed

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



[issue15041] tkinter documentation: update see also list

2012-07-26 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


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

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



[issue15450] Allow dircmp.subdirs to behave well under subclassing

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Adding a patch with a failing test for the issue.

--
keywords: +patch
stage:  - needs patch
Added file: http://bugs.python.org/file26531/issue-15450-failing-test.patch

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



[issue15438] Incredible issue in math.pow

2012-07-26 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Ah yes; a comparison like that could indeed give the impression that C/C++ was 
computing things exactly. :-)

--

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



[issue15450] Allow dircmp.subdirs to behave well under subclassing

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Attaching full patch (though Misc/NEWS would need to be moved a new section is 
created for pre-alpha).

--
Added file: http://bugs.python.org/file26532/issue-15450-1.patch

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



[issue15450] Allow dircmp.subdirs to behave well under subclassing

2012-07-26 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
stage: needs patch - patch review

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



[issue15364] sysconfig confused by relative paths

2012-07-26 Thread Ned Deily

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

LGTM

--
stage: patch review - commit review

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



[issue15450] Allow dircmp.subdirs to behave well under subclassing

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Actually, this should also be documented.

--
stage: patch review - needs patch

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



[issue15402] Correct __sizeof__ support for struct

2012-07-26 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 That would defeat the purpose of the test. We want to test whether
 __sizeof__ is correct, so we shouldn't use __sizeof__ in the test to
 compute the expected result. I understand that object.__sizeof__ is
 actually a different implementation, but still: there might be errors e.g.
 in the type definition that cancel out errors in the sizeof
 implementation. The more directly the expected result is computed, the
 better.

I do not think that the purpose of testing is a testing of object.__sizeof__. 
Memory consumption consists of two parts -- memory for C structure (and the 
base object implementation works for this) and extra memory, for which we 
write a specialized __sizeof__ method. If we doubt object.__sizeof__, then we 
are obligated to implement and test __sizeof__ methods for all C-implemented 
classes, not using the base object implementation.

 I also realize that such tests will be fragile if the the structures
 change. This is a good thing, IMO: anybody changing the layout of some
 object should *have* to verify that the size computation is still correct,
 so it's good that the test breaks if the structures change.

Such tests is too fragile. They force the programmer to write unnecessary code 
in cases when it can be done automatically. We write in C code 
sizeof(SomeStruct), and not the sum of sizes (+paddings) of the structure 
fields.

Let's focus on the differences, on the extra memory usage that not allows us to 
simply use inherited base object implementation.

--

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



[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-26 Thread Martin v . Löwis

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

I still would prefer if only one issue at a time gets fixed, in particular if 
the two issues require independent changes. This issue is about 
test_nonascii_abspath failing on the Japanese edition of Windows (see the first 
sentence of the first message from Atsuo)

If you absolutely must fix the other issue right away also, it needs a test 
case.

--

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



[issue15458] Add python-config --configdir option

2012-07-26 Thread Georg Brandl

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

I guess we can do this, looks fine to me.

--

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



[issue15402] Correct __sizeof__ support for struct

2012-07-26 Thread Martin v . Löwis

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

 I do not think that the purpose of testing is a testing of object.__sizeof__. 
 Memory consumption consists of two parts -- memory for C structure (and the 
 base object implementation works for this)

Note that object.__sizeof__ does something slightly different, though:
it uses basicsize (which may or may not contain the sizeof() invocation
of the correct C structure), and it considers tp_itemsize (which may or
may not have a correct value).

 
 I also realize that such tests will be fragile if the the structures
 change. This is a good thing, IMO: anybody changing the layout of some
 object should *have* to verify that the size computation is still correct,
 so it's good that the test breaks if the structures change.
 
 Such tests is too fragile. They force the programmer to write unnecessary 
 code 
 in cases when it can be done automatically.

That's not the definition of fragile, though. What you describe is
that writing the test this way is tedious (утомительный); it isn't
(necessarily) fragile (хрупкий). I (clearly) disagree that this
approach is too tedious.

--

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



[issue15456] Correct __sizeof__ support for code objects

2012-07-26 Thread Martin v . Löwis

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

Interestingly, the original patch did change the sizeof test, but incorrectly 
(adding the extra pointer to the struct spec, but failing to recognize that 
there is additional memory allocated).

This tells me

a) we *absolutely* need to preserve the current testing style where the test 
cases count the individual fields (see issue15402 for the related discussion). 
Had the test used object.__sizeof__, it would not have needed any change to 
continue to pass, losing all hope that somebody might have detected it except 
by very careful review.

b) the trigger that the test broke apparently was not sufficient to hint 
Benjamin that the sizeof implementation may be incorrect, he just assumed that 
the test was incorrect.

--
nosy: +loewis

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



[issue12399] simplify cell var initialization by storing constant data on the code object

2012-07-26 Thread Martin v . Löwis

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

See issue15456 for a follow-up issue.

--
nosy: +loewis

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



[issue15456] Correct __sizeof__ support for code objects

2012-07-26 Thread Roundup Robot

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

New changeset 5093cfdff2a9 by Martin v. Löwis in branch 'default':
Issue #15456: Fix code __sizeof__ after #12399 change.
http://hg.python.org/cpython/rev/5093cfdff2a9

--
nosy: +python-dev

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



[issue12399] simplify cell var initialization by storing constant data on the code object

2012-07-26 Thread Roundup Robot

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

New changeset 5093cfdff2a9 by Martin v. Löwis in branch 'default':
Issue #15456: Fix code __sizeof__ after #12399 change.
http://hg.python.org/cpython/rev/5093cfdff2a9

--

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



[issue15456] Correct __sizeof__ support for code objects

2012-07-26 Thread Martin v . Löwis

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

Thanks for the patch!

--
resolution:  - fixed
status: open - closed

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



[issue15402] Correct __sizeof__ support for struct

2012-07-26 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 Note that object.__sizeof__ does something slightly different, though:
 it uses basicsize (which may or may not contain the sizeof() invocation
 of the correct C structure), and it considers tp_itemsize (which may or
 may not have a correct value).

All such cases are bugs (memory manager works with tp_basicsize and 
tp_itemsize, not with __sizeof__ result) and tests do not test it. In 
paranoidal mode we should tests both __sizeof__ and object.__sizeof__. For all 
classes, even for those that do not use the extra memory. I think it is really 
tedious.

--

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



[issue15402] Correct __sizeof__ support for struct

2012-07-26 Thread Martin v . Löwis

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

 All such cases are bugs (memory manager works with tp_basicsize and 
 tp_itemsize, not with __sizeof__ result) and tests do not test it. In 
 paranoidal mode we should tests both __sizeof__ and object.__sizeof__. For 
 all 
 classes, even for those that do not use the extra memory. I think it is 
 really 
 tedious.

It's clearly a tradeoff. The question is whether a more paranoid
formulation of the test might detect any real bugs. issue15456
efficiently demonstrates that the current style can detect bugs
which testing with object.__sizeof__ can't. This is not theoretical:
it's an *actual* bug that did get detected with the current style
of testing, but would not have been detected with object.__sizeof__.
This, IMO, makes the more tedious formulation worthwhile.

Of course, developers need to be educated how to deal with any
breakage of these tests: it may be that they really just added
or removed fields to the structure, in which case they just need
to update the struct specs. In many cases, I claim, addition of
new fields (in particular of struct type P) corresponds to the
allocation of additional memory blocks.

--

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



[issue15461] os.stat() 's inappropriate behavior when dealing with a broken link in linux systems.

2012-07-26 Thread coder.maliubiao

New submission from coder.maliubiao maliub...@gmail.com:

the code:
import os,stat
mode=os.stat(a broken link file).st_mode
then i got :OSError: [Errno 2] No such file or directory.

why not just treat a broken link as something existing and don't report any 
error.

--
components: Library (Lib)
messages: 166519
nosy: maliub...@gmail.com
priority: normal
severity: normal
status: open
title: os.stat() 's inappropriate behavior when dealing with a broken link in 
linux systems.
type: behavior
versions: Python 2.7

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



[issue15462] UTF8 BOM incorrectly prepended syslog messages when using rsysolog

2012-07-26 Thread Aimon Bustardo

New submission from Aimon Bustardo abusta...@morphlabs.com:

Ubuntu 12.0.4 LTS 64bit
python2.7-minimal 2.7.3-0ubuntu3
rsyslog 5.8.6-1ubuntu8

Python converts all syslog messages to UTF8 before sending to syslog. It also 
prepends the Byte Order Mark (BOM) of the Unicode Standard. This prepended BOM 
causes bad characters when using rsyslog (have not verified with std syslog or 
syslog-ng).

Example log line:

Jul 25 13:36:03 mc 2012-07-25 13:36:03 INFO nova.api.openstack.wsgi 
[req-48a555a5-6d2a-4a38-8384-3b4684357e72 19f932a5b0b34655989f4cb761522bb3 
2617e657fdf84569a6be7977318e46c8] 
http://MASKED:8774/v1.1/2617e657fdf84569a6be7977318e46c8/os-hosts/MASKED.json?ignore_awful_caching1343248563
 returned with HTTP 200

Note the ' ' before the date field.

Interesting find on issues from another site:

Yes,  is the Byte Order Mark (BOM) of the Unicode Standard. Specifically 
it is the hex bytes EF BB BF, which form the UTF-8 representation of the BOM, 
misinterpreted as ISO 8859/1 text instead of UTF-8.

If I patch the code in /usr/lib/python2.7/logging/handlers.py:
--
@@ -797,9 +797,10 @@
 self.mapPriority(record.levelname))
 # Message is a string. Convert to bytes as required by RFC 5424
 if type(msg) is unicode:
msg = msg.encode('utf-8')
- if codecs:
- msg = codecs.BOM_UTF8 + msg
+ #if codecs:
+ # msg = codecs.BOM_UTF8 + msg
 msg = prio + msg
 try:
 if self.unixsocket:



The logs will now appear normally. What is happening with the 'codecs' 
condition? Is this controllable through config? Is this a bug in rsyslog? 

Related tickets:

https://bugs.launchpad.net/openstack-common/+bug/1029116
https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/1029640
http://bugzilla.adiscon.com/show_bug.cgi?id=346

--
components: IO, Library (Lib), Unicode
messages: 166520
nosy: Aimon.Bustardo, ezio.melotti
priority: normal
severity: normal
status: open
title: UTF8 BOM incorrectly prepended syslog messages when using rsysolog
type: behavior
versions: Python 2.7

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



[issue15041] tkinter documentation: update see also list

2012-07-26 Thread Éric Araujo

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

FYI, there is no need to add a Misc/NEWS entry for such small doc changes (and 
especially not in the Library section :)  The Documentation section of 
Misc/NEWS is used for important changes to the doc or the toolchain, not the 
everyday changes we do.

--
nosy: +eric.araujo

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



[issue15459] ctypes Structures with subclassed types in the _fields_ list

2012-07-26 Thread Éric Araujo

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


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge
stage:  - patch review
versions: +Python 3.2 -Python 3.4

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



[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-07-26 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
nosy: +brett.cannon

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



[issue15364] sysconfig confused by relative paths

2012-07-26 Thread Éric Araujo

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

Does get_config_var('srcdir') always return a string or sometimes None?

--

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



[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-26 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

While I would be happy to see this issue finally closed, but it's up to Georg 
if this goes into 3.3 or not as one could argue it's a feature or a 
bugfix/oversight.

As for the actual fix, classic classes shouldn't hold back a good solution 
since that is a 2.x thing that only affects Python 2.4 which is too old to 
worry about; I think it's an acceptable limitation.

--

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



[issue15458] Add python-config --configdir option

2012-07-26 Thread Roundup Robot

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

New changeset ddf15cd9be4a by Barry Warsaw in branch 'default':
- Issue #15458: python-config gets a new option --configdir to print the
http://hg.python.org/cpython/rev/ddf15cd9be4a

--
nosy: +python-dev

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



[issue15458] Add python-config --configdir option

2012-07-26 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
resolution:  - fixed
status: open - closed

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



[issue15364] sysconfig confused by relative paths

2012-07-26 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

 Does get_config_var('srcdir') always return a string or sometimes None?

Always a string.

distutils.support._get_xxmodule_path() is one place which (currently) would 
throw an exception if it returned None.

--

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



[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-26 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

I realize now that the idea of using object.__reduce__(..., 2) would not really 
work since many exception classes use non-slot descriptors (unless '__slots__' 
attributes were also added as hints of what to serialize).

I think there are two options simple enough to sneak in to 3.3:

(1) The trivial patch of initially setting self-args in __new__().

(2) Georg's idea of additionally setting a __newargs__ attribute in __new__() 
and using it in __reduce__().  However, I would store __newargs__ directly in 
the struct to avoid always triggering creation of a dict for the instance.

--

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



[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-26 Thread Antoine Pitrou

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

 I think there are two options simple enough to sneak in to 3.3:
 
 (1) The trivial patch of initially setting self-args in __new__().
 
 (2) Georg's idea of additionally setting a __newargs__ attribute in
 __new__() and using it in __reduce__().  However, I would store
 __newargs__ directly in the struct to avoid always triggering creation
 of a dict for the instance.

At this point of the release process, the trivial approach sounds safer
to me (but is it?).

--

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



[issue11602] python-config code should be in sysconfig

2012-07-26 Thread Ned Deily

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


--
nosy: +ned.deily

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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

For discussion purposes, I'd like to mention an alternate approach.  (I haven't 
yet formed an opinion on what approach is preferable.)

Python's built-in print() function accepts more than just a 'file' keyword 
argument:

http://docs.python.org/dev/library/functions.html#print

In addition, because adding a stream argument would require modifying the 
signatures of three different methods, adding a stream argument might not set 
us on the right path if we'd like to add support for more arguments to print() 
in the future (or add additional methods that print output alongside the 
existing reporting methods).

Another approach is to add a print() method to the dircmp class and have the 
report methods call self.print() instead of print().  With this approach, 
callers wanting a different output stream could subclass dircmp and override 
the print method.  This approach also seems like it would offer more 
flexibility.

--

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



[issue13772] listdir() doesn't work with non-trivial symlinks

2012-07-26 Thread Antoine Pitrou

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

Le jeudi 26 juillet 2012 à 19:12 +, Jason R. Coombs a écrit :
 Without the directory feature, many uses of os.symlink are not
 portable and will fail (with ugly results) on Windows.

The target_is_directory argument is supposed to be supported (i.e.
ignored) on other platforms, so you should be able to write portable
code easily.

I'm not against restoring detection, but it should be non-buggy and
correctly unit-tested :) That said it's probably too late for 3.3.

--

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



[issue9269] Cannot pickle self-referencing sets

2012-07-26 Thread Stefan Mihaila

Stefan Mihaila mstefa...@gmail.com added the comment:

I have attached a fix to this issue (and implicitly issue1062277).

This patch allows pickling self-referential sets by implementing a 
set.__reduce__ which uses states as opposed to ctor parameters.

Before:
 s=set([1,2,3])
 s.__reduce__()
(class 'set', ([1, 2, 3],), None)
 len(pickle.dumps(s,1))
38

After:
 s=set([1,2,3])
 s.__reduce__()
(class 'set', (), [1, 2, 3])
 len(pickle.dumps(s,1))
36

Basically what this does is: instead of unpickling the set by doing 
set([1,2,3]) it does s=set(); s.__setstate__([1,2,3]).
States are supported in all versions of pickle so this shouldn't break anything.
Creating empty data structures and then filling them is the way pickle does it 
for all mutable containers in order to allow self-references (with the 
exception of sets, of course).

Since memoization is performed after the object is created but before its state 
is set, pickling an object's state can contain references to oneself.

class A:
pass

a=A()
s=set([a])
a.s=s

s_=loads(dumps(s,1))
next(iter(s_)).s is s_ # True

Note that this fix only applies for sets, not frozensets. Frozensets are a 
different matter, because their immutability makes it impossible to set their 
state. Self-referential frozensets are currently supported in my implementation 
of pickle4 using a trick similar to what tuples use. But the trick works more 
easily there because frozensets have their own opcodes, like tuples.

Also note that applying this patch makes 
Lib/test/pickletester.py:test_pickle_to_2x fail (DATA3 and DATA6 there contain 
pickled data of sets, which naturally have changed).
I'll upload a patch fixing this as well as adding one or more test for sets 
soon.

--
keywords: +patch
nosy: +mstefanro
Added file: http://bugs.python.org/file26533/self_referential-sets.patch

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



[issue1062277] Pickle breakage with reduction of recursive structures

2012-07-26 Thread mike bayer

Changes by mike bayer mike...@zzzcomputing.com:


--
nosy: +zzzeek

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



[issue15463] test_faulthandler can fail if install path is too long

2012-07-26 Thread Ned Deily

New submission from Ned Deily n...@acm.org:

==
FAIL: test_dump_traceback_threads (test.test_faulthandler.FaultHandlerTests)
--
Traceback (most recent call last):
  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/3.3/lib/python3.3/test/test_faulthandler.py,
 line 365, in test_dump_traceback_threads
self.check_dump_traceback_threads(None)
  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/3.3/lib/python3.3/test/test_faulthandler.py,
 line 361, in check_dump_traceback_threads
self.assertRegex(output, regex)
AssertionError: Regex didn't match: '^Thread 0x[0-9a-f]+:\n(?:  File 
.*threading.py, line [0-9]+ in [_a-z]+\n){1,3}  File string, line 23 in 
run\n  File .*threading.py, line [0-9]+ in _bootstrap_inner\n  File 
.*threading.py, line [0-9]+ in _bootstrap\n\nCurrent thread XXX:\n  File 
string, line 10 in dump\n  File string, line 28 in module$' not found 
in 'Thread 0x000103a4a000:\n  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/...,
 line 184 in wait\n  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/...,
 line 330 in wait\n  File string, line 23 in run\n  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/...,
 line 639 in _bootstrap_inner\n  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/...,
 line 616 in _bootstrap\n\nCurrent thr
 ead XXX:\n  File string, line 10 in dump\n  File string, line 28 in 
module'

==
FAIL: test_dump_traceback_threads_file 
(test.test_faulthandler.FaultHandlerTests)
--
Traceback (most recent call last):
  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/3.3/lib/python3.3/test/test_faulthandler.py,
 line 369, in test_dump_traceback_threads_file
self.check_dump_traceback_threads(filename)
  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/3.3/lib/python3.3/test/test_faulthandler.py,
 line 361, in check_dump_traceback_threads
self.assertRegex(output, regex)
AssertionError: Regex didn't match: '^Thread 0x[0-9a-f]+:\n(?:  File 
.*threading.py, line [0-9]+ in [_a-z]+\n){1,3}  File string, line 23 in 
run\n  File .*threading.py, line [0-9]+ in _bootstrap_inner\n  File 
.*threading.py, line [0-9]+ in _bootstrap\n\nCurrent thread XXX:\n  File 
string, line 8 in dump\n  File string, line 28 in module$' not found 
in 'Thread 0x000105215000:\n  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/...,
 line 184 in wait\n  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/...,
 line 330 in wait\n  File string, line 23 in run\n  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/...,
 line 639 in _bootstrap_inner\n  File 
/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/...,
 line 616 in _bootstrap\n\nCurrent thre
 ad XXX:\n  File string, line 8 in dump\n  File string, line 28 in 
module'

--
Ran 27 tests in 20.582s

FAILED (failures=2)
test test_faulthandler failed

The two failing tests call check_dump_traceback_threads which has a regex to 
find threading.py in the traceback but the path is truncated in the traceback 
so threading.py doesn't appear.

--
components: Tests
messages: 166531
nosy: haypo, ned.deily
priority: low
severity: normal
status: open
title: test_faulthandler can fail if install path is too long
versions: Python 3.3

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



[issue15464] ssl: add set_msg_callback function

2012-07-26 Thread Thiébaud Weksteen

New submission from Thiébaud Weksteen thieb...@weksteen.fr:

I wrote a patch for Python 3 to expose the function
SSL_CTX_set_msg_callback in the module ssl.

Here is a description of this function:
SSL_CTX_set_msg_callback() or SSL_set_msg_callback() can be used
to define a message callback function cb for observing all SSL/TLS
protocol messages (such as handshake messages) that are received or sent.

There is also a test case included in the patch.

Comments are welcomed.

--
components: Extension Modules
files: ssl_msg_callback.patch
keywords: patch
messages: 166532
nosy: tweksteen
priority: normal
severity: normal
status: open
title: ssl: add set_msg_callback function
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file26534/ssl_msg_callback.patch

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



[issue15461] os.stat() 's inappropriate behavior when dealing with a broken link in linux systems.

2012-07-26 Thread R. David Murray

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

Because we are doing what the linux stat call (and command) does .  See man 
stat.

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

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



[issue15462] UTF8 BOM incorrectly prepended syslog messages when using rsysolog

2012-07-26 Thread R. David Murray

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

I believe this is a duplicate of issue 14452.

--
components:  -IO, Library (Lib)
nosy: +r.david.murray, vinay.sajip
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - SysLogHandler sends invalid messages when using unicode

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



[issue15463] test_faulthandler can fail if install path is too long

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

This might be obvious to some people, but for background purposes, this seems 
to be where the file name gets truncated (in the dump_frame() function):

write(fd, \, 1);
dump_ascii(fd, code-co_filename);
write(fd, \, 1);

http://hg.python.org/cpython/file/ddf15cd9be4a/Python/traceback.c#l564

Out of curiosity, I wonder if we have a test to check the formatting of 
tracebacks for long file names, which would be nice to have.  I didn't see one.

--
nosy: +cjerdonek

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



[issue15464] ssl: add set_msg_callback function

2012-07-26 Thread R. David Murray

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


--
nosy: +pitrou

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



[issue15463] test_faulthandler can fail if install path is too long

2012-07-26 Thread Ned Deily

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

Without investigating further, my instinct would be to prefer to truncate in 
the middle, if possible, otherwise truncate the head of the path, rather than 
truncate the tail.

--

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



[issue15464] ssl: add set_msg_callback function

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

In your test, is there a reason you don't need to verify that your callback is 
actually called?

+def cb(packet):
+  self.assertGreater(len(packet), 0)
+ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ctx.set_msg_callback(cb)

--
nosy: +cjerdonek

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



  1   2   >