[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2012-06-30 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Serhiy: I'm not sure what you're saying. At the point that str.format() is 
> producing its error message, it doesn't know as much as %-formatting does 
> about the original arguments, so it can't produce a similar message.

I'm surprised that the code of the classic and the modern formatting is
so different. Looking deeper, I saw that the issue will go away in 3.4.
I agree with you in msg151728.

--

___
Python tracker 

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



[issue15224] Range: Additional Methods (min/max/__and__)

2012-06-30 Thread Mark Dickinson

Mark Dickinson  added the comment:

> However, the concept of the intersection of ordered sets is commonplace
> and implemented in other libraries, for example:

None of those are specific to arithmetic progressions (i.e., range-like lists / 
sets), as far as I can tell.  I could see more use for general 
list-intersection functionality.

I'm still -1 on this; it seems too specialised a need to belong in the core 
language.

--

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2012-06-30 Thread Davide Rizzo

Davide Rizzo  added the comment:

Daniel, Nick, shouldn't the context manager yield f within a with block?

--
nosy: +davide.rizzo

___
Python tracker 

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



[issue15226] max( str ) should be fast with PEP 393

2012-06-30 Thread Martin v . Löwis

Changes by Martin v. Löwis :


--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 56c574a1819a by doko in branch 'default':
- Issue #3754, refactor sys.platform / get_platform bits, use a
http://hg.python.org/cpython/rev/56c574a1819a

--
nosy: +python-dev

___
Python tracker 

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



[issue15227] Fatal Python error: PyEval_RestoreThread: NULL tstate on example script..

2012-06-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +gpolo, loewis

___
Python tracker 

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



[issue15216] Support setting the encoding on a text stream after creation

2012-06-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> The proposal [1] is that TextIOWrapper support a set_encoding() method 
> that is only supported between creation of the stream and the first
> read or write operation.

That will be fragile. A bit of prematurate input or output (for whatever 
reason) and your program breaks.

--
nosy: +pitrou

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset af15910d2ffb by doko in branch 'default':
- Issue #3754: Use AC_PATH_TOOL and AC_CHECK_TOOLS instead of
http://hg.python.org/cpython/rev/af15910d2ffb

--

___
Python tracker 

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



[issue15216] Support setting the encoding on a text stream after creation

2012-06-30 Thread Nick Coghlan

Nick Coghlan  added the comment:

Indeed. However, the current alternatives (based on detach() and fileNo()) are 
also problematic - using detach() breaks the corresponding sys.__std*__ entry, 
while using fileNo() means you now have two independent IO stacks using the 
same underlying descriptor.

My own preference is to have a set_encoding() method that *can* be used even if 
IO has already occurred. Yes, there's the chance of mixing encodings if data is 
processed before the encoding is changed, but that's also true for both of the 
alternatives.

Pipeline applications written in Python should have an easy way to implement 
"--encoding" parameters for the standard IO streams, and a method to update the 
settings is the obvious choice.

--

___
Python tracker 

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



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

2012-06-30 Thread Matthias Klose

Matthias Klose  added the comment:

the updated patch addresses:

 - fix typo mentioned in msg156044

 - don't use the host python during build and installation

 - for include files and libraries, use the search directories
   provided by gcc, and only fall back to hard coded
   directories for native builds.

 - fix the dpkg-architecture call for cross builds

 - pass the --host and --build arguments to the libffi build

 - fix the pydebug check, taken from issue #3871.

The patch introduces two new variables, which are set in the environment for 
cross builds:

 - _PROJECT_BASE is used by Lib/sysconfig.py to point to the
   current source, while using the python3 interpreter of the
   build machine, so that the Makefile and the pyconfig.h are
   read from the current sources.

 - _HOST_PLATFORM is used to override the get_platform calls
   in Lib/sysconfig.py, Lib/distutils/utils.py and setup.py.
   Yes, distutils is frozen, however this change shouldn't
   break anything else. It only relies on one environment
   variable _HOST_PLATFORM, so if this is an issue, then the
   name can be obfuscated even more.

tested with a cross build for arm-linux-gnueabihf on x86_64-linux-gnu, and a 
native build.

--
title: do not use the host python for cross builds -> don't use host python, 
use host search paths for host compiler
Added file: http://bugs.python.org/file26217/no-host-python-and-host-gcc.diff

___
Python tracker 

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



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

2012-06-30 Thread Matthias Klose

Changes by Matthias Klose :


--
nosy: +tarek

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Matthias Klose

Matthias Klose  added the comment:

updated the patch in issue #14330.

--

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Matthias Klose

Matthias Klose  added the comment:

some chunks of the python-py3k-20120607-CROSS.patch patch are now checked in.

I didn't see any issues with the symlinks, and generating the posix vars, so 
maybe these bits should be dropped from the patch.

remaining issues are:

 - the readline/ncurses configury. maybe this should be done
   in the configure.ac using the host tools, and then provided
   to setup.py by a Makefile macro?

 - why are the Makefile changes for setup.info, pyconfig.h needed?

 - is the _testembed change still needed?

 - does Python/importlib.h really need a rebuild if it's there?
   I think this should just fail, not removed for the cross build.

 - why is the ac_cv_thread vs. ac_cv_pthread change needed?

--

___
Python tracker 

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



[issue14324] Do not rely on AC_RUN_IFELSE tests in the configury

2012-06-30 Thread Matthias Klose

Matthias Klose  added the comment:

use a linker test to check for profiling support (derived from the patch in 
issue #3754.

--
Added file: http://bugs.python.org/file26218/profiling.diff

___
Python tracker 

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



[issue14324] Do not rely on AC_RUN_IFELSE tests in the configury

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 575efae8ec57 by doko in branch 'default':
- Issue #14324: use a linker test to check for profiling support
http://hg.python.org/cpython/rev/575efae8ec57

--

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d158b0a78390 by doko in branch 'default':
- Issue #3754: Some unrelated configure.ac cleanups.
http://hg.python.org/cpython/rev/d158b0a78390

--

___
Python tracker 

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



[issue15225] Add negative tests for passing str to hmac.HMAC and hmac.new

2012-06-30 Thread Marc Abramowitz

Marc Abramowitz  added the comment:

Updating patch

--
Added file: http://bugs.python.org/file26219/hmac.py.patch

___
Python tracker 

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



[issue15225] Add negative tests for passing str to hmac.HMAC and hmac.new

2012-06-30 Thread Marc Abramowitz

Changes by Marc Abramowitz :


--
type:  -> enhancement
Added file: http://bugs.python.org/file26220/test_hmac.py.patch

___
Python tracker 

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



[issue15225] Add negative tests for passing str to hmac.HMAC and hmac.new

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset b0605b34b2de by Antoine Pitrou in branch 'default':
Issue #15225: improve error message when hmac is passed a wrong key type.
http://hg.python.org/cpython/rev/b0605b34b2de

--
nosy: +python-dev

___
Python tracker 

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



[issue1160] Medium size regexp crashes python

2012-06-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Then the issue may be closed?

Well, it's still present in 2.7 and 3.2 (assuming we consider it's important 
enough to fix).

--

___
Python tracker 

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



[issue9239] zipfile: truncating comment can corrupt the zipfile

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e13c9f99fbae by Antoine Pitrou in branch '3.2':
Issue #9239: add tests for modifying zipfile comments in append mode.
http://hg.python.org/cpython/rev/e13c9f99fbae

New changeset b299b4279e13 by Antoine Pitrou in branch 'default':
Issue #9239: add tests for modifying zipfile comments in append mode.
http://hg.python.org/cpython/rev/b299b4279e13

--
nosy: +python-dev

___
Python tracker 

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



[issue9239] zipfile: truncating comment can corrupt the zipfile

2012-06-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks, committed!

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

___
Python tracker 

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



[issue15225] Add negative tests for passing str to hmac.HMAC and hmac.new

2012-06-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thank you Marc, your patches are now committed!

--
components: +Library (Lib)
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type: enhancement -> behavior

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2012-06-30 Thread Richard Oudkerk

Richard Oudkerk  added the comment:

Rather than add a NamedTemporaryFile.delete_after() classmethod, would it not 
be simpler to just add a close_without_unlink() method to NamedTemporaryFile?

with NamedTemporaryFile() as f:

f.close_without_unlink()
with open(f.name, 'rb') as f:


--
nosy: +sbt

___
Python tracker 

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



[issue14591] Value returned by random.random() out of valid range on 64-bit

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 6df0b4ed8617 by Mark Dickinson in branch '2.7':
Closes #14591: Random.jumpahead could produce an invalid MT state on 64-bit 
machines.
http://hg.python.org/cpython/rev/6df0b4ed8617

--
nosy: +python-dev
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15216] Support setting the encoding on a text stream after creation

