[issue10615] Trivial mingw compile fixes

2013-04-02 Thread Mark Lawrence

Mark Lawrence added the comment:

#17605 titled "mingw-meta: build interpeter core" was opened on 2013-03-31 so I 
believe this can be closed as superseded.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue17605] mingw-meta: build interpeter core

2013-04-02 Thread Mark Lawrence

Mark Lawrence added the comment:

There are patches on #10615 which may be of some use here.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue10566] gdb debugging support additions (Tools/gdb/libpython.py)

2013-04-02 Thread Mark Lawrence

Mark Lawrence added the comment:

Comments in msg123606 seem encouraging so I'm guessing this has just slipped 
under the radar.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-02 Thread Neil Hodgson

New submission from Neil Hodgson:

On Windows, non-equal comparisons (<, <=, >, >=) between strings with common 
prefixes are slower in Python 3.3 than 3.2. This is for both 32-bit and 64-bit 
builds. Performance on Linux has not decreased for the same code. The attached 
program tests comparisons for strings that have common prefixes.

On a 64-bit build, a 25 character string comparison is around 30% slower and a 
100 character string averages 85% slower. A user of 32-bit Python builds 
reported the 25 character case to average 70% slower. 

Here are two runs of the program using 3.2/3.3 on Windows 7 on an i7 870:

>c:\python32\python -u "charwidth.py"
3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)]
a=['C:/Users/Neil/Documents/b','C:/Users/Neil/Documents/z']176
[0.7116295577956576, 0.7055591343157613, 0.7203483026429418]

a=['C:/Users/Neil/Documents/λ','C:/Users/Neil/Documents/η']176
[0.7664397841378787, 0.7199902325464409, 0.713719289812504]

a=['C:/Users/Neil/Documents/b','C:/Users/Neil/Documents/η']176
[0.7341851791817691, 0.6994205901833599, 0.7106807593741005]

a=['C:/Users/Neil/Documents/𠀀','C:/Users/Neil/Documents/𠀁']180
[0.7346812372666784, 0.699543377914, 0.7064768417728411]

>c:\python33\python -u "charwidth.py"
3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64 bit (AMD64)]
a=['C:/Users/Neil/Documents/b','C:/Users/Neil/Documents/z']108
[0.9913326076446045, 0.9455845241056282, 0.9459076605341776]

a=['C:/Users/Neil/Documents/λ','C:/Users/Neil/Documents/η']192
[1.0472289217234318, 1.0362342484091207, 1.0197109728048384]

a=['C:/Users/Neil/Documents/b','C:/Users/Neil/Documents/η']192
[1.0439643704533834, 0.9878581050301687, 0.9949265834034335]

a=['C:/Users/Neil/Documents/𠀀','C:/Users/Neil/Documents/𠀁']312
[1.0987483965446412, 1.0130257167690004, 1.024832248526499]

--
components: Unicode
files: charwidth.py
messages: 185824
nosy: Neil.Hodgson, ezio.melotti
priority: normal
severity: normal
status: open
title: String comparison performance regression
versions: Python 3.3
Added file: http://bugs.python.org/file29652/charwidth.py

___
Python tracker 

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



[issue17616] wave.Wave_read and wave.Wave_write can be context managers

2013-04-02 Thread Claudiu.Popa

New submission from Claudiu.Popa:

I think that wave.open should work with the `with` statement, given the fact 
that Lib/aifc.py does this. I attached a simple patch for this. Thanks in 
advance.

--
components: Library (Lib)
files: wave_context_manager.patch
keywords: patch
messages: 185825
nosy: Claudiu.Popa
priority: normal
severity: normal
status: open
title: wave.Wave_read and wave.Wave_write can be context managers
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file29653/wave_context_manager.patch

___
Python tracker 

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



[issue17359] Mention "__main__.py" explicitly in command line docs

2013-04-02 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

I still don't think that the available documentation is detailed enough. It 
leaves too many unanswered question, e.g.

* What happens if you have both __init__.py and __main__.py in a directory or a 
ZIP file ?

* What does "the script name is added to the start of sys.path" mean when using 
a ZIP file ?

* What are the implications of "Directories and zipfiles containing a 
__main__.py file at the top level are now considered valid Python scripts." and 
where does this scope end ? The wording suggests that you can also import such 
directories or ZIP files.

* How are sys.path, __name__ and possibly __path__ setup when using this 
approach of running a dir/package/ZIP file ?

and probably a few more. The above can all be answered using trial-and-error, 
but it would be better to actually document the intended behavior.

Some quirks I found (dir is a directory with both __init__.py and __main__.py):

* "python2.6 dir" runs the __main__.py file, while "python2.6 -m dir" does not. 
Both work in the same way in Python 2.7.

* In Python 2.7, the two approaches differ in the way sys.path[0] is setup: 
"python2.7 dir" causes this to be set to "dir", while "python2.7 -m dir" 
results in "".

Background: The reason why I'm interested in this is that we are trying to 
mimic the Python command line interface with pyrun 
(http://www.egenix.com/products/python/PyRun/).

--

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +haypo, serhiy.storchaka
type:  -> performance

___
Python tracker 

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



[issue17613] IDLE "AttributeError: 'NoneType' object has no attribute 'index'" from Delegator.py

2013-04-02 Thread Ezio Melotti

Changes by Ezio Melotti :


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



[issue17614] IDLE - quickly closing a large file triggers a traceback

2013-04-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
priority: critical -> high
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



[issue17583] IDLE HOWTO

2013-04-02 Thread Amit Saha

Amit Saha added the comment:

I have tried to incorporate most of the suggestions and made some other changes 
as well. Hope it looks better now.

I haven't yet split it into two separate versions.

--
Added file: http://bugs.python.org/file29654/idle.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

2013-04-02 Thread Eric V. Smith

Eric V. Smith added the comment:

Barry meant that the upstream program that triggered this error has been 
changed to call format_string() instead of format(). The bug still exists in 
format().

My suggestion is to have format() be an alias for format_string(). Deprecating 
format() is an optional step, but may not be worth the hassle.

--

___
Python tracker 

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



[issue17613] IDLE "AttributeError: 'NoneType' object has no attribute 'index'" from Delegator.py

2013-04-02 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Thank you for the analysis.

--
priority: release blocker -> normal

___
Python tracker 

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



[issue11406] There is no os.listdir() equivalent returning generator instead of list

2013-04-02 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue17608] configparser not honouring section but not variable case

