[issue12800] 'tarfile.StreamError: seeking backwards is not allowed' when extract symlink

2011-09-12 Thread Lars Gustäbel

Changes by Lars Gustäbel :


--
assignee:  -> lars.gustaebel

___
Python tracker 

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



[issue12936] armv5tejl: random segfaults in getaddrinfo()

2011-09-12 Thread Charles-François Natali

Charles-François Natali  added the comment:

Oh, and BTW, for the "Backtrace stopped: frame did not save the PC", you might 
want to install the libc-dbg package. This might help in finding precisely 
where it's crashing.

--

___
Python tracker 

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



[issue12962] TitledHelpFormatter and IndentedHelpFormatter are not documented

2011-09-12 Thread anatoly techtonik

New submission from anatoly techtonik :

In optparse module doc this two classes are referenced, but not documented:

http://docs.python.org/library/optparse.html

--
components: Library (Lib)
messages: 143888
nosy: techtonik
priority: normal
severity: normal
status: open
title: TitledHelpFormatter and IndentedHelpFormatter are not documented
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue12881] ctypes: segfault with large structure field names

2011-09-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Note that there is at least one other place where alloca() is used with 
potentially large values: the POINTER() function in callproc.c.
Also, PyUnicode_FromFormat could be used instead of sprintf.

--

___
Python tracker 

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



[issue10898] posixmodule.c redefines FSTAT

2011-09-12 Thread Alan Hourihane

Changes by Alan Hourihane :


--
resolution: accepted -> remind

___
Python tracker 

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



[issue12936] armv5tejl: random segfaults in getaddrinfo()

2011-09-12 Thread Stefan Krah

Stefan Krah  added the comment:

STINNER Victor  wrote:
> > Traceback with faulthandler disabled: ...
> 
> How did you disabled faulthandler?

That was a run with all faulthandler references removed from regrtest.py.

But as I said in my previous mail, I also did a run using e91ad9669c08
but without compiling and linking faulthandler, so that _PyFaulthandler_Init()
wouldn't be called. This had the same result, so faulthandler is _not_ the cause
of this bug.

> > Version 9d658f000419, which is pre-faulthandler, runs without segfaults.
> 
> If it's a regression, you must try hg bisect! It is slow but it is fully 
> automated! Try something like:
> 
> hg bisect -r
> hg bisect -b 9d658f000419
> hg bisect -c 'make && ./python -m test test_urllib2_localnet test_robotparser 
> test_nntplib'

If it were that easy! I can't isolate the bug. The only way I can reproduce it
is by running the whole test suite with various random seeds. Then it takes
about 6 hours until the crash occurs in one of those tests.

The whole test suite takes about 24 hours.

I could try to install libc-dbg though.

--

___
Python tracker 

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



[issue12945] ctypes works incorrectly with _swappedbytes_ = 1

2011-09-12 Thread Pavel Boldin

Pavel Boldin  added the comment:

We have raw data packages from some tools. These packages contains bitfields, 
arrays, simple data and so on.

We want to parse them into Python objects (structures) for analysis and 
storage. I tried to use ctypes, but now I wrote myself implementation of raw 
parser based on bitarray and struct.

I wonder if ctypes can do this.

--

___
Python tracker 

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



[issue11715] Building Python on multiarch Debian and Ubuntu

2011-09-12 Thread Christian Heimes

Christian Heimes  added the comment:

Hey Nick and Barry,

the fix in http://hg.python.org/cpython/rev/bd0f73a9538e isn't sufficient. You 
have added /usr/lib/MULTIARCH and /usr/include/MULTIARCH but you forgot to add 
/lib/MULTIARCH. On my system zlib is installed at /lib/x86_64-linux-gnu/libz.so.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue11715] Building Python on multiarch Debian and Ubuntu

2011-09-12 Thread Christian Heimes

Christian Heimes  added the comment:

Update:

It turns out that zlib1g-dev adds a symlink from 
/usr/lib/x86_64-linux-gnu/libz.so to /lib/x86_64-linux-gnu/libz.so.1 .

$ locate libz.
/lib/x86_64-linux-gnu/libz.so.1
/lib/x86_64-linux-gnu/libz.so.1.2.3.4
/usr/lib/x86_64-linux-gnu/libz.a
/usr/lib/x86_64-linux-gnu/libz.so

Perhaps this symlink is missing on Nick's installation. It might be a wise idea 
to add /lib/MULTIARCH to the library search paths, too.

--

___
Python tracker 

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



[issue7201] double Endian problem and more on arm

2011-09-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

> I ran the ctypes tests on Debian GNU/Linux 5.0.8 (lenny) on an ARMv5tejl 
> Versatile kernel and everything passed.

I believe the problem is specific to machines still using the old ABI ('OABI'). 
 Which ABI was being used on your test machine? (Not sure how to tell, but 
there's more information about the ABIs at:

http://wiki.debian.org/ArmEabiPort

)

--

___
Python tracker 

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



[issue12961] unlabelled balls in boxes

2011-09-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

> "unlabelled balls in unlabelled boxes with capacity limits"

What does this mean?  If the boxes are unlabelled, how can they have individual 
capacity limits?  Or do you mean just a single limit that applies to all boxes?

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue12963] PyLong_AsSize_t returns (unsigned long)-1

2011-09-12 Thread Stefan Krah

New submission from Stefan Krah :

In one of the error branches PyLong_AsSize_t() returns (unsigned long)-1
instead of (size_t)-1.

--
components: Interpreter Core
files: pylong_as_size_t.diff
keywords: patch
messages: 143896
nosy: mark.dickinson, skrah
priority: normal
severity: normal
stage: patch review
status: open
title: PyLong_AsSize_t returns (unsigned long)-1
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23130/pylong_as_size_t.diff