2012-06-30 Thread Matthew Barnett

Matthew Barnett  added the comment:

Would a "set_encoding" method be Pythonic? I would've preferred an "encoding" 
property which flushes the output when it's changed.

--
nosy: +mrabarnett

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Matthias Klose

Matthias Klose  added the comment:

for the readline ldd check, I'm checking in a patch to use readelf instead of 
ldd for the cross build.

--

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e6e99d449bdc by doko in branch 'default':
- Issue #3754: Use readelf instead of ldd for the cross build readline check
http://hg.python.org/cpython/rev/e6e99d449bdc

--

___
Python tracker 

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



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

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset b285ec79e5de by Matthias Klose in branch 'default':
previous patch needs patch from issue #14330
http://hg.python.org/cpython/rev/b285ec79e5de

--
nosy: +python-dev

___
Python tracker 

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



[issue15216] Support setting the encoding on a text stream after creation

2012-06-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Would a "set_encoding" method be Pythonic? I would've preferred an
> "encoding" property which flushes the output when it's changed.

I would prefer to have a method. The side-effect is too violent to be
hidden behind a property.
Besides, you want to set encoding and errors in a single operation.

--

___
Python tracker 

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



[issue3871] cross and native build of python for mingw32 with packaging

2012-06-30 Thread Éric Araujo

Éric Araujo  added the comment:

> I thought that the distutils-is-frozen rule was only for Python 2.x
> and that they would be allowed for 3.x? Is this not true?
It is not.  The normal rule is that stable versions (like 2.7) get only bug 
fixes while new features go only to the development version (like 3.3 before it 
went into beta last Tuesday).  For distutils there is a special rule that 
prevents new features for all versions.  The only exceptions are side effects 
of changes in other parts of Python (for example __pycache__ directories in 3.2 
or virtualenv in 3.3).

> Obviously making Python cross compile properly is a very desired feature (in 
> this day and age
> I'd say cross-compilation for any major software is expected to be honest 
> with you).
Well I for one am a unix user but not a C guy; I compile Python easily and 
don’t fully get the benefits of cross compilation.

distutils2 is the place to add such new features.  We wanted to release it in 
the standard library for 3.3 but it was not ready, so it should be in 3.4.

--
versions: +Python 3.4 -3rd party, Python 3.3

___
Python tracker 

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



[issue15171] Fix 64-bit building for buildbot scripts (3.2)

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 177f93f0f5b9 by Stefan Krah in branch '3.2':
Issue #15171: Quote the variable that expands to the current directory.
http://hg.python.org/cpython/rev/177f93f0f5b9

--

___
Python tracker 

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