2013-04-02 Thread Łukasz Langa

Łukasz Langa added the comment:

This is indeed deliberate. If that's unsuitable for you, consider using:

  cp = ConfigParser()
  cp.optionxform = lambda option: option

as described in 
http://docs.python.org/3/library/configparser.html#configparser.optionxform

--
assignee:  -> lukasz.langa
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Why do you care? Does it impact a real-world workload?

--
nosy: +pitrou

___
Python tracker 

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



[issue17453] logging.config.fileConfig error

2013-04-02 Thread Łukasz Langa

Łukasz Langa added the comment:

Treating "" as empty values was a bug in configparser pre 3.2 (it made it 
impossible to store "" as a value).

Simply change

  [section]
  option = ""

to

  [section]
  option =

Does that solve your problem?

--

___
Python tracker 

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



[issue17612] hooks/mail.py requires [smtp] host to be set, despite a comment to the contrary

2013-04-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well, mercurial itself requires the presence of a "host" item in "[smtp]", so 
it would make sense to require it too.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue17617] struct.calcsize() incorrect

2013-04-02 Thread bonnet

New submission from bonnet:

struct.calcsize('i?') : 21

appears to be incorrect ; in C sizeof : 24

C code:
typedef struct {
  int   param1;
  int   param2;
  int   param3;
  int   param4;
  int   param5;
  unsigned char param6;
} struct_titi6;

main:
struct_titi6 toto3;
printf("taille toto3 : %d\n",sizeof(toto3));
printf("taille toto3.param1 : %d\n",sizeof(toto3.param1));
printf("taille toto3.param6 : %d\n",sizeof(toto3.param6));

results:
taille toto3 : 24
taille toto3.param1 : 4
taille toto3.param6 : 1

--
components: Library (Lib)
messages: 185834
nosy: boa124
priority: normal
severity: normal
status: open
title: struct.calcsize() incorrect
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



[issue17618] base85 encoding

2013-04-02 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Base85 encoding (see e.g. http://en.wikipedia.org/wiki/Ascii85 ) allows a 
tighter encoding than Base64: it has a 5/4 expansion ratio, rather than 4/3.
It is used in Mercurial, git, and there's another variant that's used by Adobe 
in the PDF format.

It would be nice to have a Base85 implementation in either the binascii or 
base64 modules.

(unfortunately the Mercurial implementation is GPL'ed, although if we want to 
copy it we might simply ask them for a relicensing)

--
components: Library (Lib)
messages: 185835
nosy: christian.heimes, pitrou
priority: normal
severity: normal
status: open
title: base85 encoding
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue6743] Add function compatible with print to pprint module

2013-04-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Maybe pprint.print() should specify sep='\n' by default?

--

___
Python tracker 

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



[issue17617] struct.calcsize() incorrect

2013-04-02 Thread Mark Dickinson

Mark Dickinson added the comment:

This is working as designed: the result of struct.calcsize matches the length 
of the string that you'll get back from struct.pack using that format.  Padding 
isn't included after the last entry in the struct.

That's not to say that it was a good design decision, but that's the design 
that was chosen, and it's not realistic to change this for the bugfix releases. 
 It may be possible to do something for Python 3.4.

You can add a '0L' to the end of your struct to force padding bytes at the end. 
 See:

http://docs.python.org/2/library/struct.html#examples

for an example of this.

See also #7189, #5145.

--
nosy: +mark.dickinson
versions: +Python 3.4 -Python 2.6

___
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

2013-04-02 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Apr 02, 2013, at 11:32 AM, Eric V. Smith wrote:

>My suggestion is to have format() be an alias for
>format_string(). Deprecating format() is an optional step, but may not be
>worth the hassle.

Agreed on both counts.

--

___
Python tracker 

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



[issue17617] struct.calcsize() incorrect

2013-04-02 Thread Mark Dickinson

Mark Dickinson added the comment:

And also #7355, which led to that example being added to the documentation.  
Closing as duplicate.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Struct incorrectly compiles format strings

___
Python tracker 

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



[issue17618] base85 encoding

2013-04-02 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox

___
Python tracker 

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



[issue6743] Add function compatible with print to pprint module

2013-04-02 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
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

2013-04-02 Thread Eric V. Smith

Eric V. Smith added the comment:

So I guess the question is: would this be a bug fix and applied to 2.7 and 3.3, 
or just an enhancement for 3.4?

I think it would be a bug fix and thus should be backported. It's not like we'd 
be breaking any working code, unless it was expecting the exception.

--
versions: +Python 3.3, Python 3.4 -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

2013-04-02 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Apr 02, 2013, at 03:04 PM, Eric V. Smith wrote:

>I think it would be a bug fix and thus should be backported. It's not like
>we'd be breaking any working code, unless it was expecting the exception.

That would be my preference.

--

___
Python tracker 

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



[issue13110] test_socket.py failures on ARM

2013-04-02 Thread R. David Murray

R. David Murray added the comment:

For the record I'm seeing this on Gentoo with linux kernel 3.5.3.  Commenting 
out the localhost ipv6 entry lets the test pass, as indicated in the ubuntu bug 
report (which was subsequently closed with no action).

--
nosy: +r.david.murray

___
Python tracker 

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



[issue13163] `port` and `host` are confused in `_get_socket

2013-04-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5d99042bd40f by R David Murray in branch '2.7':
#13163: fix names of _get_socket args
http://hg.python.org/cpython/rev/5d99042bd40f

--
nosy: +python-dev

___
Python tracker 

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



[issue13163] `port` and `host` are confused in `_get_socket

2013-04-02 Thread R. David Murray

R. David Murray added the comment:

Thanks Victor.  I decided not to put in the doc string because Python3 doesn't 
have one.

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

___
Python tracker 

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



[issue17619] input() swallows KeyboardInterrupt in Python 3.3

2013-04-02 Thread Drekin

New submission from Drekin:

At least on Windows, input() doesn't raise KeyboardInterrupt when Ctrl-C is hit 
in Python 3.3 (it does in Python 3.2).

3.3:
>>> x = input() # Ctrl-C hit - no exception raised
>>> x
NameError

3.2:
>>> x = input() # Ctrl-C hit
KeyboardInterrupt

--
messages: 185845
nosy: Drekin
priority: normal
severity: normal
status: open
title: input() swallows KeyboardInterrupt in Python 3.3
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-02 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
stage:  -> needs patch
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue17492] Increase test coverage for random (up to 99%)

2013-04-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2a340f963518 by R David Murray in branch 'default':
#17492: Additional tests for random module.
http://hg.python.org/cpython/rev/2a340f963518

--
nosy: +python-dev

___
Python tracker 

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



[issue17492] Increase test coverage for random (up to 99%)

2013-04-02 Thread R. David Murray

R. David Murray added the comment:

Thanks, Victor.

--
nosy: +r.david.murray
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



[issue17620] Python interactive console doesn't use sys.stdin for input

2013-04-02 Thread Drekin

New submission from Drekin:

The Python interactive console actually doesn't use sys.stdin but standard C 
stdin for input. Is there any reason for this? Why it then uses its encoding 
attribute? (Assigning sys.stdin something, that doesn't have encoding attribute 
freezes the interpreter.) If anything, wouldn't it make more sense if it used 
sys.__stdin__.encoding instead of sys.stdin? sys.stdin is intended to be set by 
user (it affects input() and code.inpterrupt() which tries to minic standard 
interactive console).

--
messages: 185848
nosy: Drekin
priority: normal
severity: normal
status: open
title: Python interactive console doesn't use sys.stdin for input
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue17561] Add socket.create_server_sock() convenience function

2013-04-02 Thread Guido van Rossum

Guido van Rossum added the comment:

Nikolay, you may want to check out this Python tracker issue.

Giampaolo: I didn't even know it was possible for a single socket to be
dual-stack. (It would seem problematic for UDP recvfrom() for example.) In
Tulip it does indeed make more sense to create separate sockets and just
listen on all of them (using the same protocol factory). This can be
completely transparent to the code calling start_serving() and to the
protocol implementation. So if you're brave you can just send a code review
using codereview.appspot.com to the python-tulip list!

On Mon, Apr 1, 2013 at 1:13 PM, Giampaolo Rodola' wrote:

>
> Giampaolo Rodola' added the comment:
>
> Being Tulip asynchronous I think that what it needs is an utility function
> which returns *multiple* sockets as are the addresses returned by
> getaddrinfo() and also possibly even disable the IPv4/6 dual stack in order
> to be consistent across all platforms.
>
> After the sockets are returned they can be "registered" against the event
> loop as two separate entities such as, say, ("0.0.0.0", 8000) *and* ("::",
> 8000).
> If you think this makes sense I can contribute something like this into
> Tulip, or I can bring it up on Tulip's ml and ask for other people's
> opinions.
>
> My current recipe is different in that it provides a function which
> bind()s on one socket only and tries to enable the dual stack whenever
> possible in order to support IPv4 and IPv6 with a single socket.
> In this it is similar to socket.create_connection() and clearly favors
> blocking socket usages (although it can also be used in non-blocking apps)
> which kind of represents the default for the stdlib.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue17489] random.Random implements __getstate__() and __reduce__()

2013-04-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 68ed5b2ca867 by R David Murray in branch 'default':
#17489: Add explanatory comment that __getstate__ is not called.
http://hg.python.org/cpython/rev/68ed5b2ca867

--
nosy: +python-dev

___
Python tracker 

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



[issue6822] Error calling .storlines from ftplib

2013-04-02 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Apparently the doc has already been changed and mentions that a binary file is 
necessary. The unit test is legitimate and can be committed though (Victor, you 
want to do it?).

--

___
Python tracker 

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



[issue17621] Create a lazy import loader mixin

2013-04-02 Thread Brett Cannon

New submission from Brett Cannon:

People keep asking and I keep promising to get a lazy loader into Python 3.4. 
This issue is for me to track what I have done towards meeting that promise.

To start, I have something working at https://code.google.com/p/importers/, but 
I need to make sure that the code copies any newly assigned objects post-import 
but before completing an attribute read::

  import lazy_mod
  lazy_mod.attr = True  # Does not have to trigger import, although there is 
nothing wrong if it did.
  lazy_mod.func()  # Since it might depend on 'attr', don't return attr until 
after import and 'attr' with a value of True has been set.

Also need to see if anything can be done about isinstance/issubclass checks as 
super() is used for assigning to __loader__ and thus might break checks for 
ABCs. Maybe create a class from scratch w/o the mixin somehow (which I don't 
see from looking at http://docs.python.org/3.4/library/types.html#module-types 
w/o re-initializing everything)? Somehow get __subclasscheck__() on the super() 
class? Some other crazy solution that avoids having to call __init__() a second 
time?

