[issue10325] PY_LLONG_MAX & co - preprocessor constants or not?

2010-11-09 Thread Hallvard B Furuseth

Hallvard B Furuseth  added the comment:

No, PY_LLONG_MAX lacks a paren.  Found by the revolutionary method of
actually testing it (made the previous branches #if 0's).
bugs.python.org is not responding, but here's what I'm using now:

Index: Include/pyport.h
===
--- Include/pyport.h(revision 86319)
+++ Include/pyport.h(working copy)
@@ -62,15 +62,20 @@
 #define PY_LLONG_MAX LLONG_MAX
 #define PY_ULLONG_MAX ULLONG_MAX
 #elif defined(__LONG_LONG_MAX__)
-/* Otherwise, if GCC has a builtin define, use that. */
+/* Otherwise, if GCC has a builtin define, use that.  (Definition of
+ * PY_LLONG_MIN assumes two's complement with no trap representation.) */
 #define PY_LLONG_MAX __LONG_LONG_MAX__
-#define PY_LLONG_MIN (-PY_LLONG_MAX-1)
-#define PY_ULLONG_MAX (__LONG_LONG_MAX__*2ULL + 1ULL)
-#else
-/* Otherwise, rely on two's complement. */
-#define PY_ULLONG_MAX (~0ULL)
-#define PY_LLONG_MAX  ((long long)(PY_ULLONG_MAX>>1))
-#define PY_LLONG_MIN (-PY_LLONG_MAX-1)
+#define PY_LLONG_MIN (-PY_LLONG_MAX - 1)
+#define PY_ULLONG_MAX (PY_LLONG_MAX * Py_ULL(2) + 1)
+#elif defined(SIZEOF_LONG_LONG)
+/* Otherwise compute from SIZEOF_LONG_LONG, assuming two's complement, no
+   padding bits, and no trap representation.  Note: PY_ULLONG_MAX was
+   previously #defined as (~0ULL) here; but that'll give the wrong value in a
+   preprocessor expression on systems where long long != intmax_t. */
+#define PY_LLONG_MAX\
+(1 + 2 * ((Py_LL(1) << (CHAR_BIT * SIZEOF_LONG_LONG - 2)) - 1))
+#define PY_LLONG_MIN (-PY_LLONG_MAX - 1)
+#define PY_ULLONG_MAX (PY_LLONG_MAX * Py_ULL(2) + 1)
 #endif /* LLONG_MAX */
 #endif
 #endif /* HAVE_LONG_LONG */

--

___
Python tracker 

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



[issue10312] intcatcher() can deadlock

2010-11-09 Thread Hallvard B Furuseth

Hallvard B Furuseth  added the comment:

Sorry, my patch is useless if the OS calls the handler with the signal
blocked.  It should also unblock the signal before doing anything
which can do FILE* operations.  And set the handler again?  Or just
leave the next signal to abort the process?  I dunno...

Anyway, if you don't do that, just apply the save/restore of errno.
Drop the 'if (errno != save_errno)' before restoring, that bit of
paranoia was turned down in Issue10311.

--

___
Python tracker 

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



[issue10359] ISO C cleanup

2010-11-09 Thread Hallvard B Furuseth

Hallvard B Furuseth  added the comment:

,AIric Araujo writes:
> By the way, do these changes actually fix errors or are they just
> cleanups and pedantic (not a slight) fixes?

I've used compilers where they'd be compile errors, though I found them
just with gcc -pedantic in an idle moment.

> If the latter, I think they won�t go into stable branches.

Not until someone has better time anyway...

About the .zip, it's 3 files (diff against python 3, 2, and both), I'll
upload them as an ascii file with '#'s between when bugs.python.org
responds again.

--

___
Python tracker 

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



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2010-11-09 Thread anatoly techtonik

anatoly techtonik  added the comment:

Fixed docstring.

http://codereview.appspot.com/2874041/diff/2001/cmd.py
File cmd.py (right):

http://codereview.appspot.com/2874041/diff/2001/cmd.py#newcode55
cmd.py:55: :param distutils.dist.Distribution dist: distribution to work
with
On 2010/11/08 18:47:39, merwok wrote:
> > Including this in another patch is too much work to ever happen.
> We’ll have to revert it before committing then.

> > What Python uses?
> Something like “*dist* is an instance of blah”.

I thought Python uses all Sphinx capabilities. Done.

http://codereview.appspot.com/2874041/diff/2001/command/upload.py
File command/upload.py (right):

http://codereview.appspot.com/2874041/diff/2001/command/upload.py#newcode53
command/upload.py:53: if not self.username and
self.distribution.username:
On 2010/11/08 18:47:39, merwok wrote:
> This is a crazy case.

That's why I don't want to make distinction between "None" username and
empty username. They are both the same in this context.

http://codereview.appspot.com/2874041/diff/2001/tests/test_register.py
File tests/test_register.py (right):

http://codereview.appspot.com/2874041/diff/2001/tests/test_register.py#newcode165
tests/test_register.py:165: inputs = RawInputs('1', 'tarek', 'n')
On 2010/11/08 18:47:39, merwok wrote:
> It looks like you’re replying to “username” and “save your login” but
not
> “password”.

That's magically patched in setUp method.

http://codereview.appspot.com/2874041/

--

___
Python tracker 

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



[issue10359] ISO C cleanup

2010-11-09 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Hallvard, if it going be a rather huge diff, you may make it available at 
http://bugs.python.org/review, so that it is easy for review.

--
nosy: +orsenthil

___
Python tracker 

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



[issue10245] Fix resource warnings in test_telnetlib

2010-11-09 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

conn.close() was done in the finally method in r86228 by brian.curtin.
The other change in your patch in very minor space addition after comma. We can 
leave it to place along with some other code change.

--
nosy: +brian.curtin, orsenthil
resolution:  -> invalid
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue10359] ISO C cleanup