___
Python tracker 

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



[issue12961] unlabelled balls in boxes

2011-09-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

> "unlabelled balls in labelled boxes with capacity limits"

Out of curiosity, what was the application that you needed this for?

This one feels a bit too specialized to me to be worth adding to the itertools 
library;  I see itertools more as providing a collection of general-purpose 
tools that the user can combine for specific situations, and it's easy to do 
the above with itertools.combinations plus some filtering of the results to 
satisfy the capacity constraints.  Admittedly, that's less-efficient than a 
custom-built recursive solution.

--
assignee:  -> rhettinger

___
Python tracker 

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



[issue11457] Expose nanosecond precision from system calls

2011-09-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

> I propose adding the Decimal fields "ctime", "atime", and "mtime" to the > 
> named tuple returned by os.stat().

That would be an interesting precedent:  I don't think there are many (any?) 
other places outside the 'decimal' module that deal with Decimal objects 
(excluding general purpose serialization protocols and the like).

Decimal's support for conversion to-and-from float (and comparison with float) 
is stronger than it used to be; I think this could work.

--

___
Python tracker 

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



[issue11715] Building Python on multiarch Debian and Ubuntu

2011-09-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

It wouldn't surprise me at all if the laptop's links were a little off - I 
started with a Kubuntu image off VMWare's site quite some time ago, then 
dist-upgraded it through a couple of releases as they came out.

--

___
Python tracker 

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



[issue12963] PyLong_AsSize_t returns (unsigned long)-1

2011-09-12 Thread Mark Dickinson

Mark Dickinson  added the comment:

Yep, clearly a bug.  Please fix!

--

___
Python tracker 

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



[issue12963] PyLong_AsSize_t returns (unsigned long)-1

2011-09-12 Thread STINNER Victor

STINNER Victor  added the comment:

I suppose that you can test if the bug is tested on Windows 64 bits, where 
sizeof(long)=32 bits, whereas sizeof(size_t) is 64 bits.

--
nosy: +haypo

___
Python tracker 

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



[issue12964] Two improvements for the locale aliasing engine

2011-09-12 Thread Sinisa Segvic

New submission from Sinisa Segvic :

Hi,

There appears to be some space for improvement
regarding the stable implementation
of the Python locale aliasing engine.

Sometimes, one wishes to be able
to override the default system locale.
For instance, it would be nice that a program
supposed to sort people according to national rules
would be able to run correctly even when the system
does not default to the national locale.

Judging from the Python manuals and
provided the desired national locale is installed,
this should be doable in at least the following two ways:

import locale
ianaLanguageSubtag='en'   # the desired national locale
locale.setlocale(locale.LC_ALL,
  (ianaLanguageSubtag, locale.getpreferredencoding())) #(1)
locale.setlocale(locale.LC_ALL,
  locale.normalize(ianaLanguageSubtag))#(2)


For a quicker reference, this is
the relevant part of the manual:
http://docs.python.org/release/3.2/library/locale.html
'''
locale.setlocale(category, locale=None)
  ...
  If (the locale) is a tuple, it is converted
  to a string using the locale aliasing engine.
  ...
'''

The locale aliasing engine binds
the IANA language subtags to POSIX locales.
Its effects can be directly observed
through locale.normalize:
>>> import locale
>>> locale.normalize('hr')
'hr_HR.ISO8859-2'
>>> locale.normalize('en')
'en_US.ISO8859-1'


My first objection concerns the Windows behaviour
of the calls (1) and (2) above.
Both of the two calls *do not work* since Windows
does not recognize strings such as 'en_US.ISO8859-1'.
Instead, Windows provides their own locale nomenclature:
http://msdn.microsoft.com/en-us/library/x99tb11d%28VS.80%29.aspx
Consequently, the following *works*:

locale.setlocale(locale.LC_ALL, 'English_United States.1252')

IMHO this issue should be fixed, perhaps by providing
an alternate definition of the locale alias dictionary
(locale.locale_alias).


My second objection concerns the behaviour on Linux,
where the call (1) above always works,
while (2) in some cases might not work.
It happens that the call (2)
requests an outdated 8-bit encoding
although UTF8 has obtained a world-wide acceptance.
The call shall result in a locale error
whenever the desired national locale
is present only in the UTF8 variant.

This might be fixed by changing the encodings
in the locale.locale_alias from 8-bit variants to UTF8.
Note however that the problem could be circumvented
by issuing the call (1), so this would be
less important than the Windows fix proposed above.

Source code references:
  .../Python-3.2.2/Lib/locale.py
  locale.locale_alias
  locale.normalize
  locale.setlocale

comp.lang.python discussion:
  
http://groups.google.com/group/comp.lang.python/browse_thread/thread/3591d496cf108ad2#

Cheers,

Sinisa

--
components: Library (Lib), Windows
messages: 143902
nosy: ssegvic
priority: normal
severity: normal
status: open
title: Two improvements for the locale aliasing engine
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



[issue12964] Two improvements for the locale aliasing engine

2011-09-12 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo, lemburg

___
Python tracker 

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



[issue12963] PyLong_AsSize_t returns (unsigned long)-1

2011-09-12 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d14f717b5e3d by Stefan Krah in branch '3.2':
Issue #12963: PyLong_AsSize_t() now returns (size_t)-1 in all error cases.
http://hg.python.org/cpython/rev/d14f717b5e3d

New changeset c91900e4e805 by Stefan Krah in branch 'default':
Merge fix for issue #12963.
http://hg.python.org/cpython/rev/c91900e4e805

--
nosy: +python-dev

___
Python tracker 

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



[issue12914] Add cram function to textwrap

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