--
assignee: brett.cannon
components: Library (Lib)
messages: 185852
nosy: brett.cannon
priority: low
severity: normal
stage: test needed
status: open
title: Create a lazy import loader mixin
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue17621] Create a lazy import loader mixin

2013-04-02 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue17579] socket module in 2.7.4 raises error instead of gaierror in 2.7.3

2013-04-02 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Okay, so this is not a Python problem, but an Ubuntu problem.  It's also not a 
problem with Ubuntu's version of Python.  I can reproduce it on Ubuntu 13.04 
with hg trunk, but not Debian Wheezy with hg trunk.

Closing as invalid and will investigate further in Ubuntu.

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



[issue17606] xml.sax.saxutils.XMLGenerator cannot output with the correct encoding

2013-04-02 Thread Sebastian Ortiz Vasquez

Sebastian Ortiz Vasquez added the comment:

Added new test and patch generated following the python development directions 
found on http://docs.python.org/devguide/patch.html

--
type:  -> crash
Added file: http://bugs.python.org/file29655/XMLGenerator.patch

___
Python tracker 

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



[issue17606] xml.sax.saxutils.XMLGenerator cannot output with the correct encoding

2013-04-02 Thread Sebastian Ortiz Vasquez

Changes by Sebastian Ortiz Vasquez :


Removed file: http://bugs.python.org/file29655/XMLGenerator.patch

___
Python tracker 

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



[issue17606] xml.sax.saxutils.XMLGenerator cannot output with the correct encoding

2013-04-02 Thread Sebastian Ortiz Vasquez

Changes by Sebastian Ortiz Vasquez :


Added file: http://bugs.python.org/file29656/XMLGenerator.patch

___
Python tracker 

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



[issue17621] Create a lazy import loader mixin

2013-04-02 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue5207] extend strftime/strptime format for RFC3339 and RFC2822

2013-04-02 Thread Berker Peksag

Changes by Berker Peksag :


--
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue6822] Error calling .storlines from ftplib

2013-04-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c78dfc6ce37a by Victor Stinner in branch '3.3':
Close #6822: ftplib.FTP.storlines() expects a binary file, not a text file
http://hg.python.org/cpython/rev/c78dfc6ce37a

New changeset 9328e2b8a397 by Victor Stinner in branch 'default':
(Merge 3.3) Close #6822: ftplib.FTP.storlines() expects a binary file, not a 
text file
http://hg.python.org/cpython/rev/9328e2b8a397

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

___
Python tracker 

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



[issue17588] runpy cannot run Unicode path on Windows

2013-04-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

The issue is actually with compile():
  compile('x=1', '\u222b.py', 'exec')
fails on my Western Windows machine (mbcs = cp1252).
This conversion should not be necessary, since the filename is only used for 
error messages (and decoded again!)

But unfortunately the various API functions used by compile() are documented to 
take a filename encoded with the filesystem encoding:
http://docs.python.org/dev/c-api/veryhigh.html#Py_CompileStringExFlags
This API is unfortunate; on Windows Python should never have to convert 
filenames unless bytes strings are explicitly used.

I can see two ways to fix the issue:
- build another set of APIs which take unicode strings for the filename, or at 
least encoded to UTF-8.
- use some trick for unencodable filenames; filename.encode('mbcs', 
'backslashreplace') works, but does not round-trip (and cannot fetch source 
code in tracebacks). I don't know if there is some variant of surrogateescape 
that we could use.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue17588] runpy cannot run Unicode path on Windows

2013-04-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

I have a similar issue with a directory '∫' ('\u222b') containing a file foo.py:

>>> sys.path.insert(0, '\u222b')
>>> import foo
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1564, in _find_and_load
  File "", line 1531, in _find_and_load_unlocked
  File "", line 586, in _check_name_wrapper
  File "", line 1023, in load_module
  File "", line 1004, in load_module
  File "", line 562, in module_for_loader_wrapper
  File "", line 854, in _load_module
  File "", line 981, in get_code
  File "", line 313, in _call_with_frames_removed
UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: 
invalid character

(I got this traceback with "python -v")
line 981 contains a call to compile().

--

___
Python tracker 

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



[issue17588] runpy cannot run Unicode path on Windows

2013-04-02 Thread STINNER Victor

STINNER Victor added the comment:

This issue is a duplicate of the issue #11619. In short: when importing a 
Python module, Python 3.3 only supports paths encodable to the ANSI code page. 
The issue #11619 contains an huge patch to support *any* Unicode character in 
module path. I closed the issue because I consider that nobody needs such 
feature :-)

What is your usecase? Do you really need to support ∫ as *Python* module name 
or a Python script filename? Is Windows able to display this character at least?

--
nosy: +haypo

___
Python tracker 

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



[issue17588] runpy cannot run Unicode path on Windows

2013-04-02 Thread STINNER Victor

Changes by STINNER Victor :


--
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue17607] missed peephole optimization (unnecessary jump at end of function after yield)

2013-04-02 Thread STINNER Victor

STINNER Victor added the comment:

This issue is similar to #17430.

--
nosy: +haypo

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-02 Thread Ethan Furman

Ethan Furman added the comment:

As Ian Kelly said on Python-List:


Micro-benchmarks like the ones [jmf] have been reporting are *useful*
when it comes to determining what operations can be better optimized,
but they are not *important* in and of themselves.  What is important
is that actual, real-world programs are not significantly slowed by
these kinds of optimizations.  Until [it] can demonstrated that real
programs are adversely affected by PEP 393, there is not in my opinion
any regression that is worth worrying over.


I think this issue should be closed.

--
nosy: +stoneleaf