2010-11-09 Thread STINNER Victor

STINNER Victor  added the comment:

I commited a part of your patches:

r86353 Remove ";" after function definition, invalid in ISO C
r86354: [array] int => Py_UNICODE (my commit is a little bit different, but it 
is based on your patch)
r86355: [_pickle] Remove useless comma, invalid in ISO C
r86356: [_csv] Remove useless (duplicate) initialization

I attach the uncommit part of your patches for 3.2.

--

For libffi, the project is maintained outside Python: you should also post your 
patch to http://sourceware.org/libffi/

Python-ast.c: why do you move req_name and req_type outside PyAST_obj2mod()?

--
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file19554/iso_c_32.patch

___
Python tracker 

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



[issue10359] ISO C cleanup

2010-11-09 Thread Hallvard B Furuseth

Hallvard B Furuseth  added the comment:

STINNER Victor writes:
> Python-ast.c: why do you move req_name and req_type outside PyAST_obj2mod()?

Because there's no need to initialize the arrays each time PyAST_obj2mod
is called.  C90-friendly code inside PyAST_obj2mod would be

PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
{
mod_ty res;
static char *const req_name[] = {"Module", "Expression", "Interactive"};
PyObject *req_type[];
req_type[0] = (PyObject*)Module_type;
req_type[1] = (PyObject*)Expression_type;
req_type[2] = (PyObject*)Interactive_type;
...
}

which is what the current code actually executes.

(I moved req_name to keep it next to req_type in the code.)

--

___
Python tracker 

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



[issue10359] ISO C cleanup

2010-11-09 Thread Hallvard B Furuseth

Hallvard B Furuseth  added the comment:

Hallvard B Furuseth writes:
> (...) which is what the current code actually executes.

Er, I mean, that's what it does with req_type.
The 'static' for req_name is an optimization of the current code.

--

___
Python tracker 

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



[issue10324] Modules/binascii.c: simplify expressions

2010-11-09 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

At first, I was worried if this simplification would cause any harm to  
readability of the algorithm. Fortunately, it didn't.
Committed in r86357.

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

___
Python tracker 

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



[issue10372] [REGRESSION] test_gc fails on Mac OSX 10.6

2010-11-09 Thread Ismail Donmez

New submission from Ismail Donmez :

py3k r86351,


==
FAIL: test_garbage_at_shutdown (__main__.GCTests)
--
Traceback (most recent call last):
  File "./Lib/test/test_gc.py", line 500, in test_garbage_at_shutdown
b"shutdown; use", stderr)
AssertionError: b'ResourceWarning: gc: 2 uncollectable objects at shutdown; 
use' not found in b''

--
Ran 28 tests in 0.226s

FAILED (failures=1)
restoring automatic collection
Traceback (most recent call last):
  File "./Lib/test/test_gc.py", line 682, in 
test_main()
  File "./Lib/test/test_gc.py", line 669, in test_main
run_unittest(GCTests, GCTogglingTests)
  File "/Users/cartman/Sources/py3k/Lib/test/support.py", line 1141, in 
run_unittest
_run_suite(suite)
  File "/Users/cartman/Sources/py3k/Lib/test/support.py", line 1124, in 
_run_suite
raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "./Lib/test/test_gc.py", line 500, in test_garbage_at_shutdown
b"shutdown; use", stderr)
AssertionError: b'ResourceWarning: gc: 2 uncollectable objects at shutdown; 
use' not found in b''

--
components: Tests
messages: 120854
nosy: cartman
priority: normal
severity: normal
status: open
title: [REGRESSION] test_gc fails on Mac OSX 10.6
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



[issue10351] Add autocompletion for keys in dictionaries

2010-11-09 Thread Valery Khamenya

Valery Khamenya  added the comment:

Hi Éric, thanks for guiding. 

So, attached is the concatenation of two forward unified diffs for 
rlcompleter.py and test_rlcompleter.py -- both as of py3k trunk. Tested against 
Python 3.1.2 though.

P.S. hm, py3k code appeared to be surprisingly nicer -- no unicode troubles and 
work-arounds at all...

regards
Valery

--
assignee:  -> d...@python
components: +Documentation
keywords: +patch
nosy: +d...@python
Added file: http://bugs.python.org/file19555/patch.diff

___
Python tracker 

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



[issue10363] Embedded python, handle (memory) leak

2010-11-09 Thread Stefan Krah

Stefan Krah  added the comment:

I don't see a file attached. Could you attach your patches in plain text?
It is the preferred method, since files can be easily viewed in the browser.

--
nosy: +skrah

___
Python tracker 

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



[issue9873] urllib.parse: Allow bytes in some APIs that use string literals internally

2010-11-09 Thread Hallvard B Furuseth

Hallvard B Furuseth  added the comment:

urlunparse(url or params = bytes object) produces a result
with the repr of the bytes object if params is set.

urllib.parse.urlunparse(['http', 'host', '/dir', b'params', '', ''])
--> "http://host/dir;b'params'"

That's confusing since urllib/parse.py goes to a lot of trouble to
support both bytes and str.  Simplest fix is to only accept str:

Index: Lib/urllib/parse.py
@@ -219,5 +219,5 @@ def urlunparse(components):
 scheme, netloc, url, params, query, fragment = components
 if params:
-url = "%s;%s" % (url, params)
+url = ';'.join((url, params))
 return urlunsplit((scheme, netloc, url, query, fragment))
 
Some people at comp.lang.python tell me code shouldn't anyway do str()
just in case it is needed like urllib does, not that I can make much
sense of that discussion.  (Subject: harmful str(bytes)).

BTW, the str vs bytes code doesn't have to be quite as painful as in
urllib.parse.  Here is a patch which just rearranges and factors out
some code.
   http://bugs.python.org/file19525/parse.diff

--
nosy: +hfuru

___
Python tracker 

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



