[issue10404] IDLE on OS X popup menus do not work: cannot set/clear breakpoints

2010-11-13 Thread Ned Deily

New submission from Ned Deily :

In several contexts, IDLE binds clicking of the right mouse button to context 
popup menus, most importantly, to provide the Set Breakpoint and Clear 
Breakpoint actions in edit windows.  On OS X systems, however, one cannot 
assume there will be more than one (e.g. the left) mouse button.  Further, Aqua 
Tk, the default on OS X, binds a right button if present to , rather 
than  as with other Tk implementations and ignores  
bindings.  The net effect is that there is currently no way to use IDLE's 
breakpoint facility with Aqua Tk, with or without a multi-button mouse.

--
assignee: ronaldoussoren
components: IDLE, Macintosh
messages: 121118
nosy: ned.deily, ronaldoussoren
priority: critical
severity: normal
stage: patch review
status: open
title: IDLE on OS X popup menus do not work: cannot set/clear breakpoints
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



[issue10404] IDLE on OS X popup menus do not work: cannot set/clear breakpoints

2010-11-13 Thread Ned Deily

Ned Deily  added the comment:

The attached patch modifies IDLE on OS X to bind popup menus to Control-Click 
(of the main or "left" button), as is commonly done elsewhere in OS X.

--
Added file: 
http://bugs.python.org/file19592/issue10404-idle_no_context_menus.txt

___
Python tracker 

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



[issue10392] GZipFile crash when fileobj.mode is None

2010-11-13 Thread R. David Murray

R. David Murray  added the comment:

Yes.  However, if None were a valid value for mode, then the would would 
instead do something like:

SENTINEL = object()

class GZipFile...