___
Python tracker 

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



[issue17588] runpy cannot run Unicode path on Windows

2013-04-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

No need to use weird characters. Greek or Cyrillic letters are enough.
Suppose I download a library with language modules such as Русский.py or 
Ελληνικά.py; they are allowed as identifiers and can be regularly imported... 
on utf8 system at least.

Actually such a project already exists: 
https://code.google.com/p/hellenic-language-toolkit/
"svn co" will correctly create files (win32 explorer show correct names); when 
importing from IDLE, I get 

>>> import HLT
Traceback (most recent call last):
  File "", line 1, in 
import HLT
  File ".\HLT.py", line 29, in 
from Ελληνικά.Ελληνικά import Ελληνικά
UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: 
invalid character

--

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-02 Thread STINNER Victor

STINNER Victor added the comment:

Compare (Unicode) strings was optimized after the release of Python 3.3.

changeset:   79469:54154be6b27d
user:Victor Stinner 
date:Thu Oct 04 22:59:45 2012 +0200
files:   Objects/unicodeobject.c
description:
Optimize unicode_compare(): use memcmp() when comparing two UCS1 strings

changeset:   79902:b68be1025c42
user:Victor Stinner 
date:Tue Oct 23 02:48:49 2012 +0200
files:   Objects/unicodeobject.c
description:
Optimize PyUnicode_RichCompare() for Py_EQ and Py_NE: always use memcmp()

---

It looks like Python 3.4 is faster than 3.2 for this specific micro-benchmark 
on my computer. So I'm closing the issue.

If you see an interesting optimization, please write a patch and open an issue. 
But complaining that PEP 393 slowed down Unicode does not help at all. PEP 393 
solved a lot of other issues!


3.2.3+ (3.2:d40afd489b6a, Apr  2 2013, 23:46:20) 
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)]
a=['C:/Users/Neil/Documents/b','C:/Users/Neil/Documents/z']176
[0.38440799713134766, 0.38411498069763184, 0.38804006576538086]

a=['C:/Users/Neil/Documents/λ','C:/Users/Neil/Documents/η']176
[0.3850290775299072, 0.38683581352233887, 0.3845059871673584]

a=['C:/Users/Neil/Documents/b','C:/Users/Neil/Documents/η']176
[0.38274407386779785, 0.3805210590362549, 0.38046717643737793]

a=['C:/Users/Neil/Documents/𠀀','C:/Users/Neil/Documents/𠀁']180
[0.3880500793457031, 0.38711094856262207, 0.3869481086730957]



3.3.0+ (3.3:c78dfc6ce37a, Apr  2 2013, 23:48:14) 
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)]
a=['C:/Users/Neil/Documents/b','C:/Users/Neil/Documents/z']108
[0.4134676969842985, 0.4146421169862151, 0.41625474498141557]

a=['C:/Users/Neil/Documents/λ','C:/Users/Neil/Documents/η']192
[0.42760137701407075, 0.42286567797418684, 0.42544596805237234]

a=['C:/Users/Neil/Documents/b','C:/Users/Neil/Documents/η']192
[0.4288683719933033, 0.4251258020522073, 0.4281281529692933]

a=['C:/Users/Neil/Documents/𠀀','C:/Users/Neil/Documents/𠀁']312
[0.40928812394849956, 0.4099267750279978, 0.4107871470041573]



3.4.0a0 (default:9328e2b8a397, Apr  2 2013, 23:46:24) 
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)]
a=['C:/Users/Neil/Documents/b','C:/Users/Neil/Documents/z']108
[0.31218199292197824, 0.30999370804056525, 0.31113169400487095]

a=['C:/Users/Neil/Documents/λ','C:/Users/Neil/Documents/η']192
[0.3712720649782568, 0.37407689797692, 0.3728883999865502]

a=['C:/Users/Neil/Documents/b','C:/Users/Neil/Documents/η']192
[0.36971510702278465, 0.3688076320104301, 0.36580446804873645]

a=['C:/Users/Neil/Documents/𠀀','C:/Users/Neil/Documents/𠀁']312
[0.3653324950719252, 0.3652214870089665, 0.36527683096937835]

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



[issue17390] display python version on idle title bar

2013-04-02 Thread Edmond Burnett

Edmond Burnett added the comment:

Here is a patch to add a more descriptive title to the IDLE editor.

Python  Editor:  - 

--
Added file: http://bugs.python.org/file29657/issue17390_editor_title.patch

___
Python tracker 

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



[issue16061] performance regression in string replace for 3.3

2013-04-02 Thread STINNER Victor

STINNER Victor added the comment:

How can we move this issu forward? I still prefer unicode_2.patch over  
str_replace_1char.patch because the code is simpler and so easier to maintain.

str_replace_1char.patch has a "bug": replace_1char() does not use "pos" for the 
latin1 path.

--

___
Python tracker 

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



[issue15351] Add to unittest.TestCase support for using context managers

2013-04-02 Thread Chris Calloway

Changes by Chris Calloway :


--
nosy: +cbc

___
Python tracker 

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



[issue16754] Incorrect shared library extension on linux

2013-04-02 Thread A.M. Kuchling

A.M. Kuchling added the comment:

I just tried building trunk on MacOS 10.6.8, and make install fails with this 
traceback:

Traceback (most recent call last):
  File "./setup.py", line 2175, in 
main()
  File "./setup.py", line 2170, in main
"Tools/scripts/2to3", "Tools/scripts/pyvenv"]
  File "/Users/akuchling/source/p/cpython/Lib/distutils/core.py", line 148, in 
setup
dist.run_commands()
  File "/Users/akuchling/source/p/cpython/Lib/distutils/dist.py", line 917, in 