[issue10369] tarfile requires an actual file on disc; a file-like object is insufficient

2010-11-09 Thread Lars Gustäbel

Lars Gustäbel  added the comment:

Hm, why don't you just do this:

with stat_tarfile.open(fileobj = sys.stdout, mode = "w|") as tar:
for number in xrange(100):
fileobj = generate_file_content(number)
tarinfo = tar.gettarinfo(fileobj=open("/etc/passwd")) 
tarinfo.name = 'file-%d.txt' % number
tarinfo.size = len(str(number)) * 100
tarinfo.uid = 1000
tarinfo.gid = 1000
tarinfo.uname = "dstromberg"
tarinfo.gname = "dstromberg"
tar.addfile(tarinfo, fileobj)

Wouldn't that work, too? Or am I missing something?

--
assignee:  -> lars.gustaebel
nosy: +lars.gustaebel

___
Python tracker 

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



[issue9857] SkipTest in tearDown is reported an as an error

2010-11-09 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue9709] test_distutils warning: initfunc exported twice on Windows

2010-11-09 Thread Stefan Krah

Stefan Krah  added the comment:

This is the history of the issue:

In r16757 the current version of get_export_symbols() was added to
distutils. This function adds /EXPORT initfunc to the command line.

In 27697 PyMODINIT_FUNC was defined as __declspec(dllexport) void.


I'd suggest to remove get_export_symbols(). This would only affect
extensions that do not use PyMODINIT_FUNC, but that can be easily
repaired.

--
keywords: +patch
nosy: +loewis, mhammond
Added file: http://bugs.python.org/file19556/initfunc.patch

___
Python tracker 

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



[issue10361] Fix issue 9995 - distutils forces developers to store password in cleartext (issue2874041)

2010-11-09 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Looks good to me:
the upload command will get the credentials from the session instead of using 
the existing config at all.

I remember that we changed the behavior to you'd had to set ONLY the user in 
the rc file, but allowing to pass the user is better since it make the config 
file optional

--
components: +Demos and Tools
nosy: +tarek

___
Python tracker 

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



[issue7061] Improve turtle module documentation

2010-11-09 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Added file: http://bugs.python.org/file19558/turtle-star.png

___
Python tracker 

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



[issue7061] Improve turtle module documentation

2010-11-09 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Added file: http://bugs.python.org/file19559/turtle-sidebar-screenshot.png

___
Python tracker 

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



[issue10359] ISO C cleanup

2010-11-09 Thread Éric Araujo

Éric Araujo  added the comment:

> I've used compilers where they'd be compile errors, though I found
> them just with gcc -pedantic in an idle moment.

If Victor accepts the patches then they’re useful :)

>> If the latter, I think they won’t go into stable branches.
> Not until someone has better time anyway...

It’s not a question of time but policy: Stable branches (2.7 and 3.1) only get 
bug fixes, not new features or code cleanups.

> About the .zip, it's 3 files (diff against python 3, 2, and both),
> I'll upload them as an ascii file with '#'s between

It’s actually easier: “svn diff file1 dir/file2 dir/file3” produces one valid 
diff.

--

___
Python tracker 

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



[issue10363] Embedded python, handle (memory) leak

2010-11-09 Thread Martin Dunschen

Martin Dunschen  added the comment:

Here my suggested changes in plain text (I generated these as patches from a 
diff to the current code):

thread.c:
353a354,359
> void PyThread_fini()
> {
>   // should assert here that nkeys == 0
>   PyThread_free_lock(keymutex);
> }
> 


pystate.c:
38a39
> #define HEAD_RELEASE() PyThread_free_lock(head_mutex);
48a50
> #define HEAD_RELEASE() /* Nothing */
140a143
>   HEAD_RELEASE();
422a426,427
> void PyThread_fini(); // forward
> 
428c433,434
<   autoInterpreterState = NULL;;
---
>   autoInterpreterState = NULL;
> PyThread_fini(); // this frees a lock called keymutex in thread.c


import.c
473a474,475
> 
>   PyThread_free_lock(import_lock);

--

___
Python tracker 

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



[issue10374] setup.py caches outdated scripts in the build tree

2010-11-09 Thread Geoffrey Bache

New submission from Geoffrey Bache :

I have the following setup.py script:

#!/usr/bin/env python
from distutils.core import setup

scripts=["hello.py"]

setup(scripts=scripts)

I have two different python installations (using virtualenv) where I
wish to install this program. So I do

~/tmp/test_setup/python1/bin/python setup.py install

which creates a file at
/users/geoff/tmp/test_setup/python1/bin/hello.py, that looks like
this:

#!/users/geoff/tmp/test_setup/python1/bin/python

print "Hello"

So far so good. But then I also install it somewhere else:

~/tmp/test_setup/python2/bin/python setup.py install

which creates a file at
/users/geoff/tmp/test_setup/python2/bin/hello.py which refers to
"python1", i..e it has the same contents as the first one. Which is
clearly not what I want.

The cached script in the build tree appears not to get updated once it exists.

--
assignee: tarek
components: Distutils
messages: 120864
nosy: eric.araujo, gjb1002, tarek
priority: normal
severity: normal
status: open
title: setup.py caches outdated scripts in the build tree
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue10373] Setup Script example incorrect

2010-11-09 Thread Kirk Clendinning

New submission from Kirk Clendinning :

In 2.7. Installing Additional Files the example shows:

setup(...,
  data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']),
  ('config', ['cfg/data.cfg']),
  ('/etc/init.d', ['init-script'])]
 )

However, running easy_install with setuptools results in a error:

Setup script exited with error: SandboxViolation: 
open('/etc/init.d/init-script', 'wb') {}

Perhaps the documentation should be changed and more explanation added.

--
assignee: d...@python
components: Documentation
messages: 120863
nosy: d...@python, lensart
priority: normal
severity: normal
status: open
title: Setup Script example incorrect
type: behavior
versions: Python 2.5

