[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +durban

___
Python tracker 

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



[issue11873] test_regexp() of test_compileall failure on "x86 OpenIndiana 3.x"

2011-05-01 Thread Stefan Krah

Stefan Krah  added the comment:

R. David Murray  wrote:
> The failing test is launching a subprocess to compile python code, waiting
> for the subprocess to exit, and then checking to see if the file was
> created.  So the timing issue would appear to be that the file created by
> the subprocess doesn't appear to exist to the main program even after the
> subprocess has exited.  Stefan, Jesus, do either of you know of anything
> about the file systems used on your buildbots that might give rise to this
> problem?  Is there some sort of file system sync call we need to make to
> make sure different processes have the same view of the file system?

The FreeBSD bot has a UFS filesystem with no soft updates:

$ mount
/dev/ad0s1a on / (ufs, local)

If the main process waits for the subprocess to finish, I can't think of
a reason to do any kind of synchronization.

--

___
Python tracker 

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



[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue11912] PaX triggers a segfault in dlopen

2011-05-01 Thread Charles-François Natali

Charles-François Natali  added the comment:

> Is there any reason not to close this as a CPython issue? 

No, it's definitely not a CPython issue. I'm closing as invalid.

--
resolution:  -> invalid
status: open -> closed
title: Python shouldn't use the mprotect() system call -> PaX triggers a 
segfault in dlopen

___
Python tracker 

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



[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

"The only way ..." That's not true. y=x*(1<

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



[issue11270] logging: RotatingFileHandler crash when opening the Logfile in an Texteditor

2011-05-01 Thread Alexander Vrchoticky

Alexander Vrchoticky  added the comment:

I hit that problem too (Python 2.6.5). We have a Windows service application 
(daemon, in Unix parlance). This is written in Python and uses 
RotatingFileHandler to rotate files when they exceed 1MB. We look at the files 
for debugging. For a live view of log entries, we use less.exe in follow mode. 

If the rotating log handler hits the size limit while the current log file is 
watched, it throws an exception and logging is broken henceforth. Restarting 
the service while less.exe is still running does not help, it hits the same 
exception right from the outset.

Since we cannot stop users from looking at the log files, and we cannot have 
our service application die by user interaction, this is a serious problem.

I am confused by the statement that "you should not look at the files as long 
as they are under the library's control". As I understood, on rotating, the 
oldest file will be deleted, all others will be renamed, and a new file will be 
created. No file will remain untouched. As far as the human log reader is 
concerned, rotation can happen at any time, so all log files are under control 
of the library for their entire life.
If that's true, why bother writing them in the first place? :-)

The root problem is that RotatingFileHandler cannot rename the file while 
less.exe has it open. Under Unix-like file systems, this problem may not 
appear: Renaming an open file works, and the file descriptor held by less.exe 
remains valid. The logger is free to create another file with the same name. 
Under Windows, files and directory entries are more closely related. Hence, the 
error "The process cannot access the file because it is being used by another 
process". I do not know if it is possible to work around this.

Comments are appreciated. RotatingFileHandler looks like a good match for 
long-running service applications. If this issue remains unresolved, it is not. 
A word of warning in the docs seems appropriate in this case.

--
nosy: +avrchoti

___
Python tracker 

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



[issue9756] Crash with custom __getattribute__

2011-05-01 Thread STINNER Victor

STINNER Victor  added the comment:

Le dimanche 01 mai 2011 à 03:19 +, STINNER Victor a écrit :
> The test suite crashs randomly with issue9756.patch on my Ubuntu 11.04
> (AMD64 with 4 cores, 4 GB of memory, Linux 2.6.38). I use "./python
> -bb Lib/test/regrtest.py -r" to reproduce the crash.
> 
> ... I tried without the patch, and test_descr does crash quickly in
> test_wrapper_segfault(). It crashs in _PyObject_GC_New(), in a
> callback used to release the memory. Sometimes it fails on
> update_refs(), sometimes in _PyObject_DebugFree(), sometimes in
> wrapper_dealloc()->_Py_ForgetReference, etc. I use "./python
> Lib/test/regrtest.py -F -v test_descr" to reproduce the crash
> (sometimes it takes more than one run to crash).
> 
> It's strange because I'm unable to reproduce the bug on a very similar
> setup (Debian Sid, AMD64 with 2 cores, 2 GB of memory, Linux 2.6.38).
> 
> Should I run a memcheck on the Ubuntu host? Or is anyone able to
> reproduce the bug?

Ok, I'm sure that I have hardware issues, but I am also sure that the
patch introduces random crashes, especially in
test_descr.test_wrapper_segfault().

I tried to only patch methoddescr_call(): replace PyObject_IsInstance()
by _PyObject_RealIsSubclass() introduces the crash. Call
PyObject_IsInstance() after _PyObject_RealIsSubclass() doesn't help.
But... call PyObject_IsInstance() before _PyObject_RealIsSubclass()
avoids the crash !?

--

___
Python tracker 

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



[issue11969] Can't launch Process on built-in static method

2011-05-01 Thread Ram Rachum

New submission from Ram Rachum :

Hello,

I found this bit in my inbox, I forgot why I cared about it, but it raises an 
exception (at least on Windows):

>>> import multiprocessing
>>> p = multiprocessing.Process(target=bytes.maketrans, args=(b'abc', b'xyz'))
>>> p.start()
Traceback (most recent call last):
  File "C:\Python32\Lib\pickle.py", line 679, in save_global
klass = getattr(mod, name)
AttributeError: 'module' object has no attribute 'maketrans'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python32\Lib\multiprocessing\process.py", line 130, in start
self._popen = Popen(self)
  File "C:\Python32\Lib\multiprocessing\forking.py", line 267, in __init__
dump(process_obj, to_child, HIGHEST_PROTOCOL)
  File "C:\Python32\Lib\multiprocessing\forking.py", line 190, in dump
ForkingPickler(file, protocol).dump(obj)
  File "C:\Python32\Lib\pickle.py", line 237, in dump
self.save(obj)
  File "C:\Python32\Lib\pickle.py", line 344, in save
self.save_reduce(obj=obj, *rv)
  File "C:\Python32\Lib\pickle.py", line 432, in save_reduce
save(state)
  File "C:\Python32\Lib\pickle.py", line 299, in save
f(self, obj) # Call unbound method with explicit self
  File "C:\Python32\Lib\pickle.py", line 623, in save_dict
self._batch_setitems(obj.items())
  File "C:\Python32\Lib\pickle.py", line 656, in _batch_setitems
save(v)
  File "C:\Python32\Lib\pickle.py", line 299, in save
f(self, obj) # Call unbound method with explicit self
  File "C:\Python32\Lib\pickle.py", line 683, in save_global
(obj, module, name))
_pickle.PicklingError: Can't pickle : it's not 
found as __main__.maketrans

If you do the same things with `threading.Thread`, it works, but for 
`multiprocessing.Process` it doesn't. Is this a general problem with pickling 
"unbound methods"?

--
components: Interpreter Core, Library (Lib)
messages: 134907
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Can't launch Process on built-in static method
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue11970] distutils command 'upload' crashes when --show-response is selected