[issue15170] Fix 64-bit building for buildbot scripts (2.7)

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 97445ca895d5 by Stefan Krah in branch '2.7':
Issue #15170: Quote the variable that expands to the current directory.
http://hg.python.org/cpython/rev/97445ca895d5

--

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Matthias Klose

Matthias Klose  added the comment:

the ncurses/_flags changes seem to be unrelated. please open a separate issue.

--

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 12a56a349af2 by doko in branch 'default':
- Issue #3754: Fix /dev/ptmx, /dev/ptc file checks for cross builds,
http://hg.python.org/cpython/rev/12a56a349af2

--

___
Python tracker 

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



[issue15224] Range: Additional Methods (min/max/__and__)

2012-06-30 Thread Yclept Nemo

Yclept Nemo  added the comment:

>> None of those are specific to arithmetic progressions (i.e., range-like 
>> lists / sets), as far as I can tell.

Does this (the data-type involved) really matter?

>> I could see more use for general list-intersection functionality.

The way to implement generic functionality is to define a protocol and override 
inherited behavior when necessary. Generic intersection (when semantics can be 
agreed upon) can computed using the iterator protocol, but __and__ of the range 
class should be overridden to provide O(1) behavior.

So, perhaps a proposal for implementing __and__ for lists as well ?

>> I'm still -1 on this; it seems too specialised a need to belong in the core 
>> language.

While I do see several arguments against the inclusion of __and__:
. it would require the inclusion of union and difference operations
. vague definition of intersection with regard to ranges. Do you treat range 
like a linear equation, so only consider intersections at the same index. Also 
the issue regarding ordering.
. re issue1766304, it may be pointless providing an O(1) __and__ for range if 
it can only work for ints(??)

I don't think that complexity or specialisation should matter. A range is 
already a specialised data type (do any other languages have a range class - 
separate from slices?) Python's data model provides __and__. Conceptually, why 
not bring range to its full potential using facilities that python already 
provides.

By the way, I don't have anything at stake in this - just arguing for 
argument's sake - so you can close this if you feel strongly enough about not 
implementing it.

--

___
Python tracker 

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



[issue15222] mailbox.mbox writes without empty line after each message

2012-06-30 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

I'm afraid that's not enough details to do any fixing. I would need a concrete 
way to reproduce the issue.

--
status: open -> pending

___
Python tracker 

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



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

2012-06-30 Thread Éric Araujo

Éric Araujo  added the comment:

Patch looks okay as it contains no important changes to distutils, the 
compilers or any big part; it’s the sort of changes that have been accepted to 
fix Mac issue or support multiarch on Debian.  I would prefer safer names for 
environment variables though, for example PYTHON_BUILD_HOST_PLATFORM instead of 
just _HOST_PLATFORM (unless this is not specific to the Python build process 
but used by all cross-compiling builds).

--

___
Python tracker 

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



[issue15224] Range: Additional Methods (min/max/__and__)

2012-06-30 Thread Mark Dickinson

Mark Dickinson  added the comment:

Okay, I'm closing this as rejected.  Some responses:

> I don't think that complexity or specialisation should matter.

Well, Python's supposed to be a general-purpose language;  range objects *are* 
generally useful for all sorts of tasks, but it's far from clear that being 
able to intersect them would be valuable to a wide range of people.

> Conceptually, why not bring range to its full potential using facilities that 
> python already provides.

Because additions to the language (especially the core language, as opposed to 
the standard library) are far from free.  First the feature needs to be 
implemented, reviewed, fully tested and documented.  Then it needs to be 
maintained.  Other Python implementations (PyPy, IronPython, Jython, etc.) need 
to create their own implementations.  Text book writers need to keep up with 
the changes.  The addition makes the language larger,  making more to learn for 
students of the language and more to teach for teachers.  In this particular 
case, I'm worried that there's a real risk of making a poor API choice that 
will inhibit later language expansion---you can't just add a method to a 
builtin type without considering the impact on the language as a whole, both 
now and in the future.

So there's a significant cost in each core language addition, even for 
something as simple-looking as this.  And the benefits of the addition have to 
be weighed against that cost.  In this case, I see very little benefit---I 
doubt that there's a real and common need for range intersections.

And all of the above is before discussing the implementation difficulties 
associated with this particular feature:  it would likely require a C 
implementation of the gcd function, which is *not* a trivial thing to do 
efficiently, so we're looking at much more than just a few lines of code, with 
all the attendant risks of introducing new bugs.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



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

2012-06-30 Thread Matthias Klose

Matthias Klose  added the comment:

PYTHON_BUILD_HOST_PLATFORM is confusing/misleading. I'll use 
_PYTHON_HOST_PLATFORM (with the leading underscore to mark it somehow internal).

--

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Ray Donnelly

Ray Donnelly  added the comment:

NCURSES_INTERNALS stuff appears to be redundant:

Mac OS X curses.h, Linux curses.h and Windows PDCurses.h don't reference it, 
nor does the Python 3.3.0b1 source code. Of course, I haven't checked any other 
systems.

However: see http://bugs.python.org/issue14598, so maybe for older Linux 
ncurses and Cygwin it is still needed.

NCURSES_OPAQUE investigation:

Linux ncurses.h:
#ifndef NCURSES_OPAQUE
#define NCURSES_OPAQUE 0
#endif

Mac OS X ncurses.h:
#ifndef NCURSES_OPAQUE
#define NCURSES_OPAQUE 1
#endif

So for OSX we need to be defining it to 0...

but IMHO, these parts are not directly related to cross compilation support so 
shouldn't be part of this patch.

--

___
Python tracker 

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



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

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset cfbe51e66749 by doko in branch 'default':
- Issue #14330: For cross builds, don't use host python, use host search paths
http://hg.python.org/cpython/rev/cfbe51e66749

--

___
Python tracker 

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



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