> if the API were to be expanded, perhaps it should be as a part of a
> focuse[d], thoughtful effort to provide a more generic set of text
> formatting transformations perhaps modeled on deep experiences with
> similar modules in other languages. (as opposed to piecemeal additions
> that weren't designed with a coherent vision).

That’s a very strong point.

Thanks for the opinions.

--
stage:  -> committed/rejected

___
Python tracker 

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



[issue12301] Use :role:`sys.thing` instead of ``sys.thing`` throughout

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks Bryce, I will start from your patch.  (BTW, you used func instead of 
data for sys.stdout.)

--
stage: needs patch -> patch review
title: Use :data:`sys.thing` instead of ``sys.thing`` throughout -> Use 
:role:`sys.thing` instead of ``sys.thing`` throughout

___
Python tracker 

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



[issue11715] Building Python on multiarch Debian and Ubuntu

2011-09-12 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Sep 12, 2011, at 12:34 PM, Nick Coghlan wrote:

>It wouldn't surprise me at all if the laptop's links were a little off - I
>started with a Kubuntu image off VMWare's site quite some time ago, then
>dist-upgraded it through a couple of releases as they came out.

I'll try to get a VM up with the latest Oneiric Kubuntu image and see what
happens.

--

___
Python tracker 

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



[issue8933] Invalid detection of metadata version

2011-09-12 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e5c1de856828 by Éric Araujo in branch '3.2':
Fix determination of Metadata version (#8933).  Patch by Filip Gruszczyński.
http://hg.python.org/cpython/rev/e5c1de856828

New changeset 70298cdc48cd by Éric Araujo in branch 'default':
Merge fix for #8933 from 3.2
http://hg.python.org/cpython/rev/70298cdc48cd

New changeset ca21a47b1ec2 by Éric Araujo in branch 'default':
Fix determination of Metadata version in packaging (#8933).
http://hg.python.org/cpython/rev/ca21a47b1ec2

--
nosy: +python-dev

___
Python tracker 

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



[issue12913] Add a debugging howto

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

[Terry]
> If you write 'How to debug Python code' rather than just "How to use pdb",
That is my intention.

> I would start with the use of print statements
You, Ezio and I concur :)

> and binary search.
I’m not familiar with that term.  Is it hg bisect?

> Have short sections on using trace and profile.
I haven’t thought about these, thanks.

> Very useful would be a list of error messages and possible un-obvious
> to beginners but common causes.
These would be great additions to the programming FAQ, and my document could 
link to it.


[Ezio]
> People coming from other languages often feel the need of using a debugger 
> because that's
> what works best with the other languages, but it's not necessarily true for 
> Python.
I’ll be sure to make this clear, thanks.

> I'm not sure focusing on pdb is the best idea then.
My initial message did not do justice to my outline.  The part about pdb is 
probably the one that’ll take me more time, because I nearly don’t know it at 
all, but it won’t be the focus of the document.  A quick “getting started with 
pdb” section is what I have in mind, something more newbie-level than the pdb 
module docs (which seem to assume basic knowledge of how a Unix debugger 
program works).

> Mentioning unittest and coverage as a way to find errors earlier might also 
> be a good idea
Hadn’t though about coverage.  Will mention it and add a link to the devguide 
part that talks about it.

I don’t think I’ll have much time for this in the following few weeks, but as 
your replies appear to accept the idea, I will set up a clone to let us work on 
this.


Here’s my initial outline:

=== Introduction

- running a script in a terminal or IDLE
- getting a traceback (file and line)
- making sense of the exception message

=== Simple Troubleshooting Techniques

- print debugging
- using facilities provided by modules used
  - increasing logging verbosity
  - httplib.debuglevel
  - your web framework's debug helper
- going into interactive mode

* Using lint tools to catch mistakes early

- pyflakes first
- pylint -E
- pychecker?

* Getting more information out of failing tests

- using the most specialized methods to get diffs
- msg argument for boolean-returning methods
- print! suspend!  All is fair in debugging.

* Automating troubleshooting

- emacs/vim quickfix (mode that runs tests and open faulty files at the right 
line)


=== Using a Debugger

- pdb intro that does not duplicate what’s in library/pdb.rst
- definitions (breakpoint, etc.)


=== Debugging C code

(just a few pointers, this could have a whole howto in itself)

- running Python in gdb
- using faulthandler


Links to add somewhere: traceback module, cgitb

--

___
Python tracker 

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



[issue8933] Invalid detection of metadata version

2011-09-12 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4b72d56cf42f by Éric Araujo in branch '2.7':
Fix determination of Metadata version (#8933).  Patch by Filip Gruszczyński.
http://hg.python.org/cpython/rev/4b72d56cf42f

--

___
Python tracker 

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



[issue12841] Incorrect tarfile.py extraction

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

I understand.  Unit tests can work with file permissions, ownership and links, 
but they can’t create different filesystems or ask for superuser rights.  
test_shutil contains a few tests that purport to test cross-filesystems usage 
but may or may not actually do it (#).

--

___
Python tracker 

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



[issue12915] Add inspect.locate and inspect.resolve

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

Sorry if I was unclear; the functions work with a dotted name as a string and 
resolve it to an object.  __import__ works with module, whereas this kind of 
functions work with mod.name, pkg.mod.name.attr, etc., that is, they combine 
import and getattr.

--

___
Python tracker 

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



[issue12299] Stop documenting functions added by site as builtins

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

Agreed.

--
resolution:  -> works for me
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue12917] Make visiblename and allmethods functions public

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

Copied from msg143857:

> There are a lot of little internal routines in the standard library
> that aren't sufficiently fit to be exposed (perhaps a little too
> ad-hoc or special purpose, perhaps the API isn't sufficiently
> general, perhaps the routines rely on non-guaranteed aspects of the
> implementation).  For example, visiblename() is more heuristic than
> algorithmic -- right now, we can change that as needed (for instance,
> the recent updates to accommodate named tuples), but as soon as the
> method or function becomes public, its API freezes and it is hard for
> us to make changes.

I agree with your general point.  For this particular case, I’d be okay if you 
wanted to reject the request.  Users can filter the output of dir depending on 
their needs (_private names, __magic__ names, etc.).  For more useful code 
(that can cope with named tuples for example), I think generic functions would 
be a nice way to do this.

--

___
Python tracker 

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



[issue12917] Make visiblename and allmethods functions public

2011-09-12 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
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



[issue12917] Make visiblename and allmethods functions public

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

A precision:

> I think generic functions would be a nice way to do this.
I meant: a nice way to experiment this *outside of the stdlib*.  We don’t have 
official generic function yet, so I’ll wait to see if pprint gets rewritten 
and/or if we get a generic functions PEP and standard module.

Sorry if these issues I opened are consuming your time; I wanted to make sure 
we considered the proposals separately and add a good rationale for rejecting 
them.  Thanks for weighing in.

--
stage:  -> committed/rejected

___
Python tracker 

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



[issue12918] New module for terminal utilities

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

Copied from msg143857 (Raymond Hettinger):

> Resist the urge to fatten APIs until you're sure that:
> * they are needed
> * they are well developed (many internal utils fail this test)
> * they are worth the extra time it takes to learn what is in a module (adding 
> rarely needed
> tools has the side-effect of obscuring things people actually need)
> [...]
> The pager functions are interesting and non-trivial.  Before making them 
> public in the
> standard library though, it would be best if it had some life as third-party 
> module to let
> it mature (i.e. making sure it works as well in other contexts as it does in 
> pydoc).

I’m thus closing this request.  Someone can run with the idea, publish 
experiments on PyPI, gather feedback from python-ideas, and we’ll see about 
stdlib inclusion when the time is right.

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

___
Python tracker 

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



[issue12483] CThunkObject_dealloc should call PyObject_GC_UnTrack?

2011-09-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

I was going to say that the patch has no visible effect, since 
PyObject_GC_Del() calls something which has the same effect as 
PyObject_GC_Untrack...
But the following code crashes the interpreter! And of course the patch fixes 
it...


import ctypes, gc
class Nasty:
def __del__(self):
gc.collect()

ctypes.CFUNCTYPE(None)(lambda x=Nasty(): None)
print("OK")

--

___
Python tracker 

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



[issue8933] Invalid detection of metadata version

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

It was very easy to verify your patch: PEP 314 lists the new fields.

For packaging (distutils2), I thought the fix would be less easy: I believed 
that all fields in _314_MARKERS would cause i conflict if used together with 
345 fields, but as it turns out they don’t.  I’ll leave it at that for now, but 
I really want to rework the best_version-related functions to make them easier 
to grasp.

Thanks for the patches and bumps!

--
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



[issue5977] distutils build_ext.get_outputs returns wrong result

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

The fix you committed uses an absolute path for the C sources, which is 
invalid: sources should contain relative paths only.

--
versions:  -Python 3.1

___
Python tracker 

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



[issue9322] Don’t fail silently if ext_modules use absolute paths

2011-09-12 Thread Éric Araujo

Éric Araujo  added the comment:

I started to work on a simple patch but it makes one of our tests fail.  It 
uses absolute paths because it needs to change directory and check that 
get_outputs works.

--
dependencies: +distutils build_ext.get_outputs returns wrong result
keywords: +patch
versions: +Python 3.3 -Python 3.1
Added file: http://bugs.python.org/file23131/d1-ext-absolute-sources-9322.diff

___
Python tracker 

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



[issue12961] unlabelled balls in boxes

2011-09-12 Thread Phillip M. Feldman

Phillip M. Feldman  added the comment:

Hello Mark,

This is a fair question.  Suppose that I have three boxes with capacity
limits of 3, 2, and 1, and that there are three balls in total.  Two of the
possible distributions are the following:

2, 0, 1
2, 1, 0

Capacity limits of the individual boxes must be observed when distributing
the balls.  Even though the second and third boxes have different
capacities, we must treat the above two distributions of balls as
equivalent.

Combinatorics problems involving boxes with capacity limits arise in such
application domains as physics and reliability.

Phillip

On Mon, Sep 12, 2011 at 5:13 AM, Mark Dickinson wrote:

>
> Mark Dickinson  added the comment:
>
> > "unlabelled balls in unlabelled boxes with capacity limits"
>
> What does this mean?  If the boxes are unlabelled, how can they have
> individual capacity limits?  Or do you mean just a single limit that applies
> to all boxes?
>
> --
> nosy: +mark.dickinson
>
> ___
> Python tracker 
> 
> ___
>

--
nosy: +phillip.m.feld...@gmail.com
Added file: http://bugs.python.org/file23132/unnamed

___
Python tracker 

___Hello Mark,This is a fair question.  Suppose that I have three boxes 
with capacity limits of 3, 2, and 1, and that there are three balls in total.  
Two of the possible distributions are the following:2, 0, 1
2, 1, 0Capacity limits of the individual boxes must be observed when 
distributing the balls.  Even though the second and third boxes have different 
capacities, we must treat the above two distributions of balls as 
equivalent.
Combinatorics problems involving boxes with capacity limits arise in such 
application domains as physics and reliability.PhillipOn Mon, Sep 12, 2011 at 5:13 AM, Mark Dickinson rep...@bugs.python.org> 
wrote:

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

> "unlabelled balls in unlabelled boxes with capacity limits"

What does this mean?  If the boxes are unlabelled, how can they have 
individual capacity limits?  Or do you mean just a single limit that applies 
to all boxes?

--
nosy: +mark.dickinson

___
Python tracker rep...@bugs.python.org>
http://bugs.python.org/issue12961>
___

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



[issue12913] Add a debugging howto

2011-09-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Binary search with print is done manually. If error not obvious from quick 
read, in a 20 line function, add print around line 10. If ok there, look down 
and add print later in function. If not, look up and add print earlier in 
function. This is not exact at all, but quick reruns (F5 with IDLE) mean no 
need to load up entire function with prints (that will have to be removed 
again) all at once (as might do with compiled C 20 years ago). Same idea as 
binary search through revisions to find buildbot breaker. I am sure you know 
this, even if not by terms I used.

--

___
Python tracker 

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



[issue12965] longobject: documentation improvements

2011-09-12 Thread Stefan Krah

New submission from Stefan Krah :

I think the integer objects documentation could be clearer on a
couple of points:

  - Despite being listed under "Concrete Objects Layer", some
functions implicitly accept anything with an __int__()
method. Currently only the PyLong_AsLong() documentation
states this explicitly.

The patch clearly distinguishes between functions that
duck type and functions that don't. 

  - The patch replaces "is greater than *_MAX" instances with
"out of bounds" to include the other error condition
"is less than *_MIN".


Additionally, the patch fixes comments in longobject.c that
don't state the duck typing behavior.

--
assignee: docs@python
components: Documentation
files: longobject-doc.diff
keywords: patch
messages: 143922
nosy: docs@python, mark.dickinson, skrah
priority: normal
severity: normal
stage: patch review
status: open
title: longobject: documentation improvements
type: feature request
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23133/longobject-doc.diff

___
Python tracker 

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



[issue12965] longobject: documentation improvements

2011-09-12 Thread Stefan Krah

Changes by Stefan Krah :


--
assignee: docs@python -> mark.dickinson

___
Python tracker 

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



[issue12301] Use :role:`sys.thing` instead of ``sys.thing`` throughout

2011-09-12 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

It would be best to think about each of the new links individually rather than 
making blanket changes.   

The new links need to have relevance and add value to the topic; otherwise, 
they are just distractions from the more relevant links that had been placed 
there in a thoughtful manner.

For example, I don't think the docs are improved by turning every 
``sys.stderr`` into a link.  How does that help users or does it just make the 
docs harder to read and obscure the move useful links.

--
nosy: +rhettinger

___
Python tracker 

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



[issue7201] double Endian problem and more on arm

2011-09-12 Thread Meador Inge

Meador Inge  added the comment:

On Mon, Sep 12, 2011 at 7:10 AM, Mark Dickinson  wrote:

> Mark Dickinson  added the comment:
>
> I believe the problem is specific to machines still using the old ABI 
> ('OABI').  Which ABI was being used on your test machine?

I tested the new ABI (armel).  I will try the old ABI.  However, after
reading over the ABI differences, the problems seem to be expected.
In particular:

"""
Struct packing and alignment

With the new ABI, default structure packing changes, as do some
default data sizes and alignment (which also have a knock-on effect on
structure packing). In particular the minimum size and alignment of a
structure was 4 bytes. Under the EABI there is no minimum and the
alignment is determined by the types of the components it contains.
This will break programs that know too much about the way structures
are packed and can break code that writes binary files by dumping and
reading structures.
"""

Once I get an OABI system up and running I will substantiate that
claim.  I don't think there is going to be a bug fix here as I don't
think it is practical to support both ABIs.  Just a "these tests are
expected to fail due to ABI differences x, y, z" kind of thing.

--

___
Python tracker 

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



[issue12913] Add a debugging howto

2011-09-12 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

More time: read outline, good start.
On syntax errors, IDLE put up message box and OK returns to window with 
apparent error hi-lited and cursor just after.

--

___
Python tracker 

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



[issue12301] Use :role:`sys.thing` instead of ``sys.thing`` throughout

2011-09-12 Thread Georg Brandl

Georg Brandl  added the comment:

I agree.

--

___
Python tracker 

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



[issue12939] Add new io.FileIO using the native Windows API

2011-09-12 Thread Santoso Wijaya

Changes by Santoso Wijaya :


--
nosy: +santa4nt

___
Python tracker 

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



[issue12963] PyLong_AsSize_t returns (unsigned long)-1

2011-09-12 Thread Stefan Krah

Stefan Krah  added the comment:

> Yep, clearly a bug.  Please fix!

Done, thanks for reviewing.


Victor, I don't think we need a unit test for this. I plan to go
over some modules with gcov in the future, and I'll include
longobject.c.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue12966] cookielib.LWPCookieJar breaks on cookie values with a newline

2011-09-12 Thread Paulie Pena

New submission from Paulie Pena :

Even though RFC 6265's cookie-value's cookie-octet definition says that 
whitespace characters are not allowed (see http://tools.ietf.org/html/rfc6265), 
there are non-compliant web sites that send cookie values with newlines.  
cookielib.LWPCookieJar will save the bad value in a cookie file, but when it 
tries to load it, it probably is only splitting by newlines, so it crashes on 
the invalid line.  The easiest thing would probably be to just ignore cookies 
that have values with a newline.  (Note: I'm using Python 2.5, so this might 
have been fixed in a later version.)

--
components: Library (Lib)
messages: 143928
nosy: paulie4
priority: normal
severity: normal
status: open
title: cookielib.LWPCookieJar breaks on cookie values with a newline
type: behavior

___
Python tracker 

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



[issue12483] CThunkObject_dealloc should call PyObject_GC_UnTrack?

2011-09-12 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset eb9f566fd8db by Amaury Forgeot d'Arc in branch '2.7':
Issue #12483: ctypes: Fix a crash when the destruction of a callback
http://hg.python.org/cpython/rev/eb9f566fd8db

New changeset eae8e4ab0455 by Amaury Forgeot d'Arc in branch '3.2':
Issue #12483: ctypes: Fix a crash when the destruction of a callback
http://hg.python.org/cpython/rev/eae8e4ab0455

New changeset fe125a3fda54 by Amaury Forgeot d'Arc in branch 'default':
Merge 3.2: Issue #12483: ctypes: Fix a crash when the destruction of a callback
http://hg.python.org/cpython/rev/fe125a3fda54

--
nosy: +python-dev

___
Python tracker 

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



[issue8822] datetime naive and aware types should have a well-defined definition that can be cross-referenced

2011-09-12 Thread Jakob Malm

Jakob Malm  added the comment:

I agree with Alexander -- I think the current documentation is sufficient to 
describe 'naive' and 'aware' date and time objects.

The sentence "There are two kinds of date and time objects: “naive” and 
“aware”." is perhaps a bit unfortunate, however. It appears that Anatoly had 
misinterpreted 'naive' and 'aware' objects to be of different Python types:

> 'naive' and 'aware' are key datetime types

Perhaps the sentence could be changed to something like:

"date and time objects are either 'naive' or 'aware'.

--
nosy: +shaq

___
Python tracker 

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



[issue12483] CThunkObject_dealloc should call PyObject_GC_UnTrack?

2011-09-12 Thread Meador Inge

Meador Inge  added the comment:

Heh, I was just about to upload another patch with your test case.  Thanks for 
committing this Amaury.

--
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



[issue12483] CThunkObject_dealloc should call PyObject_GC_UnTrack?

2011-09-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Thanks for your help! I fear they are many other places like this one in 
CPython code.

--

___
Python tracker 

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



[issue6560] socket sendmsg(), recvmsg() methods

2011-09-12 Thread Bill Janssen

Bill Janssen  added the comment:

I'm guessing these things are due to interaction with some Apple
security update, as the buildbots were working well 8 months ago.

Bill

On Wed, Sep 7, 2011 at 4:01 PM, Nick Coghlan  wrote:
>
> Nick Coghlan  added the comment:
>
> If Bill gets a chance to investigate this before the weekend, great, 
> otherwise my plan to stop making noise in the buildbot results will be to:
>
> 1. Create a separate issue specifically for the errors reported by the Mac OS 
> X buildbots (allowing the problem to be spelled out more clearly for readers, 
> and also allowing the feature request itself to be closed)
>
> 2. Flag the offending tests as expected failures on Mac OS X, with a pointer 
> back to the new tracker issue.
>
> That way, if these failures are due to underlying OS bugs or limitations (as 
> they appear to be), we'll get a clear indication in the buildbots when Apple 
> have fixed the relevant problems.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue1172711] long long support for array module

2011-09-12 Thread Stefan Krah

Stefan Krah  added the comment:

I made the observation on Rietveld that the following code is never
executed by the test suite. The same applies to similar existing
passages in arraymodule.c:

http://bugs.python.org/review/1172711/diff/3310/10310#newcode394


Meador correctly pointed out that the code allows for duck typing.
But the struct module (and by extension memoryview that must follow
the struct module) don't:

>>> import array, struct
>>> a = array.array('L', [1,2,3])
>>> class T(object):
... def __init__(self, value):
... self.value = value
... def __int__(self):
...  return self.value
...
>>> a = array.array('L', [1,2,3])
>>> struct.pack_into('L', a, 0, 9)
>>> a
array('L', [9, 2, 3])
>>> a[0] = T(100)
>>> a
array('L', [100, 2, 3])
>>> struct.pack_into('L', a, 0, T(200))
Traceback (most recent call last):
  File "", line 1, in 
struct.error: required argument is not an integer
>>>

I vastly prefer the struct module behavior. Since the code isn't executed
by any tests:

Is it really the intention for array to allow duck typing? The documentation
says:

"This module defines an object type which can compactly represent an array
 of basic values: characters, integers, floating point numbers."

"Basic value" doesn't sound to me like "anything that has an __int__() method".


Also, consider this:

>>> sum([T(1),T(2),T(3)])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported operand type(s) for +: 'int' and 'T'

>>> sum(array.array('L', [T(1),T(2),T(3)]))
6

--

___
Python tracker 

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



[issue12961] unlabelled balls in boxes

2011-09-12 Thread Phillip M. Feldman

Phillip M. Feldman  added the comment:

Here's an example of a problem from an entirely different domain:

An error control coding scheme can correct up to 3 errors in the header of a
packet and up to one error in the body of a packet. A given message is
divided into four consecutive packets. Find all possible correctible
distributions of 6 errors among the four packets, treating the order of the
four packets as significant.

Phillip

On Mon, Sep 12, 2011 at 9:41 AM, Phillip M. Feldman
wrote:

>
> Phillip M. Feldman  added the comment:
>
> Hello Mark,
>
> This is a fair question.  Suppose that I have three boxes with capacity
> limits of 3, 2, and 1, and that there are three balls in total.  Two of the
> possible distributions are the following:
>
> 2, 0, 1
> 2, 1, 0
>
> Capacity limits of the individual boxes must be observed when distributing
> the balls.  Even though the second and third boxes have different
> capacities, we must treat the above two distributions of balls as
> equivalent.
>
> Combinatorics problems involving boxes with capacity limits arise in such
> application domains as physics and reliability.
>
> Phillip
>
> On Mon, Sep 12, 2011 at 5:13 AM, Mark Dickinson  >wrote:
>
> >
> > Mark Dickinson  added the comment:
> >
> > > "unlabelled balls in unlabelled boxes with capacity limits"
> >
> > What does this mean?  If the boxes are unlabelled, how can they have
> > individual capacity limits?  Or do you mean just a single limit that
> applies
> > to all boxes?
> >
> > --
> > nosy: +mark.dickinson
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
> nosy: +phillip.m.feld...@gmail.com
> Added file: http://bugs.python.org/file23132/unnamed
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: http://bugs.python.org/file23134/unnamed

___
Python tracker 

___Here's an example of a problem from an entirely different domain:An 
error control coding scheme can correct up to 3 errors in the header of a 
packet and up to one error in the body of a packet. A given message is divided 
into four consecutive packets. Find all possible correctible distributions of 6 
errors among the four packets, treating the order of the four packets as 
significant.
PhillipOn Mon, Sep 12, 2011 at 9:41 AM, 
Phillip M. Feldman rep...@bugs.python.org> 
wrote:

Phillip M. Feldman phillip.m.feld...@gmail.com> 
added the comment:

Hello Mark,

This is a fair question.  Suppose that I have three boxes with capacity
limits of 3, 2, and 1, and that there are three balls in total.  Two of the
possible distributions are the following:

2, 0, 1
2, 1, 0

Capacity limits of the individual boxes must be observed when distributing
the balls.  Even though the second and third boxes have different
capacities, we must treat the above two distributions of balls as
equivalent.

Combinatorics problems involving boxes with capacity limits arise in such
application domains as physics and reliability.

Phillip

On Mon, Sep 12, 2011 at 5:13 AM, Mark Dickinson rep...@bugs.python.org>wrote:

>
> Mark Dickinson dicki...@gmail.com> added the 
comment:
>
> > "unlabelled balls in unlabelled boxes with capacity 
limits"
>
> What does this mean?  If the boxes are unlabelled, how can they have
> individual capacity limits?  Or do you mean just a single limit that 
applies
> to all boxes?
>
> --
> nosy: +mark.dickinson
>
> ___
> Python tracker rep...@bugs.python.org>
> http://bugs.python.org/issue12961>
> ___
>

--
nosy: +mailto:phillip.m.feld...@gmail.com";>phillip.m.feld...@gmail.com
Added file: http://bugs.python.org/file23132/unnamed"; 
target="_blank">http://bugs.python.org/file23132/unnamed

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



[issue8822] datetime naive and aware types should have a well-defined definition that can be cross-referenced

2011-09-12 Thread Jakob Malm

Jakob Malm  added the comment:

I created a patch with the revised wording.

--
keywords: +patch
Added file: http://bugs.python.org/file23135/datetime_doc.patch

___
Python tracker 

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



[issue12958] test_socket failures on Mac OS X

2011-09-12 Thread David Watson

Changes by David Watson :


--
nosy: +baikie

___
Python tracker 

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



[issue8822] datetime naive and aware types should have a well-defined definition that can be cross-referenced

2011-09-12 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Mon, Sep 12, 2011 at 4:30 PM, Jakob Malm  wrote:
..
> I created a patch with the revised wording.

Your patch seems to reflow the entire paragraph which makes it hard to
review and if applied will appear as a bigger change than it is.  Can
you regenerate the patch so that it does not have whitespace only
diffs?  Thanks.

--
nosy: +Alexander.Belopolsky

___
Python tracker 

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



[issue8822] datetime naive and aware types should have a well-defined definition that can be cross-referenced

2011-09-12 Thread anatoly techtonik

anatoly techtonik  added the comment:

The point was:
1. Create an anchor to definition of "naive" object
2. Create an anchor to definition of "aware" object
3. Make definitions stand out from the inline text
4. Create cross-references for "naive" and "aware" keywords in text that lead 
directly to appropriate definition
5. Mention the fact: By default all objects are "naive", by definition, because 
they don't have any TZ information, and there are no classes in stdlib that 
provide this info (tzclass implemetations)
6. Answer the questions: How to make non-naive object? How to detect if object 
of naive or aware?

That's it. If it's already done - then this ticket can be closed.

--

___
Python tracker 

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



[issue8822] datetime naive and aware types should have a well-defined definition that can be cross-referenced

2011-09-12 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Mon, Sep 12, 2011 at 4:36 PM, anatoly techtonik
 wrote:
..
> 5. Mention the fact: By default all objects are "naive", by definition, 
> because they don't have any
> TZ information, and there are no classes in stdlib that provide this info 
> (tzclass implemetations)

This is simply wrong: in py3k we have the timezone class that
implements tzinfo interface.

> 6. Answer the questions: How to make non-naive object? How to detect if 
> object of naive or aware?

I would go one step further: we should review the examples in datetime
module documentation and use aware datetime objects unless the point
of the example is to demonstrate a naive datetime.  We should also
replace examples that use sample implementations of tzinfo to use the
timezone class.

--

___
Python tracker 

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



[issue12946] PyModule_GetDict() claims it can never fail, but it can

2011-09-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The path with PyDict_New() is never taken, because PyModule_New already fills 
md_dict.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue12924] Missing call to quote_plus() in test_urllib.test_default_quoting()