___
Python tracker 

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



[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-09 Thread Hallvard B Furuseth

Hallvard B Furuseth  added the comment:

Hi, I'm back...  I've been reading your last message a few times
and I'm not sure what I'm to reconsider.  We've had a way of
talking past each toerh before, as far as I can remember.

I think my request still now translates to:

- keep the current behavior by default,
- add some option which does not translate certain code blocks,
- these code blocks could be the syntax we've already discussed,
  or something else.

--

___
Python tracker 

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



[issue7061] Improve turtle module documentation

2010-11-09 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I like it!

--

___
Python tracker 

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



[issue10375] 2to3 print(single argument)

2010-11-09 Thread Hallvard B Furuseth

New submission from Hallvard B Furuseth :

Could 2to3 without -p notice more cases of print(single argument),
to avoid slapping another () around them?  For example:

  print(2*3)
  print(", ".join(dir))
  print(very + long
+ single + argument)

My internal bug detector zooms in on ((foo)) when I read Python code -
I'm seeing code where something was apparently left out, maybe an inner
comma to make it a tuple.

[Copied from Issue10070.]

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 120866
nosy: hfuru
priority: normal
severity: normal
status: open
title: 2to3 print(single argument)
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue7061] Improve turtle module documentation

2010-11-09 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

As a follow-up to Raymond's suggestion, I am attaching a patch that will add a 
sidebar to the introduction section of the turtle documentation section.  While 
it is not common to include screenshots in python documentation, I think it is 
very appropriate for a visual module such as turtle.  I considered a "Basic 
example" subsection similar to that in unittest module documentation, but 
turtle introduction already has a basic example (forward(15); left(25) embedded 
in the prose, so I think a sidebar like this is more appropriate. 

Since svn does not include binary files in the patch, I will have to attach the 
embedded image separately.  I will also post a screenshot of the rendered HTML 
page.

--
Added file: http://bugs.python.org/file19557/turtle-star-sidebar.diff

___
Python tracker 

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



[issue960325] "--require " option for configure/make (fail if building not possible)

2010-11-09 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Yes, this could be reopened with a patch. Someone else would have to judge its 
usefulness and acceptability. So no guarantees.

--

___
Python tracker 

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



[issue960325] "--require " option for configure/make (fail if building not possible)

2010-11-09 Thread Hallvard B Furuseth

Hallvard B Furuseth  added the comment:

Just for the record, I think you read this a bit too fast before
closing:

Terry J. Reedy writes:
> I am closing this as some combination of wrong, inapplicable,
> out-of-date, and postponed.
> 
> 1. (...) For bz2, there is "This module provides a
> comprehensive interface for the bz2 compression library." If the library
> is not there, then the module obviously cannot function.

The point of the request was to move that error from runtime to compile
time.  As a configuration option, not by default, since as you say:

> 2. I think the current default build process is right for most users.

Indeed.

> 4. This seems to have become pretty much a non-issue. The OP says he has
> no further concrete interest because "It's been a while since I had a
> computer without these libraries...". I am suspecting this is pretty
> much true for everyone who might otherwise care enough to provide a
> patch.

Half right - actually I _would_ still prefer that bit of safety, but
OTOH I probably won't be providing a patch anytime soon.  (Still, I can
always reopen the issue if I do write one.)

--
title: "--require " option for configure/make  (fail if building not 
possible) -> "--require " option for configure/make (fail if building 
not possible)

___
Python tracker 

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



[issue8315] ./python -m unittest test.test_importlib doesn't work

2010-11-09 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue10376] ZipFile unzip is unbuffered

2010-11-09 Thread James Hutchison

New submission from James Hutchison :

The Unzip module is always unbuffered (tested v.3.1.2 Windows XP, 32-bit). This 
means that if one has to do many small reads it is a lot slower than reading a 
chunk of data to a buffer and then reading from that buffer. It seems logical 
that the unzip module should default to buffered reading and/or have a buffered 
argument. Likewise, the documentation should clarify that there is no buffering 
involved when doing a read, which runs contrary to the default behavior of a 
normal read.

start Zipfile read
done
27432 reads done
took 0.859 seconds
start buffered Zipfile read
done
27432 reads done
took 0.072 seconds
start normal read (default buffer)
done
27432 reads done
took 0.139 seconds
start buffered normal read
done
27432
took 0.137 seconds

--
assignee: d...@python
components: Documentation, IO, Library (Lib)
messages: 120871
nosy: Jimbofbx, d...@python
priority: normal
severity: normal
status: open
title: ZipFile unzip is unbuffered
type: performance
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1

___
Python tracker 

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



[issue7061] Improve turtle module documentation

2010-11-09 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Sat, Oct 30, 2010 at 8:27 PM, Terry J. Reedy  wrote:
..
> Sections about 2.x changes should not be in 3.x docs.

I agree.  Neither "Changes since Python 2.6" nor "Changes since Python 2.6" 
belong in this section.  The first belongs to "What's new in Python 2.7" and 
the second to "What's new in Python 3.1".  Do we edit these files 
retroactively?  I don't want to simply remove these sections.  Raymond, can you 
advise?

On a similar note, I don't think the introduction section should refer to "the 
old turtle module".

--

___
Python tracker 

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



[issue10376] ZipFile unzip is unbuffered

2010-11-09 Thread James Hutchison

James Hutchison  added the comment:

I should clarify that this is the zipfile constructor I am using:

zipfile.ZipFile(filename, mode='r', allowZip64=True);

--

___
Python tracker 

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



[issue9995] "setup.py register sdist upload" requires pass to be saved

2010-11-09 Thread anatoly techtonik

anatoly techtonik  added the comment:

Eric, interested parties will not fill CVE or DSA requests. They will just 
steal the pass of PyPI uploaders and use it to inject malicious code into 
popular packages.