2012-06-30 Thread Matthias Klose

Matthias Klose  added the comment:

applied

--
status: open -> closed

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Matthias Klose

Matthias Klose  added the comment:

Roumen, I would like to close this issue. Please could you file separate issues 
for the remaining bits?

 - the thread/pthread configure issue

 - the generation of the Setup / pyconfig.h files?

--

___
Python tracker 

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



[issue3871] cross and native build of python for mingw32 with packaging

2012-06-30 Thread Matthias Klose

Matthias Klose  added the comment:

the cross build support is now updated for 3.3. so the mingw32 patches need an 
update. Not sure if they will go into 3.3, because there seem to be non-trivial 
changes for in Lib/distutils. Other self-contained changes probably should 
still go into 3.3.

--
nosy: +doko

___
Python tracker 

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



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

2012-06-30 Thread Éric Araujo

Éric Araujo  added the comment:

+if "_PROJECT_BASE" in os.environ:

Can you use _PYTHON_PROJECT_BASE here?  Thanks.

(BTW it would be nice if you could mark the bugs for which you did commits as 
closed+fixed+committed.)

--

___
Python tracker 

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



[issue3871] cross and native build of python for mingw32 with packaging

2012-06-30 Thread Éric Araujo

Éric Araujo  added the comment:

> Not sure if they will go into 3.3, because there seem to be non-trivial 
> changes for in Lib/distutils.
The feature freeze applies to all branches.  Even when 3.4 starts, the same 
rule that has been repeatedly explained for two years will apply: no new 
features in distutils.  Again, neither Tarek nor I are happy about that, but it 
was the decision taken by python-dev due to the big number of setup.py scripts 
depending on undocumented behavior, bugs and quirks.

> Other self-contained changes probably should still go into 3.3.
Not sure; we are in beta now, and cross-compilation does not look like an 
existing feature that is being fixed, but a new feature being added despite the 
beta status.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue3754] cross-compilation support for python build

2012-06-30 Thread Roumen Petrov

Roumen Petrov  added the comment:

Matthias  I cannot follow all you questions as I'm on vacation so briefly:
a) ac_cv_thread is type correct one is with'p'
b) ncurses 
NCURSES_INTERNALS reported again in issue 14598
NCURSES_OPAQUE - i don't have time to explain all details but it could be 
reproduces on linux with version 2.7 
Even on linux to linux build it is required as it could depend from ncurses 
library version.

c) setup_info is my proposition to pass detection of readline libs from 
configure to setup.py . Use of readelf is not portable. Why to test again ? If 
on host platforms shared library is not in elf format  which tool to use ?

d) importlib.h is build now from executable. Probably we could introduce 
BUILD_CC . Out of scope for now

e) executable that load packages has to be located in builddir to allow "is 
python build" to be activated and packages from cross-build environment to be 
loaded.

After 3 weeks I could answer more.

--

___
Python tracker 

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



[issue15198] multiprocessing Pipe send of non-picklable objects doesn't raise error

2012-06-30 Thread Richard Oudkerk

Richard Oudkerk  added the comment:

What type of object did you try to send, and how can the problem be reproduced?

There are plenty of types which don't support pickling, and where pickling only 
succeeds in producing invalid data which cannot be successfully unpickled.  The 
exception raised when unpickling will depend on the type of the object.

--
type: crash -> behavior

___
Python tracker 

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



[issue15171] Fix 64-bit building for buildbot scripts (3.2)

2012-06-30 Thread Stefan Krah

Stefan Krah  added the comment:

Did the Windows XP-4 bot start failing after 334ff92a8483 ?

The logs don't go back very far:

http://buildbot.python.org/all/builders/x86%20XP-4%203.2

--

___
Python tracker 

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



[issue3871] cross and native build of python for mingw32 with packaging

2012-06-30 Thread Roumen Petrov

Roumen Petrov  added the comment:

Eric.
please could could you revert PEP 405 as distutils is frozen or step down as It 
seems to me you don't flow distutils evolution.

--

___
Python tracker 

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



[issue15198] multiprocessing Pipe send of non-picklable objects doesn't raise error

2012-06-30 Thread Ian Bell

Ian Bell  added the comment:

I had issues with a class that I wrote myself.  It is a rather involved data 
structure with all kinds of interesting things going on.  Unfortunately I 
cannot put together a minimal working example that will cause a Python hang.

--

___
Python tracker 

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



[issue3871] cross and native build of python for mingw32 with packaging

2012-06-30 Thread Roumen Petrov

Roumen Petrov  added the comment:

Hi Mattias ,
I have ready to upload patches for 3.3.30b1 but after recent changes I will 
postpone upload . 
Part of already uploaded patch cover cygwin native build .
For instance
a)  --enable-new-dtags is only for elf binaries.
b) use of libpython$(LDVERSION), i.e. LD...) has to be reported again in 
another cygwin related issue 
c)  etc?(?) ...

10x for you efforts to review, analyze, commit patches related to cross-build.

Eric
packaging seem to me a good  tool to replace distutils remaining compatible but 
unfortunately is removed from 3.3 :(

--

___
Python tracker 

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



[issue15228] os.utime() docs not clear on behavior on nonexistant files

2012-06-30 Thread Daniel Grace

New submission from Daniel Grace :

The documentation for os.utime() at 
http://docs.python.org/py3k/library/os.html#os.utime states:

"Set the access and modified times of the file specified by path. [...] The 
effect is similar to running the Unix program touch on the path.)"

Unlike 'touch', os.utime() will not create an empty file if called on a file 
that does not exist.  IMO the current behavior is correct, but the comparison 
of os.utime() to touch implies that it would create empty files.

I suggest clarifying the documentation to emphasize that os.utime() will not 
create new files and raises OSError in the event that the file does not exist.