2011-05-01 Thread Chris Rose

New submission from Chris Rose :

When running distutils like so:

.tox/py27/bin/python setup.py -v bdist_egg upload --show-response 

Eventually, after everything else spools by, this pops up:


Using PyPI login from /Users/offline/.pypirc
Submitting dist/PyHamcrest-1.5-py2.7.egg to http://pypi.python.org/pypi
Upload failed (401): You must be identified to edit package information
Traceback (most recent call last):
  File "setup.py", line 69, in 
setup(**all_params)
  File "/usr/local/Cellar/python/2.7.1/lib/python2.7/distutils/core.py", line 
152, in setup
dist.run_commands()
  File "/usr/local/Cellar/python/2.7.1/lib/python2.7/distutils/dist.py", line 
953, in run_commands
self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.1/lib/python2.7/distutils/dist.py", line 
972, in run_command
cmd_obj.run()
  File 
"/usr/local/Cellar/python/2.7.1/lib/python2.7/distutils/command/upload.py", 
line 60, in run
self.upload_file(command, pyversion, filename)
  File 
"/usr/local/Cellar/python/2.7.1/lib/python2.7/distutils/command/upload.py", 
line 193, in upload_file
msg = '\n'.join(('-' * 75, r.read(), '-' * 75))
NameError: global name 'r' is not defined

--
assignee: tarek
components: Distutils
files: upload-failed.log
messages: 134908
nosy: eric.araujo, offby1, tarek
priority: normal
severity: normal
status: open
title: distutils command 'upload' crashes when --show-response is selected
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file21845/upload-failed.log

___
Python tracker 

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



[issue11971] Wrong parameter -O0 instead of -OO in manpage

2011-05-01 Thread Lars Michelsen

New submission from Lars Michelsen :

Hello Devs,