If you need a CVE or DSA to evaluate if an issue imposes a security risk, then 
better leave this task to somebody else.

--
type: behavior -> security

___
Python tracker 

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



[issue9995] "setup.py register sdist upload" requires pass to be saved

2010-11-09 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Please stop changing this flag. If you want to have a more secure PyPI 
transaction, you should first send a feature request on Catalog-SIG so 
pypi.python.org forces https.

--

___
Python tracker 

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



[issue10372] [REGRESSION] test_gc fails in non-debug mode.

2010-11-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

For some reason, this starts happening with the Lib/tokenize.py change in 
r86346. Resource warnings don't get enabled by -Wd:

With r86345:
$ ./python -Wd -c "open('LICENSE')"
-c:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='LICENSE' 
encoding='UTF-8'>

With r86346:
$ ./python -Wd -c "open('LICENSE')"

But enabling warnings programmatically still works:

$ ./python -c "import warnings; warnings.simplefilter('default'); 
open('LICENSE')"
-c:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='LICENSE' 
encoding='UTF-8'>

--
assignee:  -> haypo
components: +Library (Lib)
nosy: +georg.brandl, haypo, pitrou
priority: normal -> high
stage:  -> needs patch
title: [REGRESSION] test_gc fails on Mac OSX 10.6 -> [REGRESSION] test_gc fails 
in non-debug mode.

___
Python tracker 

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



[issue9995] "setup.py register sdist upload" requires pass to be saved

2010-11-09 Thread Brian Curtin

Changes by Brian Curtin :


--
type: security -> behavior

___
Python tracker 

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



[issue10374] setup.py caches outdated scripts in the build tree

2010-11-09 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

As described in distutils-SIG, we need to work on a clever way to update the 
build tree.

For Distutils1, removing it completely (possibly via the clean command) is what 
people can do.

--
components: +Distutils2 -Distutils
type: behavior -> feature request

___
Python tracker 

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



[issue10372] [REGRESSION] test_gc fails in non-debug mode.

2010-11-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Weirdly, this patch fixes the issue, but I'm unable to say why:


diff -r cd1de1ff2657 Lib/tokenize.py
--- a/Lib/tokenize.py   Tue Nov 09 02:08:59 2010 +0100
+++ b/Lib/tokenize.py   Tue Nov 09 17:16:21 2010 +0100
@@ -24,12 +24,12 @@ __author__ = 'Ka-Ping Yee 
 __credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '
'Skip Montanaro, Raymond Hettinger, Trent Nelson, '
'Michael Foord')
+import io
 import re
 import sys
 from token import *
 from codecs import lookup, BOM_UTF8
 import collections
-from io import TextIOWrapper
 cookie_re = re.compile("coding[:=]\s*([-\w.]+)")
 
 import token
@@ -336,16 +336,14 @@ def detect_encoding(readline):
 return default, [first, second]
 
 
-_builtin_open = open
-
 def open(filename):
 """Open a file in read only mode using the encoding detected by
 detect_encoding().
 """
-buffer = _builtin_open(filename, 'rb')
+buffer = io.open(filename, 'rb')
 encoding, lines = detect_encoding(buffer.readline)
 buffer.seek(0)
-text = TextIOWrapper(buffer, encoding, line_buffering=True)
+text = io.TextIOWrapper(buffer, encoding, line_buffering=True)
 text.mode = 'r'
 return text

--

___
Python tracker 

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



[issue10372] [REGRESSION] test_gc fails in non-debug mode.

2010-11-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

One observation is that when the -W option is used, the "warnings" module gets 
loaded very early and itself imports linecache which then imports tokenize. At 
this point, the standard IO streams have not been initialized (_io is imported 
later) and the builtin "open" may not exist at all. So when tokenize references 
"open", it is a NameError at that point (which explains why the "weird fix" 
above is actually correct).

As an additional annoyance, when importing Lib/warnings.py fails (for example 
if you sneak in a "1/0" at the beginning of the file), the exception gets 
silenced: the NameError above doesn't get printed.

--
nosy: +benjamin.peterson, brett.cannon

___
Python tracker 

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



[issue7061] Improve turtle module documentation

2010-11-09 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

The mini change log is harmless.  I would leave it as is.

--

___
Python tracker 

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



[issue10318] "make altinstall" installs many files with incorrect shebangs

2010-11-09 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I would like to add my +1 to Eric's msg120485 above.  What I really find 
puzzling is why some scripts in Tools/ have hashbangs, but don't have execute 
permission.

Tools/scripts/cleanfuture.py
Tools/scripts/combinerefs.py
Tools/scripts/db2pickle.py
Tools/scripts/find_recursionlimit.py
Tools/scripts/md5sum.py
Tools/scripts/pickle2db.py
Tools/scripts/pysource.py
Tools/scripts/svneol.py

I suggest a simple rule: no execute bit set in permissions - no hashbang line.

And I don't think stdlib modules should have execute bit:

-rwxr-xr-x Lib/base64.py
-rwxr-xr-x Lib/cProfile.py
-rwxr-xr-x Lib/cgi.py
-rwxr-xr-x Lib/keyword.py
-rwxr-xr-x Lib/pdb.py
-rwxr-xr-x Lib/platform.py
-rwxr-xr-x Lib/profile.py
-rwxr-xr-x Lib/pydoc.py
-rwxr-xr-x Lib/quopri.py
-rwxr-xr-x Lib/smtpd.py
-rwxr-xr-x Lib/smtplib.py
-rwxr-xr-x Lib/symbol.py
-rwxr-xr-x Lib/tabnanny.py
-rwxr-xr-x Lib/token.py
-rwxr-xr-x Lib/uu.py