--
assignee: docs@python
components: Documentation
messages: 164422
nosy: dewin, docs@python
priority: normal
severity: normal
status: open
title: os.utime() docs not clear on behavior on nonexistant files
type: enhancement

___
Python tracker 

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



[issue15229] stringification of subclasses of OSError can cause crash

2012-06-30 Thread Richard Oudkerk

New submission from Richard Oudkerk :

If you subclass OSError without calling OSError.__init__() then you can get a 
crash.  For example

  Python 3.3.0b1 (default:cfbe51e66749, Jun 30 2012, 20:50:54) [MSC v.1600 32 
bit
  (Intel)] on win32
  Type "help", "copyright", "credits" or "license" for more information.
  >>> class MyError(OSError):
  ...   def __init__(self):
  ... pass
  ...
  [61116 refs]
  >>> repr(MyError())
  Assertion failed: obj, file ..\Objects\unicodeobject.c, line 2646

Note that str(MyError()) results in a crash without hitting a failed assertion.

The problem does not occur in Python 3.2, and it does not affect subclasses of 
Exception.

--
components: Interpreter Core
messages: 164423
nosy: sbt
priority: normal
severity: normal
stage: needs patch
status: open
title: stringification of subclasses of OSError can cause crash
type: crash
versions: Python 3.3

___
Python tracker 

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



[issue15229] stringification of subclasses of OSError can cause crash

2012-06-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +pitrou
priority: normal -> high

___
Python tracker 

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



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

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 86ac09f118be by doko in branch 'default':
- Issue #14330: For cross builds, don't use host python, use host search paths
http://hg.python.org/cpython/rev/86ac09f118be

--

___
Python tracker 

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



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

2012-06-30 Thread Matthias Klose

Matthias Klose  added the comment:

now renamed, add added the news entry

--

___
Python tracker 

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



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

2012-06-30 Thread Matthias Klose

Changes by Matthias Klose :


--
resolution:  -> fixed

___
Python tracker 

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



[issue15229] stringification of subclasses of OSError can cause crash

2012-06-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a quick patch (needs a test):

diff --git a/Objects/exceptions.c b/Objects/exceptions.c
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -834,6 +834,7 @@ oserror_init(PyOSErrorObject *self, PyOb
 #endif
 
 /* Steals the reference to args */
+Py_CLEAR(self->args);
 self->args = args;
 args = NULL;
 
@@ -916,6 +917,11 @@ OSError_new(PyTypeObject *type, PyObject
 ))
 goto error;
 }
+else {
+self->args = PyTuple_New(0);
+if (self->args == NULL)
+goto error;
+}
 
 return (PyObject *) self;

--

___
Python tracker 

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



[issue15229] stringification of subclasses of OSError can cause crash

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1cbab581bf1e by Antoine Pitrou in branch 'default':
Issue #15229: An OSError subclass whose __init__ doesn't call back
http://hg.python.org/cpython/rev/1cbab581bf1e

--
nosy: +python-dev

___
Python tracker 

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



[issue15229] stringification of subclasses of OSError can cause crash

2012-06-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

It should be fixed now.

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

___
Python tracker 

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



[issue10650] decimal.py: quantize(): excess digits with watchexp=0

2012-06-30 Thread Stefan Krah

Stefan Krah  added the comment:

Ping. We have to decide if we need watchexp in _decimal. I've left it
out so far since all I can gather from the docs is that it somehow
behaves like _rescale.

Can we deprecate it and replace it by a proper rescale?

--
nosy: +georg.brandl

___
Python tracker 

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



[issue10650] decimal.py: quantize(): excess digits with watchexp=0

2012-06-30 Thread Mark Dickinson

Mark Dickinson  added the comment:

I'd be happy to see watchexp deprecated.  It feels like a leftover 
implementation artefact;  its behaviour isn't properly defined anywhere, and as 
far as I can tell it has only a single testcase.

--

___
Python tracker 

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



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

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 7955d769fdf5 by doko in branch 'default':
- Issue #14330: Don't derive the include and library search dirs
http://hg.python.org/cpython/rev/7955d769fdf5

--

___
Python tracker 

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



[issue15194] libffi-3.0.11 update

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 989efaab9525 by doko in branch 'default':
- Issue #15194: check in the missing m4/ax_check_compile_flag.m4 file.
http://hg.python.org/cpython/rev/989efaab9525

--

___
Python tracker 

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2012-06-30 Thread Daniel Lenski

Daniel Lenski  added the comment:

Davide, the @contextlib.contextmanager decorator effectively wraps the
yield statement in the necessary glue so that everything prior to the yield
statement occurs in the __enter__() method of the contextmanager, while
everything subsequent occurs in the __exit__() method.

On Sat, Jun 30, 2012 at 1:46 AM, Davide Rizzo wrote:

>
> Davide Rizzo  added the comment:
>
> Daniel, Nick, shouldn't the context manager yield f within a with block?
>
> --
> nosy: +davide.rizzo
>
> ___
> Python tracker 
> 
> ___
>

--
title: tempfile.NamedTemporaryFile not particularly useful on   Windows -> 
tempfile.NamedTemporaryFile not particularly useful on Windows

___
Python tracker 

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



[issue15034] Devguide should document best practices for stdlib exceptions

2012-06-30 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I agree with Raymond that this, especially super() is not tutorial material. I 
agree with David that we need something somewhere else. Just today a commit was 
pushed about IOException subclasses causing problems because they have an 
__init__ but don't call super(). (Something like that.) I had no idea about 
this issue.

The stdlib has things like "class ModException(Exception): pass". Is that okay 
because it does *not* have __init__ override?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue15194] libffi-3.0.11 update