digging around in the python manpage and playing with the parameters I found a 
wrong parameter specification in the python manpage. The -OO parameter for 
discarding docstrings is written as -O0 (the 2nd is a zero).

A patch is attached.

Regards

--
assignee: docs@python
components: Documentation
files: fix-OO-param.patch
keywords: patch
messages: 134909
nosy: docs@python, lm
priority: normal
severity: normal
status: open
title: Wrong parameter -O0 instead of -OO in manpage
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file21846/fix-OO-param.patch

___
Python tracker 

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



[issue11959] smtpd cannot be used without affecting global state

2011-05-01 Thread Vinay Sajip

Vinay Sajip  added the comment:

I've made a patch. See

https://bitbucket.org/vinay.sajip/cpython-smtpd/compare/default..mirror/cpython

--

___
Python tracker 

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



[issue11972] input does not strip a trailing newline correctly on Windows

2011-05-01 Thread Michal Molhanec

New submission from Michal Molhanec :

input() returns string including trailing '\r'. IMHO the problem is not 
directly in the input() function which just expects that the input string was 
read in text mode so all of the platform specific newlines were normalized into 
single '\n'.

--
components: IO, Library (Lib), Windows
messages: 134911
nosy: Michal.Molhanec
priority: normal
severity: normal
status: open
title: input does not strip a trailing newline correctly on Windows
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



[issue11972] input does not strip a trailing newline correctly on Windows

2011-05-01 Thread Andreas Stührk

Andreas Stührk  added the comment:

See issue #11272.

--
nosy: +Trundle

___
Python tracker 

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



[issue11972] input does not strip a trailing newline correctly on Windows

2011-05-01 Thread Brian Curtin

Brian Curtin  added the comment:

Duplicate of #11642, #11272, and #11278.

This is fixed. It'll be released in 3.2.1

--
nosy: +brian.curtin
resolution:  -> duplicate
stage:  -> committed/rejected

___
Python tracker 

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



[issue11971] Wrong parameter -O0 instead of -OO in manpage

2011-05-01 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d70b0137902b by R David Murray in branch '2.7':
#11971: fix man page; it's -OO not -O0
http://hg.python.org/cpython/rev/d70b0137902b

New changeset c57fdce01eb8 by R David Murray in branch '3.1':
#11971: fix man page; it's -OO not -O0
http://hg.python.org/cpython/rev/c57fdce01eb8

New changeset bbc6129f7861 by R David Murray in branch '3.2':
Merge #11971: fix man page; it's -OO not -O0
http://hg.python.org/cpython/rev/bbc6129f7861

New changeset e2f71bc9b0db by R David Murray in branch 'default':
Merge #11971: fix man page; it's -OO not -O0
http://hg.python.org/cpython/rev/e2f71bc9b0db

--
nosy: +python-dev

___
Python tracker 

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



[issue11971] Wrong parameter -O0 instead of -OO in manpage

2011-05-01 Thread R. David Murray

R. David Murray  added the comment:

Thanks for catching that, and for the patch.

--
nosy: +r.david.murray
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Mark Dickinson

Mark Dickinson  added the comment:

Would you want x >> 2 to be equivalent to x / 4.0 or x // 4.0?

--

___
Python tracker 

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



[issue11967] Left shift and Right shift for floats

2011-05-01 Thread Mark Dickinson

Mark Dickinson  added the comment:

> The only way to do that now is t=frexp(x) and y=ldexp(t[0],t[1]+2).

What's wrong with the more direct ldexp(x, 2)?

N.B.  There *are* edge cases where Martin's suggested alternative won't work.  
E.g., to compute 1e-300 * 2**1500:

>>> ldexp(1e-300, 1500)
3.507466211043404e+151

But:

>>> 1e-300 * (1 << 1500)
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: long int too large to convert to float

I'm -1 on the proposal:  I recognise the need for these operations, but I think 
'ldexp(x, n)' gives an adequate solution.  Fitting the functionality to the << 
and >> operators is awkward, because that's not what those operators do for 
integers (>> produces the *floor* of the quotient, and << doesn't currently 
accept negative arguments on the right, so there's no neat way for integers to 
divide by a power of 2).

See also the rejected issue 1205239.

--

___
Python tracker 

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



[issue11973] kevent does not accept KQ_NOTE_EXIT (and other (f)flags)

2011-05-01 Thread David Naylor

New submission from David Naylor :

kevent does not accept all legitimate parameters, such as KQ_NOTE_EXIT.  

For example:
>> from select import *
>> kevent(0, KQ_FILTER_PROC, KQ_EV_ADD | KQ_EV_ENABLE, KQ_NOTE_EXIT)
OverflowError: signed integer is greater than maximum