run_commands
self.run_command(cmd)
  File "/Users/akuchling/source/p/cpython/Lib/distutils/dist.py", line 936, in 
run_command
cmd_obj.run()
  File "/Users/akuchling/source/p/cpython/Lib/distutils/command/install.py", 
line 566, in run
self.run_command(cmd_name)
  File "/Users/akuchling/source/p/cpython/Lib/distutils/cmd.py", line 313, in 
run_command
self.distribution.run_command(command)
  File "/Users/akuchling/source/p/cpython/Lib/distutils/dist.py", line 936, in 
run_command
cmd_obj.run()
  File 
"/Users/akuchling/source/p/cpython/Lib/distutils/command/install_lib.py", line 
93, in run
outfiles = self.install()
  File "./setup.py", line 2068, in install
self.set_file_modes(outfiles, 0o644, 0o755)
  File "./setup.py", line 2079, in set_file_modes
if filename.endswith(self.shlib_suffix): mode = sharedLibMode
TypeError: endswith first arg must be str or a tuple of str, not NoneType
make: *** [sharedinstall] Error 1

The following patch fixes the traceback, but I don't know why shlib_suffix is 
None.

-> hg diff
diff -r 9328e2b8a397 setup.py
--- a/setup.py  Tue Apr 02 22:13:49 2013 +0200
+++ b/setup.py  Tue Apr 02 19:10:27 2013 -0400
@@ -2076,7 +2076,9 @@
 for filename in files:
 if os.path.islink(filename): continue
 mode = defaultMode
-if filename.endswith(self.shlib_suffix): mode = sharedLibMode
+if (self.shlib_suffix is not None and
+filename.endswith(self.shlib_suffix)):
+mode = sharedLibMode
 log.info("changing mode of %s to %o", filename, mode)
 if not self.dry_run: os.chmod(filename, mode)

--
nosy: +akuchling

___
Python tracker 

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



[issue16757] Faster _PyUnicode_FindMaxChar()

2013-04-02 Thread STINNER Victor

STINNER Victor added the comment:

Related commit:

changeset:   83066:b5d5f422299f
tag: tip
user:Victor Stinner 
date:Wed Apr 03 01:48:39 2013 +0200
files:   Include/unicodeobject.h Lib/test/test_format.py 
Objects/stringlib/unicode_format.h Objects/unicodeobject.c
description:
Add _PyUnicodeWriter_WriteSubstring() function

Write a function to enable more optimizations:

 * If the substring is the whole string and overallocation is disabled, just
   keep a reference to the string, don't copy characters
 * Avoid a call to the expensive _PyUnicode_FindMaxChar() function when
   possible

--

___
Python tracker 

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



[issue16757] Faster _PyUnicode_FindMaxChar()

2013-04-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7132bca093ad by Victor Stinner in branch 'default':
Close #16757: Avoid calling the expensive _PyUnicode_FindMaxChar() function
http://hg.python.org/cpython/rev/7132bca093ad

--
nosy: +python-dev
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



[issue16757] Faster _PyUnicode_FindMaxChar()

2013-04-02 Thread STINNER Victor

STINNER Victor added the comment:

> New changeset 7132bca093ad by Victor Stinner in branch 'default':
> Close #16757: Avoid calling the expensive _PyUnicode_FindMaxChar() function

This changeset is almost the same than unicode_findmaxchar_2.patch. I prefered 
to keep the API unchanged and not call _PyUnicode_FindMaxChar() instead of 
adding a test in the function to exit it.

There is just a minor difference in Python/formatter_unicode.c: the test for 
_PyUnicode_FindMaxChar() is done after the test on format->fill_char (which 
should avoid a call to for _PyUnicode_FindMaxChar() if fill_char is wider than 
the actual buffer).

Thanks Serhiy for your great idea!

--

___
Python tracker 

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



[issue16334] Faster unicode-escape and raw-unicode-escape codecs

2013-04-02 Thread STINNER Victor

STINNER Victor added the comment:

unicode-escape and raw-unicode-escape decoders now use the PyUnicodeWriter API. 
Can you please compare performances of your patch to PyUnicodeWriter API? 
Decoders overallocate the buffer.

According to a comment in the decoder, overallocating is never needed (and will 
be slower). Your patch does not overallocate the buffer. The decoder should 
probably be adjusted to disable overallocation.

Can you please update your patch on the encoder to the last development version?

--

___
Python tracker 

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



[issue16754] Incorrect shared library extension on linux

2013-04-02 Thread Ned Deily

Ned Deily added the comment:

Did you start with a clean build directory and rerun ./configure?  What 
./configure options did you use?  Make sure that an existing install isn't 
getting in the way during a build, particularly with --enable-shared.  With a 
current tip of the default branch, I've built all three standard OS X 
configurations (default unix (non-shared), --enable-shared, and 
--enable-framework) on OS X 10.8 and "make install" succeeds for all of them 
with sysconfig.get_config_var("SHLIB_SUFFIX") returning ".so" as expecting.

--
nosy: +ned.deily

___
Python tracker 

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



[issue17484] add tests for getpass

2013-04-02 Thread R. David Murray

R. David Murray added the comment:

Thomas, did you submit a contributor agreement at PyCon (or after)?  If so I 
need to go bug someone to get the tracker updated.

I'm attaching a slightly modified version of your patch, cleaning up the output 
that was showing up on stdout and using assertWarns rather than monkey patching 
the warnings module.  Oh, and making the with-clause indentation PEP8 
compliant...I wasn't very clear in my review comment about how that was 
supposed to look.

--
Added file: http://bugs.python.org/file29658/getpass_tests.patch

___
Python tracker 

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



[issue17620] Python interactive console doesn't use sys.stdin for input

2013-04-02 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue6743] Add function compatible with print to pprint module