2012-06-30 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 6fe974b8056c by doko in branch 'default':
- Issue #15194: check in the missing m4/ax_append_flag.m4 file.
http://hg.python.org/cpython/rev/6fe974b8056c

--

___
Python tracker 

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



[issue1207613] Bottom Scroll Bar

2012-06-30 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

#15141, which I will close as a duplicate, makes the same request (for the edit 
window). Roger Serwy notes that his extension package
http://idlex.sourceforge.net/extensions.html
has horizontal.py, which does what is requested. He is willing for that (or 
other) extension(s) to be bundled with idle for default or optional activation. 
I presume that is done in some .cfg file. I re-opened for that purpose.

(Note: it would seem nice to be able to get a list of extensions available and 
those enabled from the menu. Or is there a reason not too?)

Some arguments for h. scroll:
1. The shell window is a print output as well as code input window. Output 
should not necessarily be limited to 80 chars. With variable pitch font, that 
does not even make much sense.
2. Edit windows are not limited to python code. Else they would *always* syntax 
hilight. Or Pycode might be embedded in other formats. If #6858 were 
implemented, h scroll would be more useful.
3. Not everyone agrees with the 80 char limits.
4. People sometimes edit a file written by someone else.

Counter-arguments:
1. A full screen window allows about 200 chars or more, which is enough for any 
code entry and most print output and most 'files written by someone else'.
2. For exceptions, put cursor on long line and use => arrow key.

--
nosy: +serwy, terry.reedy
resolution: rejected -> 
status: closed -> open
versions: +Python 3.4

___
Python tracker 

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



[issue15141] IDLE horizontal scroll bar missing (Win-XPsp3)

2012-06-30 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Bottom Scroll Bar

___
Python tracker 

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



[issue15230] runpy.run_path broken: Breaks scoping; pollutes sys.modules; doesn't set __package__

2012-06-30 Thread Benjamin S Wolf

New submission from Benjamin S Wolf :

(Python 3.2.3)

1. After discarding the module run_path used to run the code in, all references 
to variables from local scopes (even if they are references to global 
variables) are bound to None, preventing any code in functions from running 
properly.

/tmp/a.py --
FOO = 'bar'

def f():
print(FOO)

f()

/tmp/b.py --
# Hack needed for:
#  python3 /tmp/b.py,
#  python3 -m /tmp/b
#  runpy.run_path('/tmp/b.py')
from os.path import dirname
__path__ = [dirname(__file__)]
del dirname

# Hack needed for:
#  python3 -m /tmp/b
if __name__ == '__main__' and not __package__:
__package__ = '__main__'

from . import a

def g():
print(a.FOO)

g()


~$ python3
>>> import runpy
>>> d = runpy.run_module('/tmp/a')
bar
>>> d2 = runpy.run_path('/tmp/a.py')
bar
>>> d['f']

>>> d['FOO']
'bar'
>>> d['f']()
bar
>>> d2['f']

>>> d2['FOO']
'bar'
>>> d2['f']()
None
>>> d3 = runpy.run_path('/tmp/b.py')
bar
bar
>>> d3['g']

>>> d3['a']
.a' from '/tmp/a.py'>
>>> d3['g']()
Traceback (most recent call last):
  File "", line 1, in 
  File "/tmp/b.py", line 15, in g
print(a.FOO)
AttributeError: 'NoneType' object has no attribute 'FOO'

Notice that run_module gets this right, as d['f']() prints 'bar' but d2['f']() 
and d3['g']() do not.


2. run_path pollutes the module namespace when running a module that uses 
relative imports. This prevents any code that imports the same module in the 
same manner from running.

Continuing from #1 without having closed the interpreter:
>>> d4 = runpy.run_path('/tmp/b.py')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.2/runpy.py", line 250, in run_path
return _run_module_code(code, init_globals, run_name, path_name)
  File "/usr/lib/python3.2/runpy.py", line 83, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib/python3.2/runpy.py", line 73, in _run_code
exec(code, run_globals)
  File "/tmp/b.py", line 12, in 
from . import a
ImportError: cannot import name a
>>> '' in sys.modules
False
>>> '.a' in sys.modules
True
>>> d3['a'].f()
bar
>>> del sys.modules['.a']
>>> d4 = runpy.run_path('/tmp/b.py')
bar
bar
>>>

run_module, on the other hand, also alters sys.modules, but this does not 
prevent the module from being run, only from the secondary module from being 
re-imported:
[Create an empty file /tmp/__init__.py]
>>> sys.path = ['/'] + sys.path
>>> d5 = runpy.run_module('tmp.b')
bar
bar
>>> d6 = runpy.run_module('tmp.b')
bar
>>> d7 = runpy.run_module('tmp.b')
bar
>>> 'tmp' in sys.modules
True
>>> 'tmp.b' in sys.modules
False
>>> 'tmp.a' in sys.modules
True

[This was the only way I could get run_module to run /tmp/b.py, regardless of 
the presence or lack of the path and __package__ hacks at the top of the file, 
or any other changes I've experimented with. runpy.run_module('/tmp/b'), 
runpy.run_module('b') [with '/tmp' in sys.path] would generally result in:
  ValueError: Attempted relative import in non-package
and setting run_name='__main__' alongside any of the other changes would result 
in:
  ImportError: cannot import name a

python3 /tmp/b.py and python3 -m /tmp/b run fine.]


3. And finally, an examination of the run_path code shows that it doesn't, as 
the docs indicate, set __package__ to be run_name.rpartition('.')[0], but 
either the empty string or None: 
http://hg.python.org/cpython/file/3.2/Lib/runpy.py#l269

--
components: Library (Lib)
messages: 164437
nosy: Benjamin.S.Wolf
priority: normal
severity: normal
status: open
title: runpy.run_path broken: Breaks scoping; pollutes sys.modules; doesn't set 
__package__
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue15224] Range: Additional Methods (min/max/__and__)