While the following C code compiles (under -Wall -pedantic) without error, or 
warning:
"""
#include 
#include 
#include 

int main(int argc, char **argv) {

  struct kevent ke;

  EV_SET(&ke, 0, EVFILT_PROC, EV_ADD | EV_ENABLE, NOTE_EXIT, 0, 0);

  return (0);

}
"""

Looking at the Modules/selectmodule.c file it is clear that the fields "flags" 
and "fflags" are defined as T_USHORT and T_UINT however the flags passed to 
PyArg_ParseTupleAndKeywords are 'h' and 'i' respectively (implying signed 
numbers).  

A workaround exists where values X > (2**31 - 1) are passed as (X - 2**32).  
Also the attached patch fixes the error.

--
components: Extension Modules
files: patch-Modules-selectmodule.c
messages: 134918
nosy: DragonSA
priority: normal
severity: normal
status: open
title: kevent does not accept KQ_NOTE_EXIT (and other (f)flags)
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 
3.3, Python 3.4
Added file: http://bugs.python.org/file21847/patch-Modules-selectmodule.c

___
Python tracker 

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



[issue11974] Class definition gotcha.. should this be documented somewhere?

2011-05-01 Thread Cal Leeming

New submission from Cal Leeming :

So, when you create a class like this:

class Obj:
children = []

The 'children' object essentially becomes shared across all instances of Obj. 
To get around this, you have to use:

class Obj:
children = None
def __init__(self):
children = []

I have attached proof of concept code which can trigger this bug. Although I 
have almost 8 years of experience with Python, this is the first time I have 
actually noticed this, however, I am sure that similar things have happened in 
the past, and I just didn't investigate it enough to realise what was going on.

Although this isn't a bug, it is likely that other advanced developers may also 
not know about, or have been caught out by this little gotcha. So, perhaps it 
might be worth documenting it somewhere?

Let me know your thoughts.

Cal

--
components: Interpreter Core
files: obj.py
messages: 134919
nosy: sleepycal
priority: normal
severity: normal
status: open
title: Class definition gotcha.. should this be documented somewhere?
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file21848/obj.py

___
Python tracker 

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



[issue11973] kevent does not accept KQ_NOTE_EXIT (and other (f)flags)

2011-05-01 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +ned.deily, ronaldoussoren
stage:  -> patch review
versions:  -Python 2.5, Python 2.6, Python 3.4

___
Python tracker 

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



[issue11943] Add TLS-SRP (RFC 5054) support to ssl, _ssl, http, and urllib

2011-05-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks for the patch. Some preliminary comments:

- the OpenSSL functions you are using (SSL_get_srp_username etc.) don't seem 
documented on openssl.org; this makes it harder to do a proper review
- no need to fill Misc/ACKS and Misc/NEWS by yourself, we can take care of that
- what is an "SRP vbase"? is it something standardized, or OpenSSL-specific?
- if server-side support needs a callback, I think it would be better to let 
users write their callback in Python, rather than force a hardwired 
implementation
- ssl.wrap_socket() is the legacy API, I would rather add new features only to 
the SSLContext API

--

___
Python tracker 

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



[issue11965] Simplify context manager in os.popen

2011-05-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Have you seen the comment on top of it? It says "Helper for popen() -- a proxy 
for a file whose close waits for the process".

--
nosy: +pitrou

___
Python tracker 

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



[issue11962] FreeBSD-AMD64 bot sporadic hanging

2011-05-01 Thread Ned Deily

Ned Deily  added the comment:

That might be another instance of this:

   http://thread.gmane.org/gmane.comp.python.devel/123698

You might want to bring this up on python-dev.

--
nosy: +ned.deily

___
Python tracker 

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



[issue11975] Fix intersphinx-ing of built-in types (list, int, ...)

2011-05-01 Thread Jonas H.

New submission from Jonas H. :

Intersphinx-ing of int, list, float, ... should work with ":class:`int`" (list, 
float, ...). Also, intersphinx-ing list methods, e.g. ":meth:`list.insert`", 
should work.

--
assignee: docs@python
components: Documentation
messages: 134923
nosy: docs@python, jonash
priority: normal
severity: normal
status: open
title: Fix intersphinx-ing of built-in types (list, int, ...)

___
Python tracker 

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



[issue11976] Provide proper documentation for list data type

2011-05-01 Thread Jonas H.

New submission from Jonas H. :