-rwxr-xr-x Lib/test/pystone.py
-rwxr-xr-x Lib/test/re_tests.py
-rwxr-xr-x Lib/test/regrtest.py
-rwxr-xr-x Lib/test/test_array.py
-rwxr-xr-x Lib/test/test_binhex.py
-rwxr-xr-x Lib/test/test_dbm_gnu.py
-rwxr-xr-x Lib/test/test_dbm_ndbm.py
-rwxr-xr-x Lib/test/test_errno.py
-rwxr-xr-x Lib/test/test_userstring.py

--
nosy: +belopolsky

___
Python tracker 

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



[issue7061] Improve turtle module documentation

2010-11-09 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Tue, Nov 9, 2010 at 11:45 AM, Raymond Hettinger
 wrote:
..
> Raymond Hettinger  added the comment:
>
> The mini change log is harmless.  I would leave it as is.

It is not entirely harmless.  First, it occupies valuable easy to
scroll to end-of-page real estate which is better used for the "Demo
scripts" section.  Second, "Changes since 3.0" in 3.2 documentation
without  "Changes since 3.1" give a feel of unmaintained module.
Third, "Changes since 3.0" refers to the Demo directory which no
longer exists and I don't want to add "Changes since 3.1" to fix that.
 However, I don't feel too strongly about removing them.  I would
leave this for the "What's new" editor to decide and if that's
Raymond, I guess the decision has been made.

--

___
Python tracker 

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



[issue10371] Deprecate trace module undocumented API

2010-11-09 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy: +brett.cannon, eli.bendersky, terry.reedy

___
Python tracker 

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



[issue10329] trace.py and unicode in Python 3

2010-11-09 Thread Walter Dörwald

Walter Dörwald  added the comment:

> STINNER Victor  added the comment:
> 
>> ... it complicates handling of the output of trace.py. 
>> For each file you have to do the encoding detection dance again ...
> 
> What? You just have to call one function! tokenize.open() :-) Well, ok, 
> it's not commited yet, but it looks like most people agree: #10335.

The problem is that the script that downloads and builds the Python
source and generates the HTML for http://coverage.livinglogic.de/ isn't
ported to Python 3 yet (and can't be ported easily). However *running*
the test suite of course uses the current Python checkout, so an option
that lets me specify which encoding trace.py/regrtest.py should output
would be helpful.

--

___
Python tracker 

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



[issue10372] [REGRESSION] test_gc fails in non-debug mode.

2010-11-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch. It moves warnings initialization after io initialization (the 
latter being arguably more critical than the former). Also adds two tests.

--
assignee: haypo -> 
keywords: +patch
stage: needs patch -> patch review
versions: +Python 2.7, Python 3.1
Added file: http://bugs.python.org/file19560/warnboot.patch

___
Python tracker 

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



[issue7061] Improve turtle module documentation

2010-11-09 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

To me, the mini change logs are both distracting noise and contrary to the 
general start-fresh policy for 3.x docs, stated somewhere by Georg B, which I 
really like.

--

___
Python tracker 

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



[issue10371] Deprecate trace module undocumented API

2010-11-09 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Looks good in a cursory reading. I presume trace test still passes.

If you change the signature of the renamed functions, that would break the 
current wrappings. Would you use new private functions with different names, or 
change the wrappings where possible?

--

___
Python tracker 

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



[issue10372] [REGRESSION] test_gc fails in non-debug mode.

2010-11-09 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, I also wrote a patch for the warnings error silently ignored: 
import_warnings_error.patch.

--
Added file: http://bugs.python.org/file19561/import_warnings_error.patch

___
Python tracker 

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



[issue7061] Improve turtle module documentation

2010-11-09 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Committed a slightly modified turtle-star-sidebar.diff in revision 86364.  Note 
that I've included both pdf and postscript files in case someone would want to 
run postscript through a better distiller than the OSX preview that I used.  
The postscript was produced using postscript() method of the tkinter canvas and 
bbox was manually adjusted.

--

___
Python tracker 

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



[issue1926] NNTPS support in nntplib

2010-11-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I have committed the patch in r86365, and I've made usenetrc False by default 
in r86366. Thanks for contributing!

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



[issue10377] cProfile incorrectly labels its output

2010-11-09 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone :

Consider this transcript:

>>> cProfile.run("import time; time.sleep(1)")
 4 function calls in 1.012 CPU seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
10.0110.0111.0121.012 :1()
10.0000.0001.0121.012 {built-in method exec}
11.0011.0011.0011.001 {built-in method sleep}
10.0000.0000.0000.000 {method 'disable' of 
'_lsprof.Profiler' objects}


>>> 

It is not the case that the profiled code uses >1 CPU seconds.  It spends the 
entire time sleeping.  The default timer for cProfile is a wallclock timer.  
The output should reflect this.

--
messages: 120890
nosy: exarkun
priority: normal
severity: normal
status: open
title: cProfile incorrectly labels its output
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue10367] "python setup.py sdist upload --show-response" can fail with "UnboundLocalError: local variable 'result' referenced before assignment"

2010-11-09 Thread Phillip J. Eby

Phillip J. Eby  added the comment:

To better show what the problem is, here's a change that would fix the problem 
(albeit in an ugly way):

--- upload.py   2010-07-07 20:16:33.0 -0400
+++ /home/pje/upload.new2010-11-09 14:30:21.0 -0500
@@ -167,6 +167,9 @@
 
 request = Request(self.repository, data=body,
   headers=headers)
+
+result = None
+
 # send the data
 try:
 result = urlopen(request)
@@ -186,4 +189,4 @@
 self.announce('Upload failed (%s): %s' % (status, reason),
   log.ERROR)
 if self.show_response:
-self.announce('-'*75, result.read(), '-'*75)
+self.announce('-'*75, result.read() if result is not None else 
'ERROR', '-'*75)

--
nosy: +pje
resolution: duplicate -> 
stage: committed/rejected -> needs patch
status: closed -> open

___
Python tracker 

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