2011-09-12 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e25526865339 by Senthil Kumaran in branch 'default':
merge from 3.2 - Add the missing quote_plus call. Fix closes Issue12924
http://hg.python.org/cpython/rev/e25526865339

New changeset e8d8eb9e05fd by Senthil Kumaran in branch '2.7':
Port the fix for Issue12924 (missing quote_plus) to 2.7 branch.
http://hg.python.org/cpython/rev/e8d8eb9e05fd

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

___
Python tracker 

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



[issue12924] Missing call to quote_plus() in test_urllib.test_default_quoting()

2011-09-12 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

jon, thanks for the bug report. Fixed and closed in all the branches.

--

___
Python tracker 

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



[issue12938] html.escape docstring does not mention single quotes (')

2011-09-12 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Yes, single quotes should not escaped in the CGI escape. We should remove that 
from the table.

--
nosy: +orsenthil

___
Python tracker 

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



[issue12938] html.escape docstring does not mention single quotes (')

2011-09-12 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

The single quote escape was added due to Issue9061 and Issue2830. Since it was 
included deliberately due to above raised issues, it is best to document it, 
instead of removing it.

--

___
Python tracker 

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



[issue12938] html.escape docstring does not mention single quotes (')

2011-09-12 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset bc5b96c92770 by Senthil Kumaran in branch '3.2':
Fix issue12938 - Update the docstring of html.escape. Include the information 
on single quote.
http://hg.python.org/cpython/rev/bc5b96c92770

--
nosy: +python-dev

___
Python tracker 

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



[issue12913] Add a debugging howto

2011-09-12 Thread Ezio Melotti

Ezio Melotti  added the comment:

> Hadn’t though about coverage.  Will mention it and add a link
> to the devguide part that talks about it.

Is devguide/coverage.html#using-coverage-py generic enough?  We don't have to 
duplicate the coverage documentation though, mentioning the tool and what it 
does, provide a couple of simple example and a link to the coverage doc should 
be enough.

Talking about unittest and coverage is not strictly about debugging (you don't 
have any bug yet), but it's useful because it might reveal bugs earlier and 
avoid debugging sessions later.  This might also go with pyflakes and friends, 
since they both provide a way to detect bugs earlier.

> - running Python in gdb

This is somewhat orthogonal, but the devguide/gdb page doesn't say how to start 
running Python in gdb (it might be obvious to people used to use gdb, but it 
should still be mentioned).

> If error not obvious from quick read, in a 20 line function,
> add print around line 10.

I usually print variables in order of suspiciousness, i.e., I usually have an 
idea about where the problem might be, if it's not there I move to the next 
suspect.  This also applies when I know which variable is "wrong" but I don't 
know where it got wrong: I just add the prints around the most suspicious 
function that might have changed.

--

___
Python tracker 

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



[issue6560] socket sendmsg(), recvmsg() methods

2011-09-12 Thread Nick Coghlan

Nick Coghlan  added the comment:

The feature patch for sendmsg/recvmsg support came with a swathe of new tests, 
and the failures are in those new tests rather than anything breaking in the 
old ones.

As Charles-François noted though, it doesn't look like the feature 
implementation itself is doing anything wrong, just that there are limits to 
what Mac OS X allows us to do with it (hence why I closed this feature request 
and opened issue #12958 to cover the task of updating the test suite to 
accurately reflect that situation).

--

___
Python tracker 

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



[issue1172711] long long support for array module

2011-09-12 Thread Meador Inge

Meador Inge  added the comment:

 import array, struct
 a = array.array('L', [1,2,3])
 class T(object):
> ...     def __init__(self, value):
> ...         self.value = value
> ...     def __int__(self):
> ...          return self.value
> ...
 a = array.array('L', [1,2,3])
 struct.pack_into('L', a, 0, 9)
 a
> array('L', [9, 2, 3])
 a[0] = T(100)
 a
> array('L', [100, 2, 3])
 struct.pack_into('L', a, 0, T(200))
> Traceback (most recent call last):
>  File "", line 1, in 
> struct.error: required argument is not an integer

>
> I vastly prefer the struct module behavior. Since the code isn't executed
> by any tests:

Yeah, but if it is a good feature we can always add more tests.  I think the
real issue is whether or not this behavior is even desirable.  Also, similar
behavior can be achieved with struct by using '__index__':

...  def __init__(self, value):
...  self.value = value
...  def __int__(self):
...   return self.value
...  def __index__(self):
...   return self.value
...
>>> a = array.array('L', [1,2,3])
>>> struct.pack_into('L', a, 0, T(200))
>>> a
array('L', [200, 2, 3])

Also, check out issue1530559.  Originally, struct did allow the
'__int__' and '__long__' behavior, but it was deprecated and replaced
with '__index__'.  Maybe we should do the same for array?

IMO, having some way to convert objects to integers is a nice feature
and I think we will find more cases like the PyCUDA case from
issue1530559 where folks need this.

--

___
Python tracker 

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



[issue12961] unlabelled balls in boxes

2011-09-12 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue12967] AttributeError distutils\log.py

2011-09-12 Thread ben

New submission from ben :

AttributeErrors on log.py in the distutils directory

import sys
stream = sys.stdout
if stream.errors == 'strict': pass'=> this will raise an AttributeError'

--
assignee: tarek
components: Distutils
files: log.py
messages: 143949
nosy: Ben.thelen, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: AttributeError distutils\log.py
type: compile error
versions: Python 3.2
Added file: http://bugs.python.org/file23136/log.py

___
Python tracker 

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



[issue12969] Command 'open(0, "wb").close()' cause crash of Python interpreter [interactive mode]

2011-09-12 Thread Jiří Kučera

New submission from Jiří Kučera :

Invoking the `close' method of `_io.BufferedWriter' instance created by 
`open(0,"wb")' command cause the Python interpreter crash.

Python interpreter info:
  mode: interactive
  version info: Python 3.2.1 (default, Jul 10 2011, 21:51:15) [MSC v.1500 32 
bit (Intel)] on win32

Operanting system info:
  Microsoft Windows XP
  Home Edition
  Version 2002
  Service Pack 3

Commands:
>>> fd = open(0,"wb")
>>> fd.close()

--
components: Interpreter Core
messages: 143951
nosy: i386x
priority: normal
severity: normal
status: open
title: Command 'open(0,"wb").close()' cause crash of Python interpreter 
[interactive mode]
type: crash
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