Provide a proper `list` method reference (like the one for `dict`, 
http://docs.python.org/library/stdtypes.html#dict).

Right now, documentation about lists is spread over multiple topics (.rst 
files) and methods are documented in footnotes.

Also, intersphinx-ing and list methods is not possible -- :meth:`list.foo` does 
not create any links due to missing documentation. This is also related to 
#11975.

--
assignee: docs@python
components: Documentation
messages: 134924
nosy: docs@python, jonash
priority: normal
severity: normal
status: open
title: Provide proper documentation for list data type

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-05-01 Thread Renaud Blanch

Renaud Blanch  added the comment:

As nick said, the repo only host a patch queue.
the patch itself is visible here:
https://bitbucket.org/rndblnch/cpython-pep380/qseries?apply=t&qs_apply=pep380

Or it can be download here in raw text:
https://bitbucket.org/rndblnch/cpython-pep380/raw/tip/pep380

I have documented how to apply the patch to a cpython clone here:
https://bitbucket.org/rndblnch/cpython-pep380/wiki

--

___
Python tracker 

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



[issue11977] Document int.conjugate, .denominator, ...

2011-05-01 Thread Jonas H.

New submission from Jonas H. :

Various `int` attributes and methods seem undocumented (at least it does not 
work to intersphinx them):

* .conjugate
* .denominator
* .imag
* .numerator
* .real

--
assignee: docs@python
components: Documentation
messages: 134926
nosy: docs@python, jonash
priority: normal
severity: normal
status: open
title: Document int.conjugate, .denominator, ...
versions: Python 2.7

___
Python tracker 

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



[issue11976] Provide proper documentation for list data type

2011-05-01 Thread Georg Brandl

Georg Brandl  added the comment:

I'd go as far and say it is a duplicate. :)

--
nosy: +georg.brandl
resolution:  -> duplicate
status: open -> closed
superseder:  -> Fix intersphinx-ing of built-in types (list, int, ...)

___
Python tracker 

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



[issue11974] Class definition gotcha.. should this be documented somewhere?

2011-05-01 Thread Georg Brandl

Georg Brandl  added the comment:

Reclassifying as documentation issue.  I was certain we had something about 
this in the tutorial, but couldn't find it with a quick look.

It is in the FAQ ("how do I create static class data"), but that's not an 
obvious place to look.

--
assignee:  -> docs@python
components: +Documentation -Interpreter Core
nosy: +docs@python, georg.brandl

___
Python tracker 

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



[issue9756] Crash with custom __getattribute__

2011-05-01 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c5e6f997730e by Victor Stinner in branch '3.1':
Issue #9756: When calling a method descriptor or a slot wrapper descriptor, the
http://hg.python.org/cpython/rev/c5e6f997730e

New changeset 4fc04f6a0731 by Victor Stinner in branch '3.2':
(Merge 3.1) Issue #9756: When calling a method descriptor or a slot wrapper
http://hg.python.org/cpython/rev/4fc04f6a0731

New changeset 8544561b7f04 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #9756: When calling a method descriptor or a slot wrapper
http://hg.python.org/cpython/rev/8544561b7f04

--
nosy: +python-dev

___
Python tracker 

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



[issue9756] Crash with custom __getattribute__

2011-05-01 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 109687cc2c1e by Victor Stinner in branch '2.7':
(Merge 3.1) Issue #9756: When calling a method descriptor or a slot wrapper
http://hg.python.org/cpython/rev/109687cc2c1e

--

___
Python tracker 

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



[issue9756] Crash with custom __getattribute__

2011-05-01 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 0db11682ea45 by Victor Stinner in branch '3.1':
Issue #9756: credit the author, Andreas Stührk (Trundle)
http://hg.python.org/cpython/rev/0db11682ea45

New changeset a17f5c787cc0 by Victor Stinner in branch '3.2':
(Merge 3.1) Issue #9756: credit the author, Andreas Stührk (Trundle)
http://hg.python.org/cpython/rev/a17f5c787cc0

New changeset ba8a8c47de7b by Victor Stinner in branch 'default':
(Merge 3.2) Issue #9756: credit the author, Andreas Stührk (Trundle)
http://hg.python.org/cpython/rev/ba8a8c47de7b

New changeset bc5cd43c8d0c by Victor Stinner in branch '2.7':
(Merge 3.1) Issue #9756: credit the author, Andreas Stührk (Trundle)
http://hg.python.org/cpython/rev/bc5cd43c8d0c

--

___
Python tracker 

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



[issue9756] Crash with custom __getattribute__

2011-05-01 Thread STINNER Victor

STINNER Victor  added the comment:

> Ok, I'm sure that I have hardware issues, but I am also sure that the
> patch introduces random crashes, especially in
> test_descr.test_wrapper_segfault().

Forget my last messages: my Ubuntu box has serious memory issues. memtest86+ 
found 41 errors.

--

I applied Trundle's patch to 2.7, 3.1, 3.2 and 3.3, thanks for the fix.

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



[issue11930] Remove time.accept2dyear

2011-05-01 Thread STINNER Victor

STINNER Victor  added the comment:

Le mardi 26 avril 2011 à 22:20 +, Alexander Belopolsky a écrit :
> Alexander Belopolsky  added the comment:
> 
> On Tue, Apr 26, 2011 at 6:09 PM, STINNER Victor  
> wrote:
> ..
> >
> > timemodule.c:
> >
> > PyDoc_STRVAR(module_doc,
> > "...
> > The tuple items are:\n\
> >  year (four digits, e.g. 1998)\n\
> > ...")
> >
> > => That's wrong. Example: time.gmtime(-5558220).tm_year gives 208.
> 
> This is wrong regardless of this patch.   I don't mind fixing this,
> but it would be a different issue.  Can you suggest a change?  I would
> like the docstring to still inform the user that 1998 should be given
> as 1998 and not as 98.  Maybe s/four/all/?

"year (e.g. 1998)\n" is enough.

--

___
Python tracker 

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



[issue10419] distutils command build_scripts fails with UnicodeDecodeError

2011-05-01 Thread STINNER Victor

STINNER Victor  added the comment:

Hey, I had already this bug and I also wrote a patch: copy_script-2.patch 
attached to #6011. It is very similar to build_scripts-binary_mode.patch (read 
the file in binary mode to avoid the encode/decode dance). But it checks also 
that the path to Python program is decodable from UTF-8 and from the script 
encoding.

Éric Araujo doesn't want to apply copy_script-2.patch on Python 3 before 
distutils2 is ported to Python 3 and included into Python (3.3): read 
msg124648. Five months later: distutils2 is not yet included to Python 3, the 
patch is not commited yet, and we have now a duplicate issue (and 3 patches for 
a single bug) :-)