[issue10370] py3 readlines() reports wrong offset for UnicodeDecodeError

2010-11-09 Thread Brian Warner

Brian Warner  added the comment:

> Use .readline() to locate an invalid byte is not the right algorithm. If
> you would like to do that, you should open the file in binary mode and
> decodes the content yourself, chunk by chunk. Or if you manipulate small
> files, you can use .read() as you wrote.

Oh, I agree that readline() is inappropriate as a validation tool. My
specific complaint is that the error message is misleading. I hit a message
like this:

 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 26: 
ordinal not in range(128)

and wanted to know if the file was UTF-8, or latin-1, or some other encoding,
so I wanted to see that 0xe2 in context. The message said to look at offset
26, but the actual problem might be at 4122, or 8218, etc. It took me several
minutes (and hexdump and grepping for ' e2 ') to find the character and
figure out what was going on.

Perhaps, if the error message cannot report a correct offset, then it
shouldn't be reporting an offset at all.

--

___
Python tracker 

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



[issue10370] py3 readlines() reports wrong offset for UnicodeDecodeError

2010-11-09 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue10367] "python setup.py sdist upload --show-response" can fail with "UnboundLocalError: local variable 'result' referenced before assignment"

2010-11-09 Thread Phillip J. Eby

Phillip J. Eby  added the comment:

Btw, a quick review of the 3.x trunk code for this shows that it does *not* 
have this problem; this is specific to 2.7 and AFAICT *only* 2.7.

(This problem was introduced in r73436, btw, as of the move to urllib2 vs. 
httplib.)

--

___
Python tracker 

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



[issue9199] distutils upload command crashes when displaying server response

2010-11-09 Thread Phillip J. Eby

Phillip J. Eby  added the comment:

Confirmed - issue10367 is not a dupe.  This bug was that a *successful* upload 
would crash; issue10367 occurs only in the HTTPError case, and isn't fixed by 
this issue's patch.  Reclosing this and reopening 10367.

--
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue10070] 2to3 wishes for already-2to3'ed files

2010-11-09 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

And I still don't understand the rationale for this request. Can you please 
post an example Python module that has this markup you are asking for, so I can 
show you how to achieve what you want without the markup?

--

___
Python tracker 

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



[issue1926] NNTPS support in nntplib

2010-11-09 Thread Andrew Vant

Andrew Vant  added the comment:

On 9 Nov 2010 at 18:59, Antoine Pitrou wrote:
> I have committed the patch in r86365, and I've made usenetrc 
> False by default in r86366. Thanks for contributing!

Woot. I thank you. 

Regarding usenetrc, the NNTP.login and NNTP.starttls documentation 
assumed it was true by default (correct when I wrote it) and 
mentioned it had to be forced false for starttls to work in some 
cases. 

I'm glad that's not the case anymore but the documentation as I wrote 
it is wrong now. :-) 

--

Andrew

--

___
Python tracker 

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



[issue10022] Emit more information in decoded SSL certificates

2010-11-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Fixed in r86369.

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

___
Python tracker 

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



[issue7978] SocketServer doesn't handle syscall interruption

2010-11-09 Thread Vetoshkin Nikita

Vetoshkin Nikita  added the comment:

Any news on this? Could we possibly apply patch as is? If I'm not mistaken 
timeout issue is the only one left unresolved.

About timeout. The most elegant way, would be to use select's syscall timeout 
parameter, but man 2 select says: "On  Linux,  select()  modifies  timeout to 
reflect the amount of time not slept; most other implementations do not do 
this. (POSIX.1-2001 permits either behavior.)  This causes problems both when 
Linux code which reads timeout is ported to other operating systems, and when 
code is ported to Linux that reuses a struct timeval for  multiple select()s in 
a loop without reinitializing it. Consider timeout to be undefined after 
select() returns."

I'm ready to adapt Yaniv's patch to 2.7

--

___
Python tracker 

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



[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input

2010-11-09 Thread Vetoshkin Nikita

Vetoshkin Nikita  added the comment:

Confirming that issue is present in latest svn checkout and Ralf's fix helps.

--
nosy: +nvetoshkin

___
Python tracker 

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



[issue10378] Typo in results of help(divmod)

2010-11-09 Thread Richard Fuhr

New submission from Richard Fuhr :

When running Python 2.7 if you invoke 

help(divmod)

the first line of the resulting help displays

Help on built-in function divmod in module __builtin__:

but I believe that the name of the module is __builtins__

so the line should say

Help on built-in function divmod in module __builtinsq__:

--
assignee: d...@python
components: Documentation
messages: 120900
nosy: d...@python, rdfuhr
priority: normal
severity: normal
status: open
title: Typo in results of help(divmod)
type: behavior
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



[issue10378] Typo in results of help(divmod)

2010-11-09 Thread Richard Fuhr

Richard Fuhr  added the comment:

I had a typo in my own bug report that was reporting a typo; what I intended to 
say was the following ( the q should not have been there at the end )

When running Python 2.7 if you invoke 

help(divmod)

the first line of the resulting help displays

Help on built-in function divmod in module __builtin__:

but I believe that the name of the module is __builtins__

so the line should say

Help on built-in function divmod in module __builtins__:

--

___
Python tracker 

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



[issue4471] IMAP4 missing support for starttls

2010-11-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I've committed some of the remote tests in r86380, which also helped me fix a 
bug in login() in 3.x.

--
nosy: +pitrou

___
Python tracker 

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



[issue4471] IMAP4 missing support for starttls

2010-11-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The shutdown change was committed in r86383.

--

___
Python tracker 

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



[issue4471] IMAP4 missing support for starttls

2010-11-09 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is an updated STARTTLS patch for py3k.

--
stage:  -> patch review
type:  -> feature request
versions: +Python 3.2 -Python 2.6
Added file: http://bugs.python.org/file19562/imaptls.patch

___
Python tracker 

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



[issue10379] locale.format() input regression

2010-11-09 Thread Barry A. Warsaw

New submission from Barry A. Warsaw :

@mission[~:1001]% python2.7 -c "import locale; print locale.format('%.0f KB', 
100)"
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/locale.py", line 189, in format
"format specifier, %s not valid") % repr(percent))
ValueError: format() must be given exactly one %char format specifier, '%.0f 
KB' not valid
@mission[~:1002]% python2.6 -c "import locale; print locale.format('%.0f KB', 
100)"
100 KB