2012-06-30 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

FWIW, I concur with rejecting this for the reasons that Mark mentioned.

--
nosy: +rhettinger

___
Python tracker 

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



[issue10650] decimal.py: quantize(): excess digits with watchexp=0

2012-06-30 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Does anyone know why watchexp was put there in the first place?

http://speleotrove.com/decimal/daops.html#refquant

If no motivation for this can be found, I agree with Mark that it should be 
deprecated and removed.

--

___
Python tracker 

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



[issue15158] Add support for multi-character delimiters in csv

2012-06-30 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Did you read "Unfortunately, delimiter is represented by a character in C." in 
one of the answers? If so, this should be rejected. For the posted problem, I 
added the following.

>>> list(s[1:-1] for s in '"1234"||"abcd"||"a1s1"'.split('||'))
['1234', 'abcd', 'a1s1']

re.split is intended for general splitting tasks. The SO had other posted 
solutions that also do the job. So I do not see the need.

Using commas both within quoted fields and between fields is semi-sensible, or 
at least widely done. Anyway, csv was designed for that and then generalized. I 
do not see the need to cater to something as foolish and rare as using a 
multichar delimiter that is also within fields.

I suggest you post enhancement ideas on python-ideas first, as it is a better 
place for discussion and reaches more people.

--
nosy: +terry.reedy
stage:  -> test needed
versions:  -Python 3.3

___
Python tracker 

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



[issue15178] Doctest should handle situations when test files are not readable

2012-06-30 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Failure modes tend to get less attention that successful behavior. If I wrote a 
program that used doctest/unittest to test multiple files, I should like it to 
run an many as possible. If a filename is bad, print name as usual, say 
'aborted', and '0/0 tests' run. Then at the end tell me via return value or 
exception about problems. In any case, having error behavior documented and 
consistent between modules would be good.  I am not sure how much of this would 
be a bugfix versus enhancement.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue15180] Cryptic traceback from os.path.join when mixing str & bytes

2012-06-30 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This strikes me as a bugfix that does not get backported because code might 
depend on the bug. If the policy for exception messages, such as it is, 
documented somewhere?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue15189] tkinter.messagebox does not use the application's icon

2012-06-30 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

It is not clear to me what change your are proposing.

--
nosy: +gpolo, terry.reedy
type:  -> enhancement
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue15191] tkinter convenience dialogs don't use themed widgets

2012-06-30 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

It has been agreed that IDLE could assume tk8.5 (or possibly 8.4 + tile 
extension) and use themed widgets (though it is not yet) and not run otherwise. 
Further discussion would be needed to do the same for tkinter, but maybe by 3.4 
that might be reasonable.

--
nosy: +terry.reedy
type:  -> enhancement
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue15231] update PyPI upload doc to say --no-raw passed to rst2html.py

2012-06-30 Thread Chris Jerdonek

New submission from Chris Jerdonek :

I had an issue whereby my reST long_description wasn't getting rendered as HTML 
when uploaded to PyPI.  Following the instructions here did not work as-is:

http://docs.python.org/dev/distutils/uploading.html#pypi-package-display

It seems that PyPI passes --no-raw (no HTML allowed) to rst2html.py, in which 
case the guidance would be better updated to read--

$ python setup.py --long-description | rst2html.py --no-raw > output.html

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 164445
nosy: cjerdonek, docs@python
priority: normal
severity: normal
status: open
title: update PyPI upload doc to say --no-raw passed to rst2html.py
versions: Python 3.3

___
Python tracker 

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



[issue1207613] Bottom Scroll Bar

2012-06-30 Thread Roger Serwy

Roger Serwy  added the comment:

I wrote Horizontal.py as an extension in order to avoid forking IDLE. It 
should be simple to incorporate a toggling horizontal scroll bar within 
the EditorWindow class itself.
> (Note: it would seem nice to be able to get a list of extensions available 
> and those enabled from the menu. Or is there a reason not too?)

IdleX provides a dialog for enabling and disabling extensions.

The shell window has wrapping enabled on its text widget. A horizontal 
bar is not needed there.
> 2. Edit windows are not limited to python code. Else they would *always* 
> syntax hilight. Or Pycode might be embedded in other formats. If #6858 were 
> implemented, h scroll would be more useful.
True. The Editor window does not wrap, which is why the horizontal bar 
is needed there.
> 3. Not everyone agrees with the 80 char limits.
The limit does make printing code simpler, however.  But that's a 
separate discussion.
> 4. People sometimes edit a file written by someone else.
Yes, and often times it is one or two lines in the file that extend 
beyond the right border of the editor.
> Counter-arguments:
> 1. A full screen window allows about 200 chars or more, which is enough for 
> any code entry and most print output and most 'files written by someone else'.
I shouldn't have to resize the editor to see its contents.
> 2. For exceptions, put cursor on long line and use =>  arrow key.
>
> --
> nosy: +serwy, terry.reedy
> resolution: rejected ->
> status: closed ->  open
> versions: +Python 3.4
>
> ___
> Python tracker
> 
> ___
>

--

___
Python tracker 

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



[issue15178] Doctest should handle situations when test files are not readable

2012-06-30 Thread R. David Murray

R. David Murray  added the comment:

The  problem with running all the files as things stand is that the errors get 
lost in the other output.  Changing that would definitely be an enhancement.

--

___
Python tracker 

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



[issue3871] cross and native build of python for mingw32 with packaging

2012-06-30 Thread Luke Kenneth Casson Leighton

Luke Kenneth Casson Leighton  added the comment:

> distutils2 is the place to add such new features. 

you're not getting it.  you've just told both this
mingw32 project and also the new effort by ray that
they can go fuck themselves, because their efforts
are a total waste of time (as far as python 2 is
concerned).