This situation sucks. How can we move forward? What is the status of 
distutils2? Is it ported to Python3? Is it ready for an inclusion into Python3?

When distutils2 will be part of Python 3.3, should we fix distutils bugs or 
not? I suppose that few people use Python 3.3, maybe because it will not be 
released before August 2012 (PEP 398) :-) So users will continue to have this 
bug until everybody moves to 3.3 (or later)...

I think that we should fix this bug today. I don't really care of distutils2 
today because it is not yet part of Python.

--

___
Python tracker 

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



[issue11361] suggestion for os.kill(pid,CTRL_C_EVENT) in tests

2011-05-01 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, if the process is able to handle CTRL+c on Windows, it means that 
faulthandler.register() could be used on Windows. While developing the 
faulthandler module, I tried all signals but I was only able to handle SIGSEGV, 
SIGABRT, SIGBUS and SIGILL on Windows. And all of these signals are reserved to 
faulthandler.enable() function. So faulthandler.register() is just not compiled 
on Windows.

If SetConsoleCtrlHandler() is really useful, we should maybe add something to 
the signal module to give access to this function.

--

___
Python tracker 

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



[issue10419] distutils command build_scripts fails with UnicodeDecodeError

2011-05-01 Thread Éric Araujo

Éric Araujo  added the comment:

> Apparently setuptools.command.easy_install.get_script_header() imports
> distutils.command.build_scripts.first_line_re and checks if this regex
> matches a str object, which results in TypeError. If breaking
> compatibility is not acceptable, then the surrogateescape patch should
> be applied.

Setuptools is not compatible with 3.x TTBOMK; distribute is, but could
be fixed quickly, so there is no compat problem with this (these)
library(ries).  However, the public/private status of first_line_re is
unclear, so there could be other projects out there depending on its
type.  Given that there is already one patch in distutils that uses
surrogateescape, I think we could accept another similar patch.

--

___
Python tracker 

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



[issue10419] distutils command build_scripts fails with UnicodeDecodeError

2011-05-01 Thread Éric Araujo

Éric Araujo  added the comment:

is not commited yet,
> and we have now a duplicate issue (and 3 patches for a single bug) :-)
Feel free to close duplicate issues.

Looks like you’re not following PyCon reports, or Tarek’s mails to
python-dev.  distutils2 has been ported to 3.3 under the name
“packaging”; there is a repo on bitbucket (tarek/cpython) with this
code.  Tarek will produce a patch from this repo and push it to the main
repository soon.