--
messages: 120905
nosy: barry
priority: normal
severity: normal
status: open
title: locale.format() input regression
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



[issue10378] Typo in results of help(divmod)

2010-11-09 Thread Andreas Stührk

Andreas Stührk  added the comment:

__builtin__ is the correct name for the module (see 
http://docs.python.org/library/__builtin__.html, especially the note at the end 
which is the cause of the confusion), hence this is not a bug.

--
nosy: +Trundle

___
Python tracker 

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



[issue10351] Add autocompletion for keys in dictionaries

2010-11-09 Thread Andreas Stührk

Changes by Andreas Stührk :


--
nosy: +Trundle

___
Python tracker 

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



[issue10378] Typo in results of help(divmod)

2010-11-09 Thread Benjamin Peterson

Changes by Benjamin Peterson :


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

___
Python tracker 

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



[issue10379] locale.format() input regression

2010-11-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

This was changed by issue2522 on purpose; no suffix is allowed in 
locale.format().

--
nosy: +amaury.forgeotdarc, r.david.murray

___
Python tracker 

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



[issue10379] locale.format() input regression

2010-11-09 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Okay, so line 187 of locale.py has this test:

if not match or len(match.group())!= len(percent):

the problematic part is the len test.  When format string is '%.0f KB' 
match.group() is '%.0f' but of course percent is the full string.

This seems like a bogus test, since clearly the given input is a valid format 
string.  I'm not sure what the intent of this test is.  The Python 2.6 test is:

if percent[0] != '%':

which is perhaps too naive.

I guess I don't understand why this test is here.  Wouldn't it make more sense 
to either just let any TypeError from _format() to percolate up, or to catch 
that TypeError and transform it into the ValueError?  Why try to replicate the 
logic of str.__mod__()?

--

___
Python tracker 

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



[issue10379] locale.format() input regression

2010-11-09 Thread Eric Smith

Changes by Eric 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



[issue10379] locale.format() input regression

2010-11-09 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Hmm.  So I guess the answer is to use locale.format_string() instead.  But the 
documentation for locale.format() is not entirely clear about the prohibition 
on trailing text.

--

___
Python tracker 

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



[issue2522] locale.format() problems with decimal separator

2010-11-09 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Hmm.  See bug 10379 for fallout from this change.  I'm not saying it should be 
reverted but see that issue for further discussion.

--
nosy: +barry

___
Python tracker 

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



[issue2522] locale.format() problems with decimal separator

2010-11-09 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I mean issue 10379

--

___
Python tracker 

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



[issue10379] locale.format() input regression

2010-11-09 Thread Eric Smith

Eric Smith  added the comment:

I agree the documentation isn't terribly clear on what a "%char specifier" or 
"whole format string" is.

FWIW, this is also a 3.1 and greater issue.

--
versions: +Python 3.1, Python 3.2

___
Python tracker 

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



[issue10379] locale.format() input regression

2010-11-09 Thread Eric Smith

Changes by Eric Smith :


--
assignee:  -> d...@python
components: +Documentation
nosy: +d...@python

___
Python tracker 

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



[issue10380] AttributeError: 'module' object has no attribute 'exc_traceback'

2010-11-09 Thread Peda Venkateswarlu Pola

New submission from Peda Venkateswarlu Pola :

As we have some new requirements in standard logging, We have written wrapper 
logger. This includes find caller which gives information about filename , line 
number , class name and method name. As i found that python logger doesn't give 
class name so we get the code from python logger and modified to our 
requirement. 

We end up with the following error intermittently from the function 
"currentframe()" .

"AttributeError: 'module' object has no attribute 'exc_traceback'"


def currentframe():
"""Return the frame object for the caller's stack frame."""
try:
raise Exception
except:
return sys.exc_traceback.tb_frame.f_back

Please help me out ASAP.

Great thanks in advance.

--
components: None
files: findcaller_modi.py
messages: 120913
nosy: polavenki
priority: normal
severity: normal
status: open
title: AttributeError: 'module' object has no attribute 'exc_traceback'
type: crash
versions: Python 2.5
Added file: http://bugs.python.org/file19563/findcaller_modi.py

___
Python tracker 

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



[issue10378] Typo in results of help(divmod)

2010-11-09 Thread Richard Fuhr

Richard Fuhr  added the comment:

OK, thanks for the clarification. I am new to Python. 

Sent from my iPod

On Nov 9, 2010, at 3:54 PM, Andreas Stührk  wrote:

> 
> Andreas Stührk  added the comment:
> 
> __builtin__ is the correct name for the module (see 
> http://docs.python.org/library/__builtin__.html, especially the note at the 
> end which is the cause of the confusion), hence this is not a bug.
> 
> --
> nosy: +Trundle
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue10380] AttributeError: 'module' object has no attribute 'exc_traceback'

2010-11-09 Thread Georg Brandl

Georg Brandl  added the comment:

sys.exc_traceback is deprecated, please use sys.exc_info().  Also note that 
this tracker is not a place to get help; the python-list mailing list (a.k.a. 
comp.lang.python newsgroup) is the right place for that.

--
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue10358] Doc styles for print should only use dark colors

2010-11-09 Thread Georg Brandl

Georg Brandl  added the comment:

I agree and will add a print-media stylesheet.

--
nosy: +georg.brandl

___
Python tracker 

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