why? because without patches to python 2 distutils, you're condemning
their work to total irrelevance.  why? because nobody in their
right mind is going to do what you suggest - "go educate people"
about using distutils2.  that's tens of thousands of package
maintainers, and you're expecting *two* people to do that job - 
you must be off your head if you think that's even remotely
realistic!  i can't quite understand why you would even make such
a recommendation, because it's so clearly unworkable and unrealistic.

now, if python2 was in any way going to die, be totally
irrelevant or otherwise be superceded at any time in
the next ten years i would in no way be so pissed at this
freeze, and would in no way bother to comment on this.
i don't like doing this sort of thing: it makes me look
like i'm some sort of fucking idiot - but that's tough luck
on me.  someone has to tell it straight, and truthfully say
the things that everyone else doesn't have the balls to say.

what has me particularly pissed off is that the freeze happened
years *AFTER* roumen created this initial patch.

also what has me particularly pissed off is that the freeze
happened because *other people* - not roumen, and not ray -
didn't do their job, either in checking that their modifications
to distutils would have an impact on any other ports, but more
than that, neither did anyone else in the python team.

why should ray and roumen's work be made insultingly irrelevant,
just because of mistakes made by *other people*?


by complete contrast, i absolutely agree with you 100% that in
NO WAY should any modifications to distutils in python3 sources
be EVER permitted.  forcing people to use distutils2
for *new* packages, as well as packages being transitioned to python3,
and documenting that fact (and the required procedure to be followed)
prominently on the python web site, is perfectly reasonable.

the reason why it is perfectly reasonable is because the developer
who is writing the new package (or transitioning the old one) is
*actively* taking the steps - THEY are taking steps - THEY are the
ones ACTIVELY doing the work.  intiated BY THEM.  people PLURAL.
tens of THOUSANDS of people.  and those people will read documentation,
and will ask questions on the mailing list, and will generally follow
the advice and guidance of the community.

contrast this with a completely unrealistic expectation that TWO
people must DEMAND of those exact same tens of thousands of python2
developers that "ohhh, you muuust use distutils2" and you can perhaps
appreciate why i am not exactly impressed.

of course, if the Python Software Foundation is offering to fund
these two developers with a campaign to educate the entire world of
python2 package maintainers with the demand that they all convert to
distutils2, and is willing to support them by creating a write-up
and a series of articles and other supporting documentation on the
python.org web site, then that is an entirely different matter.

--

___
Python tracker 

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



[issue3871] cross and native build of python for mingw32 with packaging

2012-06-30 Thread Luke Kenneth Casson Leighton

Luke Kenneth Casson Leighton  added the comment:

> The feature freeze applies to all branches.  Even when 3.4 starts, the 
> same rule that has been repeatedly explained for two years will apply: 
> no new features in distutils.  Again, neither Tarek nor I are happy
> about that, but it was the decision taken by python-dev due to the big 
> number of setup.py scripts depending on undocumented behavior, bugs and 
> quirks.

then you use monkeypatching.  split the new functionality into
a separate module - /distutils/mingw.py - that is called by
a clear ONE LINE modification in distutils.py that CLEARLY cannot
have IN ANY WAY not one SINGLE effect on ANY OTHER python port.

that line would be something like:

if sys.compiler == 'mingw32': import distutils.mingw

within that distutils.mingw it would monkey-patch distutils to
add itself into the distutils code.

the same technique could be used by ray to monkey-patch the
cygwin compiler by doing this:

distutils/specialportmaintainedbyray.py:

distutils.cygwincompiler.RE_VERSION = 
re.compile(b'[\D\s]*(\d+\.\d+(\.\d+)*)[\D\s]*$')

of course, for this to work, support for the ports are required
(identification of the ports) down at the sys.py and os.py level.
unless you expect these port maintainers to put in special 
monkeypatching into the c-code itself (which would of course be 
conditionally compiled and would in no way affect ANY other port of
python).

this would be perfectly reasonable.  the impact on other ports would
be zero.  consideration of the one line patch would take a few
minutes.

... and for those packages that depend on undocumented behaviour?
in the unlikely event that they ever get compiled for mingw32 or
ray's port, well, the person who compiled such a package would 
encounter an error, and would wonder why it was broken, and then
would get onto a mailing list and go "i have a problem, can anyone
help me".

chances are that the majority of packages would however compile
cleanly.

there's always a way.

--

___
Python tracker 

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



[issue15232] maildir parsing can split up messages with 'From ' at the start of a line

2012-06-30 Thread Chris Pickett

New submission from Chris Pickett :

tar xvfz maildir_bug.tar.gz
cd maildir_bug
./bug.sh

The attachment contains a maildir with a single message.  This message has two 
body lines beginning with 'From '.  When converted to mbox using the 
maildir2mbox.py, only the second line gets a '>' at the beginning.  Thunderbird 
subsequently splits the message in two.  I think the fix is to put a '>' in 
front of each 'From ' line and not just the second one.  However, when I did 
that, Thunderbird displayed the '>', so either it is not the right fix, or 
Thunderbird has a bug.

I am using Python 2.7.1.  I searched the bug tracker and didn't see this issue, 
so decided to file even though I don't have the latest version.

Chris

--
files: maildir_bug.tar.gz
messages: 164450
nosy: Chris.Pickett
priority: normal
severity: normal
status: open
title: maildir parsing can split up messages with 'From ' at the start of a line
Added file: http://bugs.python.org/file26221/maildir_bug.tar.gz

___
Python tracker 

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



[issue15232] maildir parsing can split up messages with 'From ' at the start of a line

2012-06-30 Thread R. David Murray

Changes by R. David Murray :


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

___
Python tracker 

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