def __init__(self, filename=None, mode=SENTINEL, ...

and then where None currently appears in the logic of the method, mode would be 
checked against SENTINEL to see if no value had been passed to the mode 
argument.

Thus the presence of None in the __init__ signature actually indicates that 
None is explicitly *not* a valid value for mode (and thus can safely be used as 
a sentinel value).

--

___
Python tracker 

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



[issue10405] IDLE breakpoint facility undocumented

2010-11-13 Thread Ned Deily

New submission from Ned Deily :

In neither the IDLE section of the Library Reference nor in IDLE's own help 
file is there any documentation on how to use its breakpoint capability.  Since 
the menu options only appear if the user knows to Right-click (or Control-click 
on OS X - see issue10404), it would be easy for a user to never realize that 
the breakpoint capability exists.

--
assignee: d...@python
components: Documentation, IDLE
messages: 121121
nosy: d...@python, kbk, ned.deily, taleinat, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE breakpoint facility undocumented
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



[issue10404] IDLE on OS X popup menus do not work: cannot set/clear breakpoints

2010-11-13 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +Bruce.Sherwood, kbk, taleinat

___
Python tracker 

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



[issue10356] decimal.py: hash of -1

2010-11-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Okay; go ahead and apply (preferably in two separate commits, since you're 
fixing two only marginally related issues here).

--
assignee:  -> skrah

___
Python tracker 

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



[issue10406] IDLE 2.7 on OS X does not enable Rstrip extension by default

2010-11-13 Thread Ned Deily

New submission from Ned Deily :

r73001 for Issue5150 added the Rstrip extension to IDLE and modified the 
extensions configuration file, config-extensions.def, to enable it by default.  
For Python 2 OS X installs, however, the config-extensions.def file from 
Lib/idlelib is replaced by a tailored one from Mac/IDLE and the changes for 
Issue5101 are lost.  The attached patch updates the Mac/IDLE version 
appropriately.  Note, for Python 3 installs, this is not a problem as there is 
no longer a separate Mac-only copy of the file.

--
assignee: ronaldoussoren
components: IDLE, Macintosh
messages: 121123
nosy: Bruce.Sherwood, kbk, ned.deily, ronaldoussoren, taleinat
priority: normal
severity: normal
stage: patch review
status: open
title: IDLE 2.7 on OS X does not enable Rstrip extension by default
type: performance
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



[issue10406] IDLE 2.7 on OS X does not enable Rstrip extension by default

2010-11-13 Thread Ned Deily

Changes by Ned Deily :


Added file: http://bugs.python.org/file19593/issue10406-idle27-rstrip-27.txt

___
Python tracker 

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



[issue10205] Can't have two tags with the same QName

2010-11-13 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Thanks for the explanation, Éric. That helps.
- Backported QName tests in r86447 to release31-maint.

As for the logic of the fix, it follows like this:

If True and False:
  #Doesn't go here
elif True:
  # Goes here

vs

if True:
   # Goes here
   if False:
  # Does not matter
elif:
   # Doesn't go here.

--
status: open -> closed

___
Python tracker 

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



[issue10141] SocketCan support

2010-11-13 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The patch looks good at first glance, but is there a way to test the feature?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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




[issue10260] Add a threading.Condition.wait_for() method

2010-11-13 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Ok, here is a new patch which slightly expands the documentation and improves 
the timeout unittest.
If there are no objections I'll then commit this shortly.

--
Added file: http://bugs.python.org/file19594/wait_for2.patch

___
Python tracker 

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



[issue10356] decimal.py: hash of -1

2010-11-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

The Fraction type has the same behaviour, so I've fixed it to match the 
proposed new Decimal behaviour in r86448.

--

___
Python tracker 

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



[issue10387] ConfigParser's getboolean method is broken

2010-11-13 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

On Sat, Nov 13, 2010 at 01:20:45AM +, Łukasz Langa wrote:
> You think wrong. Try it.

Okay, I get it. Coercing would be a bad idea in RawConfigParser
because there are cases where get method can have raw=True and
coercing would break those behaviors.

The way the OP expressed it, it looked like a bug to me.
Here is one way, the OP's concern can be resolved.

Index: Lib/configparser.py
===
--- Lib/configparser.py (revision 86441)
+++ Lib/configparser.py (working copy)
@@ -892,6 +892,8 @@
 """
 if value.lower() not in self.BOOLEAN_STATES:
 raise ValueError('Not a boolean: %s' % value)
+if str(value) in self.BOOLEAN_STATES:
+return self.BOOLEAN_STATES[str(value)]
 return self.BOOLEAN_STATES[value.lower()]

 def _validate_value_type(self, value):

But this seems specific to the special case as this bug is raised for.
I am personally, +0 for this too.

--

___
Python tracker 

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



[issue10260] Add a threading.Condition.wait_for() method

2010-11-13 Thread Georg Brandl

Georg Brandl  added the comment:

Good, but please wait until after the a4 freeze.

--

___
Python tracker 

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



[issue10260] Add a threading.Condition.wait_for() method

2010-11-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Ok, here is a new patch which slightly expands the documentation and improves 
> the timeout unittest.
> If there are no objections I'll then commit this shortly.

Again, I think you should use a larger timeout value than 0.1, to avoid
intermittent buildbot failures.

--

___
Python tracker 

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



[issue1520831] urrlib2 max_redirections=0 disables redirects

2010-11-13 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

This is an invalid bug report at the moment. In fact, aged.
The redirection depends upon max_redirections and max_repeats together. Setting 
it to 0 explicitly (inside the code) is not a good use case under any condition.

--
nosy:  -BreamoreBoy
resolution:  -> wont fix
stage: unit test needed -> 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



[issue5111] httplib: wrong Host header when connecting to IPv6 litteral URL

2010-11-13 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Fixed in r86450 (py3k). Will be back porting shortly.

--
resolution:  -> fixed
stage:  -> committed/rejected

___
Python tracker 

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



[issue10116] Sporadic failures in test_urllibnet

2010-11-13 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
status: pending -> closed

___
Python tracker 

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



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

2010-11-13 Thread Luke Kenneth Casson Leighton

Luke Kenneth Casson Leighton  added the comment:

> I am not sure how we should do this, but here's my proposal
> for distutils2 at least:

> - make this new feature a standalone package that patches distutils
> - release it for 2.x
> - let's add your work in distutils2 as well, so it's back in the stdlib in 3.x

 that would work very well: people doing new setup.py files, converting from 
python2 etc., will, duh, need to do _some_ conversion: they'll expect breakage 
and to be using distutils2 anyway.

thank you tarek.

--

___
Python tracker 

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



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

2010-11-13 Thread Luke Kenneth Casson Leighton

Luke Kenneth Casson Leighton  added the comment:

> The current patch makes too many changes in core distutils functions;
> it cannot be accepted in this form.  I'm sure that most of the needed
> changes can be made in a subclass of the present Mingw32CCompiler.

 that's what i did when creating the _other_ (yet another)
 mingw32 patch - however _some_ minimal changes to core distutils
 _are_ unfortunately required.  and to sys.py and os.py - this is,
 after all, a new platform!  it starts off with
 "sys.platform == 'mingw32'", requiring detection of gcc compiler
 type BUT and os type of win32, and goes from there.

 right now, detection logic is:

 * "if gcc on win32 platform, platform MUST be cygwin"
 * "if msvc compiler, platform MUST be win32"

 both of which are... well... wrong! :)

 so, i found that it was necessary to start in os.py and sys.py,
 create a platform-type "mingw32" and _then_ it was easy to do
 a MingW32Compiler etc. with (mostly) additions not modifications
 to distutils, but _necessary_ to add in detection of the type.

 if distutils was designed to do "exec import distutils.compiler.%s as 
compiler" % sys.platform and go from there then this would be an entirely 
non-issue: no modifications to distutils would be required, just a completely 
separate module containing the new compiler...

 ... but distutils isn't designed that way, is it? :)

 l.

--

___
Python tracker 

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



[issue10116] Sporadic failures in test_urllibnet

2010-11-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

There are still sporadic failures such as:

==
ERROR: testURLread (test.test_urllibnet.URLTimeoutTest)
--
Traceback (most recent call last):
  File 
"/Users/pythonbuildbot/buildarea/2.7.hansen-osx-x86/build/Lib/test/test_urllibnet.py",
 line 40, in testURLread
x = f.read()
  File 
"/Users/pythonbuildbot/buildarea/2.7.hansen-osx-x86/build/Lib/socket.py", line 
351, in read
data = self._sock.recv(rbufsize)
timeout: timed out

which seems to show that not everything has been properly converted.

(http://www.python.org/dev/buildbot/all/builders/AMD64%20Snow%20Leopard%
202.7/builds/156/steps/test/logs/stdio )

Le samedi 13 novembre 2010 à 12:34 +, Senthil Kumaran a écrit :
> Changes by Senthil Kumaran :
> 
> 
> --
> status: pending -> closed
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-11-13 Thread Vlastimil Brom

Vlastimil Brom  added the comment:

I'd have liked to suggest updating the underlying unicode data to the latest 
standard 6.0, but it turns out, it might be problematic with the cross-version 
compatibility;
according to the clarification in 
http://bugs.python.org/issue10400
the 3... versions are going to be updated, while it is not allowed in the 2.x 
series.
I guess it would cause maintainance problems (as the needed properties are not 
available via unicodedata).
Anyway, while I'd like the recent unicode data to be supported (new characters, 
ranges, scripts, and corrected individual properties...),
I'm much happier, that there is support for the 2 series in regex...
vbr

--

___
Python tracker 

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



[issue10407] missing errno import in distutils/dir_util.py

2010-11-13 Thread Zbyszek Szmek

New submission from Zbyszek Szmek :

Fix is trivial:
diff -r 8daacdacf720 -r 1a821081b470 Lib/distutils/dir_util.py
--- a/Lib/distutils/dir_util.py Sat Nov 13 13:27:49 2010 +0100
+++ b/Lib/distutils/dir_util.py Sat Nov 13 14:37:49 2010 +0100
@@ -5,6 +5,7 @@
 __revision__ = "$Id: dir_util.py 86244 2010-11-06 04:48:05Z eric.araujo $"
 
 import os, sys
+import errno
 from distutils.errors import DistutilsFileError, DistutilsInternalError
 from distutils import log

--
assignee: tarek
components: Distutils
messages: 121137
nosy: eric.araujo, tarek, zbysz
priority: normal
severity: normal
status: open
title: missing errno import in distutils/dir_util.py
type: crash
versions: Python 3.2

___
Python tracker 

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



[issue10407] missing errno import in distutils/dir_util.py

2010-11-13 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the report.  I’ve run pyflakes over the distutils directory and 
found another error in test_sysconfig.  Will fix shortly.

--
assignee: tarek -> eric.araujo
status: open -> pending
type: crash -> behavior
versions: +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



[issue10408] Denser dicts and linear probing

2010-11-13 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This is a patch experiment which does two things:
- make dicts denser by making the resize factor 2 instead of 4 for small dicts
- improve cache locality on collisions by using linear probing

It should be noted that these two changes are not independent. Improving cache 
locality on collisions makes probing cheaper, and in turn should allow to make 
small dicts denser.

Linear probing is motivated by the fact that collisions can happen frequently.  
The comments in dictobject.c seem a bit mistaken:

“If we *usually* find the key we're looking for on the first try (and, it turns 
out, we usually do -- the table load factor is kept under 2/3, so the odds are 
solidly in our favor), then it makes best sense to keep the initial index 
computation dirt cheap.”

According to http://www.cse.ust.hk/~yike/pods10-hashing.pdf, however, things 
are not so rosy. The average number of probes for successful lookups, depending 
on the load factor "alpha", is given by:

>>> c = lambda alpha: 0.5 * (1 + 1/(1-alpha))

while the average number of probes for unsuccessful lookups is:

>>> cp = lambda alpha: 0.5 * (1 + 1/(1-alpha)**2)

(note: this is with a perfectly random hash function; I intuitively assume an 
imperfect random function gives higher figures)

For a load factor of 2/3, we then get:

>>> c(2/3)
1.9998
>>> cp(2/3)
4.999

Since the current non-linear probing schemes guarantees that each probing will 
access a different cache line, the cache locality of a lookup becomes very poor.

The problem with linear probing, as noted in the comments, is that it degrades 
performance quite a lot when the hashing function clusters results. The 
solution I'm proposing is to apply an *initial* perturbation, by multiplying 
the hash() with a prime number. Multiplication is very fast on modern CPUs, so 
this doesn't adversely affect performance.

--
components: Interpreter Core
files: dictopts.patch
keywords: patch
messages: 121139
nosy: mark.dickinson, pitrou, rhettinger, tim_one
priority: normal
severity: normal
status: open
title: Denser dicts and linear probing
type: performance
versions: Python 3.2
Added file: http://bugs.python.org/file19595/dictopts.patch

___
Python tracker 

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



[issue10408] Denser dicts and linear probing

2010-11-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a benchmark adapted from another bug entry (I merely adapted the dict 
sizes in order to better exhibit the performance degradation when the CPU cache 
becomes too small to hold the whole dict).

Results without the patch:

   1 words (9092 keys), 2928369 inserts/s, 13911456 lookups/s, 86 
bytes/key (0.8MB)
   2 words (   17699 keys), 3290037 inserts/s, 12746707 lookups/s, 44 
bytes/key (0.8MB)
   4 words (   34490 keys), 2620007 inserts/s, 7723605 lookups/s, 91 
bytes/key (3.0MB)
   8 words (   67148 keys), 2698863 inserts/s, 6573500 lookups/s, 46 
bytes/key (3.0MB)
  16 words (  130897 keys), 2401067 inserts/s, 4886971 lookups/s, 48 
bytes/key (6.0MB)
  32 words (  254233 keys), 2077558 inserts/s, 5061763 lookups/s, 49 
bytes/key (12.0MB)
  64 words (  493191 keys), 1923967 inserts/s, 4490697 lookups/s, 51 
bytes/key (24.0MB)
 128 words (  956820 keys), 1792729 inserts/s, 4353711 lookups/s, 52 
bytes/key (48.0MB)

Results with the patch:

   1 words (9092 keys), 3324590 inserts/s, 13911456 lookups/s, 43 
bytes/key (0.4MB)
   2 words (   17699 keys), 3243603 inserts/s, 13202090 lookups/s, 44 
bytes/key (0.8MB)
   4 words (   34490 keys), 2858372 inserts/s, 10686124 lookups/s, 45 
bytes/key (1.5MB)
   8 words (   67148 keys), 2585146 inserts/s, 6917441 lookups/s, 46 
bytes/key (3.0MB)
  16 words (  130897 keys), 2395923 inserts/s, 6455817 lookups/s, 48 
bytes/key (6.0MB)
  32 words (  254233 keys), 2247141 inserts/s, 5529826 lookups/s, 49 
bytes/key (12.0MB)
  64 words (  493191 keys), 2064675 inserts/s, 5073732 lookups/s, 51 
bytes/key (24.0MB)
 128 words (  956820 keys), 1997615 inserts/s, 4760878 lookups/s, 52 
bytes/key (48.0MB)


Lookups become 10% faster when the dict is bigger than the cache, and even 
inserts seem to benefit a bit.
(not to mention that small dicts take almost half the memory)

--
Added file: http://bugs.python.org/file19596/dcbench-py3k.py

___
Python tracker 

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



[issue1520831] urrlib2 max_redirections=0 disables redirects

2010-11-13 Thread John J Lee

John J Lee  added the comment:

Why not?

--

___
Python tracker 

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



[issue10409] mkcfg crashes with ValueError

2010-11-13 Thread Stein Magnus Jodal

New submission from Stein Magnus Jodal :

I'm using Distutils2 1.0a3 with Python 2.6.6.


To reproduce:

1. Run ``python -m distutils2.mkcfg``
2. When you get to the Trove classifier step enter e.g. "Apache 2" as license
3. When asked to select a matching license, enter something else than a number, 
e.g. "Apache"
4. mkcfg crashes with a ValueError


Traceback (most recent call last):
  File "/usr/lib/python2.6/runpy.py", line 122, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.6/runpy.py", line 34, in _run_code
exec code in run_globals
  File "/usr/local/lib/python2.6/dist-packages/distutils2/mkcfg.py", line 415, 
in 
main()
  File "/usr/local/lib/python2.6/dist-packages/distutils2/mkcfg.py", line 409, 
in main
program.query_user()
  File "/usr/local/lib/python2.6/dist-packages/distutils2/mkcfg.py", line 242, 
in query_user
self.set_classifier()
  File "/usr/local/lib/python2.6/dist-packages/distutils2/mkcfg.py", line 254, 
in set_classifier
self.set_license(self.classifiers)
  File "/usr/local/lib/python2.6/dist-packages/distutils2/mkcfg.py", line 319, 
in set_license
foundIndex = foundList[int(troveLicense) - 1]
ValueError: invalid literal for int() with base 10: 'Apache'

--
assignee: tarek
components: Distutils2
messages: 121142
nosy: eric.araujo, jodal, tarek
priority: normal
severity: normal
status: open
title: mkcfg crashes with ValueError
versions: 3rd party

___
Python tracker 

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



[issue10409] mkcfg crashes with ValueError

2010-11-13 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Thanks for the feedback, I can reproduce this. Fixing it.

--

___
Python tracker 

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



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

2010-11-13 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

> this is, after all, a new platform! it starts off with 
> "sys.platform == 'mingw32'"

I disagree; programs compiled with mingw32 run on Windows, and use the MSVC 
runtime. It's the same platform as the current win32 build.
It's even possible to use mingw32 to compile extensions for the VS9.0 based 
python.exe.
A different compiler does not make a new platform.

--

___
Python tracker 

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-11-13 Thread Matthew Barnett

Matthew Barnett  added the comment:

issue2636-20101113.zip is a new version of the regex module.

It now supports Unicode 6.0.0.

--
Added file: http://bugs.python.org/file19597/issue2636-20101113.zip

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



[issue10409] mkcfg crashes with ValueError

2010-11-13 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Commited in a99e29d63071 (hg.python.org)

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



[issue10401] Globals / builtins cache

2010-11-13 Thread Brett Cannon

Brett Cannon  added the comment:

Unladen actually has something like this in place for performance 
optimizations. Not sure how Antoine's approach differs, though.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue2571] cmd.py always uses raw_input, even when another stdin is specified

2010-11-13 Thread Michael Hoffman

Changes by Michael Hoffman :


--
nosy: +hoffman

___
Python tracker 

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



[issue10396] stdin argument to pdb.Pdb doesn't work unless you also set Pdb.use_rawinput = False

2010-11-13 Thread Michael Hoffman

Michael Hoffman  added the comment:

As always, it seems a bit more complicated than I originally expected. Since 
it's too late for a Python 2.x feature addition, I'll wait until I upgrade to 
3.x to work on that.

You are correct, technically this is not a docs bug but I think the clarity of 
the docs would be greatly improved if you would add the text from the cmd 
module docs to the pdb docs:

"If you want a given stdin to be used, make sure to set the instance’s 
use_rawinput attribute to False, otherwise stdin will be ignored."

I hope you will agree that this is unexpected behavior that doesn't really fit 
into the zen of Python.

--

___
Python tracker 

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-11-13 Thread Vlastimil Brom

Vlastimil Brom  added the comment:

Thank you very much!
a quick test with my custom unicodedata with 6.0 on py 2.7 seems ok.
I hope, there won't be problems with "cooperation" of the more recent internal 
data with the original 5.2 database in python 2.x releases.

vbr

--

___
Python tracker 

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



[issue10401] Globals / builtins cache

2010-11-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

There aren't many possible approaches. The more complex variants of globals 
caches try to also speedup writes, which is IMO a waste of time since rebinding 
globals is not a good coding practice, and especially not in the middle of 
time-critical loops.

(by the way, the patch only addresses normal functions, but generators would 
easily benefit from a similar treatment)

And Skip is right that this would be most useful when paired with a JIT 
(allowing for aggressive specialization, and possibly inlining).

--

___
Python tracker 

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



[issue10399] AST Optimization: inlining of function calls

2010-11-13 Thread Brett Cannon

Brett Cannon  added the comment:

While I have nothing to say directly about the inline optimization, I do have 
some stuff to say about moving to AST optimizations.

First, doing in Python is a good thing. It not only makes prototyping easier, 
but it allows other VMs to use the optimizations w/o having to re-implement 
themselves.

Second, the symtable pass does need to eventually get exposed (most likely as 
an optional pass one can do to an AST). I am actually in the middle of an 
AST-heavy project that will end up wanting the symbol table info as well.

Third, for that Graphviz output, was anything special required? If so, I would 
toss the code into Tools for others to benefit from.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue10410] Is iterable a container type?

2010-11-13 Thread INADA Naoki

New submission from INADA Naoki :

In http://docs.python.org/release/2.6.6/glossary.html, "iterable" is described 
as
"A container object capable of returning its members one at a time."
Is it correct? Is stream object like file a container type?

Container ABC requires only "__contains__" abstract method. I think file
is iterable but is not container.

Likewise, "and objects of any classes you define with an __iter__() or
__getitem__() method." is wrong because __getitem__ method is not relate to
iterable.

--
assignee: d...@python
components: Documentation
messages: 121152
nosy: d...@python, naoki
priority: normal
severity: normal
status: open
title: Is iterable a container type?
versions: Python 2.6, Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue10392] GZipFile crash when fileobj.mode is None

2010-11-13 Thread Brad Greenlee

Brad Greenlee  added the comment:

Understood. I just felt that fileobj.mode == None should be handled the same 
way that GzipFile(...,mode=None) is handled.

I've submitted a patch to Django: http://code.djangoproject.com/ticket/14681

--

___
Python tracker 

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



[issue10411] Pickle benchmark fails after converting Benchmark Suite to py3k

2010-11-13 Thread Bobby Impollonia

New submission from Bobby Impollonia :

After checking out and converting the benchmark suite to py3k, the py3k 
benchmark set fails because of an ImportError in bm_pickle.py.  

Steps to reproduce:
hg clone http://hg.python.org/benchmarks/ py2benchmarks
mkdir py3benchmarks
cd py3benchmarks
../py2benchmarks/make_perf3.sh ../py2benchmarks
py3k perf.py -f -b py3k old_py3k new_py3k

The ImportError comes from the new py2k/ py3k compatibility code. bm_pickle 
imports "long" from compat.py. However, when 2to3 is run, it changes the import 
line from saying "import ... long" to saying "import ... int", which fails 
because compat.py does not define "int".

Is this a bug in lib2to3? I would not expect names used as lvalues to get 
converted. I'm using lib2to3 from python 2.6.5.

A similar case is that the line
unicode = str
in compat.py gets changed by 2to3 to:
str = str
This isn't currently causing any problems because no one is trying to import 
"unicode" from compat, but if they did, they would fail on py3k.

Regardless, a patch is attached that fixes bm_pickle by using "int_" as the 
name for our typedef instead of "long".

--
assignee: collinwinter
components: Benchmarks
files: compat.patch
keywords: patch
messages: 121154
nosy: bobbyi, collinwinter, pitrou
priority: normal
severity: normal
status: open
title: Pickle benchmark fails after converting Benchmark Suite to py3k
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file19598/compat.patch

___
Python tracker 

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



[issue10408] Denser dicts and linear probing

2010-11-13 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

My previous experiments along these lines showed it was a dead-end.  The number 
of probes was the most important factor and beat-out any effort to improve 
cache utilization from increased density.  

Doing extra work (more probes) in order to improve cache effects is very 
difficult because most real programs have an uneven access pattern so that the 
most frequently accesses items are usually already in cache.  So, the attempted 
improvement only helps the less frequently accessed items and isn't worth the 
extra number of probes.

Another result from earlier experiments is that benchmarking the experiment is 
laden with pitfalls.  Tight timing loops don't mirror real world programs, nor 
do access patterns with uniform random distributions.

--

___
Python tracker 

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



[issue10408] Denser dicts and linear probing

2010-11-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> My previous experiments along these lines showed it was a dead-end.
> The number of probes was the most important factor and beat-out any
> effort to improve cache utilization from increased density.  

Can you describe your experiments? What workloads or benchmarks did you
use?

Do note that there are several levels of caches in modern CPUs. L1 is
very fast (latency is 3 or 4 cycles) but rather small (32 or 64KB). L2,
depending on the CPU, has a latency between 10 and 20+ cycles and can be
256KB to 1MB large. L3, when present, is quite larger but also quite
slower (latency sometimes up to 50 cycles).
So, even if access patterns are uneven, it is probably rare to have all
frequently accessed data in L1 (especially with Python since objects are
big).

> Another result from earlier experiments is that benchmarking the
> experiment is laden with pitfalls.  Tight timing loops don't mirror
> real world programs, nor do access patterns with uniform random
> distributions.

I can certainly understand that; can you suggest workloads approaching
"real world programs"?

--

___
Python tracker 

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



[issue10408] Denser dicts and linear probing

2010-11-13 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

FWIW, one way to make a dict denser without increasing the number of probes is 
to use Brent's Variation of Algorithm D in Knuth.  That optimizes the insertion 
order to minimize the number of collisions and lets you pack well over 
two-thirds full without degradation.

--

___
Python tracker 

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



[issue10408] Denser dicts and linear probing

2010-11-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> FWIW, one way to make a dict denser without increasing the number of
> probes is to use Brent's Variation of Algorithm D in Knuth.  That
> optimizes the insertion order to minimize the number of collisions and
> lets you pack well over two-thirds full without degradation.

He, you suggested that several years ago on python-dev and I supplied
the code. Also, IIRC, it didn't bring any improvement - although I don't
remember which benchmarks, if any, were run.

But the experiment here is mostly to decrease the (direct and indirect)
cost of collisions by improving temporal locality of lookups.

--

___
Python tracker 

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



[issue10403] Use "member" consistently

2010-11-13 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> "Members and methods" should just be "attributes".

+1 

That substitution should be made almost everywhere.

Individual slot variable are still called members though
and their type is a member_descriptor.  And the C API
still has a tp_members entry.  Otherwise, it looks like
the term member is out-of-date.

--
nosy: +rhettinger

___
Python tracker 

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



[issue10411] Pickle benchmark fails after converting Benchmark Suite to py3k

2010-11-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, since this benchmark is already 3.x compatible, there's not much sense in 
making a 2to3 pass, is there?
So perhaps "make_perf3.sh" (which I've never used) should be a bit smarter.

--

___
Python tracker 

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



[issue10149] Data truncation in expat parser

2010-11-13 Thread Maciek J

Maciek J  added the comment:

Couldn't compile to html at the moment, but it should be fine anyway.

Note that I didn't wanted to start a new paragraph (I'm guessing you meant the 
sentence at line 13 of the patch) as there was no new paragraph in a previous 
version.

--
Added file: http://bugs.python.org/file19599/pyexpat.rst.patch

___
Python tracker 

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



[issue10408] Denser dicts and linear probing

2010-11-13 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

See Objects/dictnotes.txt for some of the results.
I spent about full month trying to optimize dict
performance either by tuning parameters or using
different algorithms.

There were a couple wins that were not implemented.
1) Allowing users to control insertion order or
at least specify which keys are frequently accessed
so that we could assure a first-time hit.
2) Allowing users to pre-size a dictionary so that
resizes wouldn't be needed or an so they could control
density.
Guido didn't want to expose these controls.

The PyPy guys published a paper on their results with
alternative dict implementations and specialized dicts.
You might want to look at that.  IIRC, they found only
minor wins.

--

___
Python tracker 

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



[issue10408] Denser dicts and linear probing

2010-11-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> See Objects/dictnotes.txt for some of the results.
> I spent about full month trying to optimize dict
> performance either by tuning parameters or using
> different algorithms.

Well, I've seen those results. I'm asking about which workloads or
benchmarks were used so that I can try to reproduce these experiments.

--

___
Python tracker 

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



[issue10411] Pickle benchmark fails after converting Benchmark Suite to py3k

2010-11-13 Thread Bobby Impollonia

Bobby Impollonia  added the comment:

Are there any files in performance/ that need 2to3?

--

___
Python tracker 

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



[issue10410] Is iterable a container type?

2010-11-13 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: d...@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue10411] Pickle benchmark fails after converting Benchmark Suite to py3k

2010-11-13 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Are there any files in performance/ that need 2to3?

All the ones that require external libs (such as django, spambayes,
etc.). Although, of course, since they require external libs it's not
sure the translation will work either.

I think I've converted all the standalone benchmarks. You can select
them by specifying "-b 2n3" to perf.py.

--

___
Python tracker 

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



[issue10410] Is iterable a container type?

2010-11-13 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> "iterable" is described as "A container object 
> capable of returning its members one at a time."

That wording is confusing.  I'll fix it.

> Likewise, "and objects of any classes you define 
> with an __iter__() or __getitem__() method." is 
> wrong because __getitem__ method is not relate to
> iterable

That wording is correct.  Sequences are automatically
iterable even if they don't define __iter__.  For example:

>>> class A:
... def __getitem__(self, i):
... if i > 10:
... raise IndexError(i)
... return i * 100

>>> list(A())
[0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000]

If you're curious, the details are in the PyObject_GetIter() function in 
http://svn.python.org/view/python/branches/release27-maint/Objects/abstract.c?view=markup
 .

--
priority: normal -> low

___
Python tracker 

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



[issue10412] Add py3k support for "slow" pickle benchmark in Benchmark Suite

2010-11-13 Thread Bobby Impollonia

New submission from Bobby Impollonia :

A patch is attached that does the following:
1) Add py3k support for the "slow" (pure-Python) pickle/ unpickle benchmarks.
2) Add a runtime check to the pickle benchmark verifying that we do or don't 
have the C accelerators as expected.
3) Rename the cPickle versions to "fastpickle"/ "fastunpickle" and add a group 
called "pickle" that contains all of the pickling benchmarks.
4) Add the "pickle" benchmark group to the py3k and 2n3 groups.

--
assignee: collinwinter
components: Benchmarks
files: slowpickle.patch
keywords: patch
messages: 121167
nosy: bobbyi, collinwinter, pitrou
priority: normal
severity: normal
status: open
title: Add py3k support for "slow" pickle benchmark in Benchmark Suite
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file19600/slowpickle.patch

___
Python tracker 

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



[issue10413] Comments in unicode.h are out of date

2010-11-13 Thread Alexander Belopolsky

New submission from Alexander Belopolsky :

Attached patch updates some comments in unicode.h mostly reflecting the fact 
that the default encoding is now unconditionally UTF-8.

--
assignee: belopolsky
components: Documentation, Interpreter Core
files: unicode-comments.diff
keywords: patch
messages: 121168
nosy: belopolsky, haypo, lemburg, loewis
priority: normal
severity: normal
stage: patch review
status: open
title: Comments in unicode.h are out of date
versions: Python 3.2
Added file: http://bugs.python.org/file19601/unicode-comments.diff

___
Python tracker 

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



[issue9520] Add Patricia Trie high performance container

2010-11-13 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I don't think a Patricia Trie is going to find its way into the code 
distribution.  It has a better chance as a third-party module listed on PyPI 
(much in the same way that people access memcached from Python).

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

___
Python tracker 

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



[issue9807] deriving configuration information for different builds with the same prefix

2010-11-13 Thread Matthias Klose

Matthias Klose  added the comment:

this adds the modifier to the /python3.2/config directory.

Now you end up with both
  
  /python3.2/config

and

/python3.2/

for anything else. This is not what Debian, Fedora and Ubuntu are currently 
doing. Is this really wanted? I'd rather like to see this as

/python3.2/config-

so that everything is again in one prefix.


$ ls -l /lib/pkgconfig/
total 4
-rw-r--r-- 1 doko doko 282 Nov 14 02:44 python-3.2.pc
lrwxrwxrwx 1 doko doko  13 Nov 14 02:44 python-3.2mu.pc -> python-3.2.pc

python-3.2mu.pc should be the file, python-3.2.pc the symlink.

--

___
Python tracker 

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



[issue10260] Add a threading.Condition.wait_for() method

2010-11-13 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Good point, Antoine.  I'm always trying to keep those timeouts low, however, to 
avoid having the testsuite duration grow too much with every test :)

I think we can probably fix the issue by having the lock_tests.Bunch() function 
only return when all threads have checked in, thus avoiding thread startup 
delays affecting our timeouts.

--

___
Python tracker 

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



[issue9807] deriving configuration information for different builds with the same prefix

2010-11-13 Thread Matthias Klose

Matthias Klose  added the comment:

the change to python.pc should make the abi change to includedir, not Cflags.

--

___
Python tracker 

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



[issue5111] httplib: wrong Host header when connecting to IPv6 litteral URL

2010-11-13 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

r86461 (release31-maint)
r86462 (release27-maint)

--
status: open -> closed

___
Python tracker 

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



[issue10414] socket.gethostbyname doesn't return an ipv6 address

2010-11-13 Thread david

New submission from david :

(socket.gethostbyname  doesn't return an ipv6 address)
So just to start with I know the documentation says [0] "and getaddrinfo() 
should be used instead for IPv4/v6 dual stack support."
However, the getaddrinfo() method provides more information than required. Why 
can't getaddrinfo support ipv6 ? or a method for ipv6 added to the socket 
module to make getting a host address by name easier (for ipv6) ? 



[0] - http://docs.python.org/library/socket.html#socket.gethostbyname

--
messages: 121174
nosy: db
priority: normal
severity: normal
status: open
title: socket.gethostbyname  doesn't return an ipv6 address

___
Python tracker 

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



[issue10410] Is iterable a container type?

2010-11-13 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Removed the incorrect "container" reference.
See r86463.

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



[issue10411] Pickle benchmark fails after converting Benchmark Suite to py3k

2010-11-13 Thread Bobby Impollonia

Bobby Impollonia  added the comment:

Patch is attached for make_perf3.sh to have it not convert things that don't 
need to be converted. This fixes the issue and with the patch all the py3k 
benchmarks run successfully after running the script.

--
Added file: http://bugs.python.org/file19602/make_perf3.patch

___
Python tracker 

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



[issue10411] Pickle benchmark fails after converting Benchmark Suite to py3k

2010-11-13 Thread Bobby Impollonia

Bobby Impollonia  added the comment:

Attached is a patch for perf.py that goes along with the previous patch for 
make_perf3.sh. This patch changes the py3k group to include everything in the 
2n3 group since we can still run all those tests after converting.

Previously, nqueens, unpack_sequance and richards weren't run as part of -b py3k

--
Added file: http://bugs.python.org/file19603/perf.patch

___
Python tracker 

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



[issue10415] readline.insert_text documentation incomplete

2010-11-13 Thread Justin Lebar

New submission from Justin Lebar :

The readline documentation currently says:

> readline.insert_text(string)
> Insert text into the command line.

But as far as I can tell, readline.insert_text() does something only when 
called from startup_hook or pre_input_hook.

Here's an example of someone using the module in a way that works:

http://swapoff.org/svn/cly/tags/0.7/cly/interactive.py

--
assignee: d...@python
components: Documentation
messages: 121178
nosy: Justin.Lebar, d...@python
priority: normal
severity: normal
status: open
title: readline.insert_text documentation incomplete
versions: Python 3.1

___
Python tracker 

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



[issue10415] readline.insert_text documentation incomplete

2010-11-13 Thread Justin Lebar

Justin Lebar  added the comment:

Actually, maybe startup_hook doesn't do what it sounds like it does and 
insert_text() only works from startup_hook.

If this is the case, then the documentation for startup_hook could also be 
improved:

> The startup_hook function is called with no arguments just before 
> readline prints the first prompt.

--

___
Python tracker 

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



[issue2001] Pydoc interactive browsing enhancement

2010-11-13 Thread Ron Adam

Ron Adam  added the comment:

Ok, here is the latest patch for review.  "issue2001_a.diff'

I restored the pydoc.py file and then put most of the new code in these two 
functions,

  _startserver(urlhandler, port)
  _browse(port=0, *, open_browser=True)

This creates a bettor organized file, and reduces the number of names with 
leading underscores.  As far as I know you can't import things that are located 
inside a function.

I still need to depreciate the '-g' option and the gui() function along with 
the old server parts.

Is there a guide on how to depreciate things?

--
Added file: http://bugs.python.org/file19604/issue2001_a.diff

___
Python tracker 

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



[issue2001] Pydoc interactive browsing enhancement

2010-11-13 Thread Nick Coghlan

Nick Coghlan  added the comment:

Just call warnings.warn with an appropriate message, a category of 
DeprecationWarning and a stacklevel of 2 (so the warning will refer to the 
function's caller rather than to the pydoc code).

It's basically the example from the warnings.warn docs.

--

___
Python tracker 

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