Yes: we’ll fix bugs in packaging and distutils.  Packaging releases will
be backported for 2.4-3.2 under the name “distutils2”.

--

___
Python tracker 

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



[issue11977] Document int.conjugate, .denominator, ...

2011-05-01 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset dc65d1b99dff by Benjamin Peterson in branch '3.1':
note abcs of int and float (closes #11977)
http://hg.python.org/cpython/rev/dc65d1b99dff

New changeset 5b315145e525 by Benjamin Peterson in branch '2.7':
note abcs of int and float (closes #11977)
http://hg.python.org/cpython/rev/5b315145e525

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



[issue11859] test_interrupted_write_text() of test_io failed of Python 3.3 on FreeBSD 7.2

2011-05-01 Thread STINNER Victor

STINNER Victor  added the comment:

The issue is race condition and was rare (I only saw it once on FreeBSD 7.2 3.x 
buildbot). I suppose that it is fixed, I'm unable to check (I am unable to 
reproduce the bug in my FreeBSD 8 VM). Reopen the issue if it is not fixed yet.

--
dependencies:  -expose signalfd(2) and pthread_sigmask in the signal module
resolution:  -> fixed

___
Python tracker 

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



[issue11927] SMTP_SSL doesn't use port 465 by default

2011-05-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Should we add a unit test for this as well?

True, a simple test could be added to test_smtpnet.

--

___
Python tracker 

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



[issue10922] Unexpected exception when calling function_proxy.__class__.__call__(function_proxy)

2011-05-01 Thread STINNER Victor

STINNER Victor  added the comment:

> I think this is a duplicate of issue #9756

Yes it is and the issue is now fixed. The example now fails with the correct 
exception:

Traceback (most recent call last):
  File " x.py", line 12, in 
p.__class__.__call__(p)
TypeError: descriptor '__call__' requires a 'function' object but received a 
'Proxy'

--
nosy: +haypo
resolution:  -> duplicate
status: open -> closed
superseder:  -> Crash with custom __getattribute__

___
Python tracker 

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



[issue11277] Crash with mmap and sparse files on Mac OS X

2011-05-01 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset cb464f8fb3a1 by Victor Stinner in branch '3.1':
Issue #11277: mmap calls fcntl(fd, F_FULLFSYNC) on Mac OS X to get around a
http://hg.python.org/cpython/rev/cb464f8fb3a1

New changeset e9d298376dde by Victor Stinner in branch '3.2':
(Merge 3.1) Issue #11277: mmap.mmap() calls fcntl(fd, F_FULLFSYNC) on Mac OS X
http://hg.python.org/cpython/rev/e9d298376dde

New changeset d578fdc9b157 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #11277: mmap.mmap() calls fcntl(fd, F_FULLFSYNC) on Mac OS X
http://hg.python.org/cpython/rev/d578fdc9b157

--
nosy: +python-dev

___
Python tracker 

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



[issue8808] imaplib should support SSL contexts

2011-05-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks for the patch. Comments:
- the keyfile / certfile pair and the context parameter should be mutually 
exclusive (see e.g. the POP3_SSL constructor in Lib/poplib.py)
- I don't think the remote test server used in test_imaplib supports client 
certificates, it probably just ignores them; that said, it's better than nothing
- you have a misindented line in test_logincapa
- since we're using a remote, third-party test server, it may be better not to 
do any spurious connects (in the current patch, a first connection is 
established in the setUp() and then ignored since another one is established in 
the test body)
- you need to update the documentation in Doc/library/imaplib.rst

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue11277] Crash with mmap and sparse files on Mac OS X

2011-05-01 Thread STINNER Victor

STINNER Victor  added the comment:

I am not able to check the fix, but the buildbots are :-)

What should be done for Python 2.7? In Python 2.7, zlib.crc32() stores the 
buffer length into an int (so the maximum length is INT_MAX), and so test_zlib 
doesn't test a (sparse) file of 4 GB (ChecksumBigBufferTestCase).

But I suppose that mmap bug can also occur with a file of 2 GB.

@sdaoden: Can you try on Python 2.7?

--

___
Python tracker 

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



[issue11888] Add C99's log2() function to the math library

2011-05-01 Thread STINNER Victor

STINNER Victor  added the comment:

Oh... math.log() has an optional second argument: base. math.log(x, 2). But it 
is equivalent as math.log(x) / math.log(2) in Python. math.log(x, 2) is 
implemented as:
  num=math.log(x)
  den=math.log(2)
  return num / den