2013-04-02 Thread Éric Araujo

Éric Araujo added the comment:

Antoine: the desired behavior is to have a function with the same signature as 
print (so multiple objects to print are supported), but which calls 
pprint.pformat instead of str.  It lets people monkey-patch builtins.print or 
somemodule.print with pprint.print and get nicer output.  (I rarely use print 
these days, as I work in web applications that use logging and responses, but 
in many other cases people use print and might want a quick way to make it 
pretty-print.)

--

___
Python tracker 

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



[issue17619] input() swallows KeyboardInterrupt in Python 3.3

2013-04-02 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

Seems to be windows specific. It works fine on Linux and Solaris.

--
nosy: +jcea

___
Python tracker 

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



[issue17619] MS WINDOWS: input() swallows KeyboardInterrupt in Python 3.3

2013-04-02 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
title: input() swallows KeyboardInterrupt in Python 3.3 -> MS WINDOWS: input() 
swallows KeyboardInterrupt in Python 3.3

___
Python tracker 

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



[issue17583] IDLE HOWTO

2013-04-02 Thread Éric Araujo

Éric Araujo added the comment:

This is a great idea, thank you.

FYI You can share text and images with a diff file: if you call “hg add 
path/to/images” and create the diff with the --git option, it will use an 
extended unified diff format which includes binary changes.  Our review system 
is not compatible with that format though, so you can simply attach the files 
here.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue8913] Document that datetime.__format__ is datetime.strftime

2013-04-02 Thread Éric Araujo

Éric Araujo added the comment:

Ezio, you are the latest reviewer, do you have outstanding comments?

--

___
Python tracker 

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



[issue17583] IDLE HOWTO

2013-04-02 Thread Amit Saha

Amit Saha added the comment:

Hello Éric Araujo, thanks. Oh I thought it did support, and hence I created the 
diff in exactly the way you mention.

i also went ahead and tested it by 'hg import' -ing it into a cpython clone and 
i was all excited to see all my images there :-)

But, yeah I can certainly attach the images separately.

--

___
Python tracker 

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



[issue17618] base85 encoding

2013-04-02 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue17618] base85 encoding

2013-04-02 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
keywords: +easy

___
Python tracker 

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



[issue17619] MS WINDOWS: input() swallows KeyboardInterrupt in Python 3.3

2013-04-02 Thread STINNER Victor

STINNER Victor added the comment:

It may be related to the following commit:

changeset:   77861:9523c122d6fc
user:Tim Golden 
date:Fri Jun 29 18:39:26 2012 +0100
files:   Parser/myreadline.c
description:
Issue #1677: Handle better a race condition between the interactive interpreter 
and
the Ctrl-C signal handler on Windows

--
nosy: +haypo, tim.golden

___
Python tracker 

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



[issue17619] MS WINDOWS: input() swallows KeyboardInterrupt in Python 3.3

2013-04-02 Thread STINNER Victor

STINNER Victor added the comment:

@Drekin: What is your Windows version? How did you start Python?

--

___
Python tracker 

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



[issue17561] Add socket.create_server_sock() convenience function

2013-04-02 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue17614] IDLE - quickly closing a large file triggers a traceback

2013-04-02 Thread Roger Serwy

Roger Serwy added the comment:

Updated patch based on Ezio's comments. Thank you, Ezio!

Senthil, I wish I had a Mac to test against. I am able to trigger the bug on 
Win7 with 3.3.

Without objection, I will commit the patch in the upcoming hours.

--
assignee:  -> roger.serwy
Added file: http://bugs.python.org/file29659/issue17614_rev1.patch

___
Python tracker 

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



[issue17609] IDLE: Remove config option 'editor on startup' and utilize command line options only

2013-04-02 Thread Sean Wolfe

Sean Wolfe added the comment:

fwiw, I like the configuration option. I tend to set idle to editor only, but 
the configuration option is useful to me.

--
nosy: +seanfelipewolfe

___
Python tracker 

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



[issue17614] IDLE - quickly closing a large file triggers a traceback

2013-04-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1e5e497ee33b by Roger Serwy in branch '2.7':
#17614: IDLE no longer raises exception when quickly closing a file.
http://hg.python.org/cpython/rev/1e5e497ee33b

New changeset d759b7bc9785 by Roger Serwy in branch '3.3':
#17614: IDLE no longer raises exception when quickly closing a file.
http://hg.python.org/cpython/rev/d759b7bc9785

New changeset 578edbe38f0a by Roger Serwy in branch 'default':
#17614: merge with 3.3.
http://hg.python.org/cpython/rev/578edbe38f0a

--
nosy: +python-dev

___
Python tracker 

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



[issue17614] IDLE - quickly closing a large file triggers a traceback

2013-04-02 Thread Roger Serwy

Changes by Roger Serwy :


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



[issue17609] IDLE: Remove config option 'editor on startup' and utilize command line options only

2013-04-02 Thread Todd Rovito

Todd Rovito added the comment:

Thanks for the feedback I am good with closing but want to check with Roger 
because he suggested that we open a new issue to discuss.

--

___
Python tracker 

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



[issue17060] IDLE -- jump to home should not go past the PS1 and PS2 prompts

2013-04-02 Thread Roger Serwy

Roger Serwy added the comment:

When using the IDLE Classic OSX key set, the "beginning-of-line" virtual event 
gets bound to . Using this key set I can repeat the behavior 
that Raymond observed.

The .home_callback() in Lib/idlelib/EditorWindow.py contains the logic from 
#3851 for placing the cursor at the beginning of the prompt, but it requires 
that a key combination be bound to the beginning-of-line virtual event.

Should we append " " to the begining-of-line config in 
Lib/idlelib/config-keys.def ?