where num and den are Python floats (64 bits).

So we don't benefit from 80 bits float used internally in x87.

--

___
Python tracker 

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



[issue6501] Fatal error on startup with invalid PYTHONIOENCODING

2011-05-01 Thread STINNER Victor

STINNER Victor  added the comment:

> Fatal Python error: Py_Initialize: can't initialize sys standard streams
> LookupError: unknown encoding: cp0

That's a bug in os.device_encoding(): os.device_encoding(sys.stdout.fileno()) 
should return None if the application has no console (if sys.stdout is not a 
Windows console stream).

Attached device_encoding.patch should fix this issue. (I didn't test the patch 
yet.)

--
Added file: http://bugs.python.org/file21849/device_encoding.patch

___
Python tracker 

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



[issue6501] Fatal error on startup with invalid PYTHONIOENCODING

2011-05-01 Thread STINNER Victor

STINNER Victor  added the comment:

> On a Western Windows, I suggest
>PYTHONIOENCODING=cp1252:backslashreplace

Why using this very small charset whereas a web server can use UTF-8?

I don't think that using backslashreplace on stdout is a good idea.

> But 
>PYTHONIOENCODING=mbcs
> is also OK, except that characters outside the Windows code
> page will be replaced with '?'

Starting at Python 3.2, you should use mbcs:replace to replace unencodable 
characters by '?'. The strict error handler is now strict: it raises a 
UnicodeEncodeError if a character is not encodable to mbcs.

Note: mbcs is the ANSI code page.

--

Using device_encoding.patch, I suppose that sys.std* streams will use the ANSI 
code page (mbcs, which is the code page 1252 on a Western Windows setup) in 
grahamd's usecase (Python program running in Apache).

--

___
Python tracker 

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



[issue11270] logging: RotatingFileHandler crash when opening the Logfile in an Texteditor

2011-05-01 Thread Vinay Sajip

Vinay Sajip  added the comment:

There have been no widespread reports of rotating file handlers being unusable 
under Windows. This is a Windows limitation that generally needs to be worked 
around, it's not limited to logging applications only.

It's possible to copy a set of rotated files to another location for more 
leisurely examination, though that could also cause failures depending on how 
the files are opened for copying.

If this option is not open to you, you can still use a rotating file handler 
base class, but just reimplement the doRollover() method to implement any other 
strategy you like of dealing with files held open by other processes. This was 
suggested in an earlier response - is there any reason it wouldn't work for you?

--

___
Python tracker 

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



[issue11887] unittest fails on comparing str with bytes if python has the -bb option

2011-05-01 Thread Ezio Melotti

Ezio Melotti  added the comment:

I thought some more about this and I'm -0.5.
The reasons are:
  * the patch introduces code/complexity in _baseAssertEqual and other places, 
using catch_warnings to change and restore the warning filters at every call;
  * this is needed only when Python is run with -b/-bb and that is quite 
uncommon (afaik);
  * even if this is not fixed, a test suite that passes all the tests without 
-b/-bb will most likely pass with -b/-bb[0];
  * if there are failing tests with -b/-bb, it's usually possible to remove the 
-b/-bb and fix them before re-adding -bb[1];

[0]: the only exception I can think of is something like 
self.assertNotEqual(a_string, a_bytestring): this passes without -bb but fails 
with a BytesWarning with -bb. This tests is "wrong" though, because string are 
always not equal to bytestrings, regardless of their values. If one wants to 
make sure that a_string is not a bytestring, the correct way to do it is 
assertNotIsInstance(a_string, bytes).  self.assertEqual(a_string, a_bytestring) 
fails already without -bb so, even if with -bb the traceback is less useful, it 
can/should be fixed without -b/-bb.
To prove this further the whole Python test suite passes with -bb.

[1]: that might indeed not be the case (e.g. with our buildbots is not easy to 
change flags), but I'm still not sure it's worth patching this just to have a 
better traceback in case of a test failure that accidentally involves 
bytes/string comparison on a Python running with -bb on an environment where 
changing the flags is not easy (i.e. a rather obscure corner case).

--

___
Python tracker 

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



[issue11974] Class definition gotcha.. should this be documented somewhere?

2011-05-01 Thread Ezio Melotti

Ezio Melotti  added the comment:

A good place where to add it would be 
http://docs.python.org/tutorial/classes.html.
It might even get a small "Differences between class and instance attribute" 
section.

--
nosy: +ezio.melotti

___
Python tracker 

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