--
nosy: +roger.serwy
type: behavior -> enhancement
versions: +Python 3.4 -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



[issue14254] IDLE - shell restart or closing during readline does not exit nested event loop

2013-04-02 Thread Roger Serwy

Roger Serwy added the comment:

Ned, I was reading the dev guide more closely about the meaning of the "commit 
review" stage. Would it be ok to place this issue into that stage with your 
test result?

--

___
Python tracker 

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



[issue14254] IDLE - shell restart or closing during readline does not exit nested event loop

2013-04-02 Thread Ned Deily

Ned Deily added the comment:

Sure, or just go ahead and commit it. LGTM.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue17609] IDLE: Remove config option 'editor on startup' and utilize command line options only

2013-04-02 Thread Roger Serwy

Roger Serwy added the comment:

Todd, thank you for opening this issue. Given the feedback, it looks like we 
should keep the configuration. Feel free to close the issue.

--

___
Python tracker 

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



[issue17615] String comparison performance regression

2013-04-02 Thread Neil Hodgson

Neil Hodgson added the comment:

The common cases are likely to be 1:1, 2:2, and 1:2. There is already a 
specialisation for 1:1. wmemcmp is widely available but is based on wchar_t so 
is for different widths on Windows and Unix. On Windows it would handle the 2:2 
case.

--

___
Python tracker 

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



[issue17609] IDLE: Remove config option 'editor on startup' and utilize command line options only

2013-04-02 Thread Todd Rovito

Changes by Todd Rovito :


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



[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2013-04-02 Thread paul j3

paul j3 added the comment:

The 'args=' parameter is the same as the first positional parameter used in 
most of the examples.  That is normal Python behavior.

15.4.4.5. Beyond sys.argv
explains this alternative way of specifying argv.

Still 2 bullet points could be added to 15.4.4.

- args - A list of strings, default is sys.argv[1:] (link to 15.4.4.5.)
- namespace - A Namespace object, default is a new Namespace (link to 15.4.4.6.)

Maybe a 15.4.4.5. example using args=['1', '2', '3', '4'] would also be helpful.

--
nosy: +paul.j3

___
Python tracker 

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



[issue17206] Py_XDECREF() expands its argument multiple times

2013-04-02 Thread Illia Polosukhin

Illia Polosukhin added the comment:

Fixed Py_DECREF and Py_CLEAR as well. 

Added tests for Py_INCREF and Py_XINCREF (if somebody has a better idea how to 
tests that INCREF doesn't leak - please, let me know).

Removed comment that Py_DECREF evaluate it's argument multiple times as not 
relevant anymore.

About considerations from performance point of view - I've made toy example 
(only this defines and main function) to test how gcc optimizer behaves in 
different cases - from what I see, if expression is like this (which is 
majority of cases in the code):
 PyObject* obj = Foo();
 Py_XDECREF(obj)

assembly code that will be produced (with -O3) is the same before and after 
patch.

--
Added file: http://bugs.python.org/file29660/17206-3.diff

___
Python tracker 

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



[issue14254] IDLE - shell restart or closing during readline does not exit nested event loop

2013-04-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 097554712637 by Roger Serwy in branch '2.7':
#14254: IDLE now handles readline correctly across shell restarts.
http://hg.python.org/cpython/rev/097554712637

New changeset 0be85a7fc839 by Roger Serwy in branch '3.3':
#14254: IDLE now handles readline correctly across shell restarts.
http://hg.python.org/cpython/rev/0be85a7fc839

New changeset 4b4f142befea by Roger Serwy in branch 'default':
#14254: merge with 3.3.
http://hg.python.org/cpython/rev/4b4f142befea

--
nosy: +python-dev

___
Python tracker 

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



[issue14254] IDLE - shell restart or closing during readline does not exit nested event loop

2013-04-02 Thread Roger Serwy

Changes by Roger Serwy :


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



[issue15348] IDLE - shell becomes unresponsive if debugger windows is closed while active.

2013-04-02 Thread Roger Serwy

Changes by Roger Serwy :


--
assignee:  -> roger.serwy
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue6743] Add function compatible with print to pprint module

2013-04-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Antoine: the desired behavior is to have a function with the same
> signature as print (so multiple objects to print are supported), but
> which calls pprint.pformat instead of str.

But it can't work. pprint() uses all the width for a single object. How
are you supposed to print multiple objects?

--

___
Python tracker 

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



[issue14576] IDLE: resolving home directory for configuration uses HOMEDRIVE, HOMEPATH, and USERPROFILE inconsistently on Windows.

2013-04-02 Thread Roger Serwy

Roger Serwy added the comment:

This issue triggers the problem described in #13582. It points out problems 
with IDLE's configuration manager w.r.t. determining the home directory. I 
changed the title so that it reflects that point.

--
title: IDLE: closes when writing warnings on Windows -> IDLE: resolving home 
directory for configuration uses HOMEDRIVE, HOMEPATH, and USERPROFILE 
inconsistently on Windows.

___
Python tracker 

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



[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2013-04-02 Thread paul j3

paul j3 added the comment:

This patch to argparse.rst adds the argument points to parse_args().  

It also adds two points to the 'Upgrading optparse code' section, one about 
using 'nargs=argparse.REMAINDER', and other about 'parse_known_args()'.

I'm not entirely happy with the format of the internal hyperlinks.

--
keywords: +patch
Added file: http://bugs.python.org/file29661/remainder.patch

___
Python tracker 

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



[issue8913] Document that datetime.__format__ is datetime.strftime

2013-04-02 Thread Eric V. Smith

Eric V. Smith added the comment:

My only suggestion would be that the datetime example would be better if it 
actually used a time portion, similar to the strftime example above it. 
Otherwise, it looks good.

--

___
Python tracker 

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