[issue22458] Add fractions benchmark

2014-09-22 Thread Stefan Behnel

New submission from Stefan Behnel:

Fractions are great for all sorts of exact computations (including 
money/currency calculations), but are quite slow due to the need for 
normalisation at instantiation time.

I adapted the existing telco benchmark to use Fraction instead of Decimal to 
make this problem more visible. One change I made was to take the data reading 
out of the measured loop. I/O is not part of what the benchmark should measure.

Please consider adding it to the benchmark suite.

--
components: Benchmarks
files: telco_fractions.py
messages: 227252
nosy: scoder
priority: normal
severity: normal
status: open
title: Add fractions benchmark
type: enhancement
Added file: http://bugs.python.org/file36684/telco_fractions.py

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



[issue22457] load_tests not invoked in root __init__.py when start=package root

2014-09-22 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +ezio.melotti, michael.foord

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



[issue22458] Add fractions benchmark

2014-09-22 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
nosy: +mark.dickinson

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



[issue22278] urljoin duplicate slashes

2014-09-22 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I addressed Antoine's comments with the patch and committed it. Thank you!

--
assignee:  - orsenthil
resolution:  - fixed
status: open - closed

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



[issue22118] urljoin fails with messy relative URLs

2014-09-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 901e4e52b20a by Senthil Kumaran in branch 'default':
Issue #22278: Fix urljoin problem with relative urls, a regression observed
https://hg.python.org/cpython/rev/901e4e52b20a

--

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



[issue22278] urljoin duplicate slashes

2014-09-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 901e4e52b20a by Senthil Kumaran in branch 'default':
Issue #22278: Fix urljoin problem with relative urls, a regression observed
https://hg.python.org/cpython/rev/901e4e52b20a

--
nosy: +python-dev

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



[issue22458] Add fractions benchmark

2014-09-22 Thread Stefan Behnel

Stefan Behnel added the comment:

I just thought that it might also be nice to have a direct comparison with 
Decimal, so here's an updated benchmark that has an option --use-decimal to 
run the same code with Decimal instead of Fraction.

Decimal is about 66x faster with Py3.4 on my side (due to the C implementation).

--
Added file: http://bugs.python.org/file36685/bm_telco_fractions.py

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



[issue22459] str.strip() documentation: wrong example

2014-09-22 Thread SebKL

New submission from SebKL:

The following example is wrong:
https://docs.python.org/3.4/library/stdtypes.html?highlight=split#str.split

 '1,2,3'.split(',', maxsplit=1)
['1', '2 3']

Is actually returning (note the missing , ):
 '1,2,3'.split(',', maxsplit=1)
['1', '2,3']

--
assignee: docs@python
components: Documentation
messages: 227257
nosy: SebKL, docs@python
priority: normal
severity: normal
status: open
title: str.strip() documentation: wrong example
type: enhancement
versions: Python 3.4, Python 3.5

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



[issue22459] str.strip() documentation: wrong example

2014-09-22 Thread Raúl Cumplido

Raúl Cumplido added the comment:

As it is a simple one I will try to submit a patch today or tomorrow. This will 
be my first contribution to Python.

--
nosy: +raulcd

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



[issue12006] strptime should implement %V or %u directive from libc

2014-09-22 Thread Alex Willmer

Alex Willmer added the comment:

Alexander, 

http://bugs.python.org/file36417/12006_3.5_complete.patch updates the previous 
patches and is ready for review. Unit tests pass as of today. 

Regards, Alex W.

--
nosy: +Alex.Willmer

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



[issue22460] idle editor: replace all in selection

2014-09-22 Thread bagrat lazaryan

New submission from bagrat lazaryan:

say, for renaming a variable in a block of code, or in a function, or renaming 
a method name in a class, etc. nothing fancy here, a button in the replace 
dialog will do.
i think the proposed functionality is needed much more often than the currently 
implemented replacing within the whole file.

--
components: IDLE
messages: 227260
nosy: bagratte
priority: normal
severity: normal
status: open
title: idle editor: replace all in selection
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5

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



[issue22433] Argparse considers unknown optional arguments with spaces as a known positional argument

2014-09-22 Thread Денис Кореневский

Денис Кореневский added the comment:

There is an standard way to solve this ambiguity.

There is a special marker '--' used to force argument parsing function treat 
all arguments given in command after this marker as positional arguments. It 
was invented specially for tasks where you need to force argument parsing 
engine ignore option indicator and treat argument as positional.

I know this argument as standard 'de facto', but can't find any documents about 
'--' interpretation.
But you can see, that Linux 'libc' standard C library function getopt() knows 
about this flag:
http://linux.die.net/man/3/getopt
So, any utility using this function knows about '--'.

For example: grep, tee, cat, tail, head, vim, less, rm, rmdir, common shells 
(sh, bash, csh, dash, ...) and so on. The list is large. Almost any utility 
except special ones like 'echo' which main function is to print any argument 
given to utility.

So, I think, that the true way here is to parse all arguments staring with 
'-'/'--' and listed before special '--' marker as optional, and treat all of 
arguments listed after '--' as positional ones and do not try to use any 
secondary indicators to make a decision: 'optional' or not.


For example:

any parameter before '--' special marker starting with '--' is treated as 
optional
# python3 example.py --bar=one two xxx
(Namespace(pos='xxx'), ['--bar=one two'])

all parameters after '--' special marker are treated as positional
# python3 example.py -- --bar=one two xxx
(Namespace(pos='--bar=one two'), ['xxx'])


Yes, my patch does not the solution and argparse should be patched another way.

Where and how can I get unittests for argparse module to check my code 
modifications before posting them here? I want to try to modify argparse and 
produce the patch changing argparse behaviour as described above.

Thanks.

--

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



[issue22445] Memoryviews require more strict contiguous checks then necessary

2014-09-22 Thread Stefan Krah

Stefan Krah added the comment:

Since the functions in abstract.c have been committed by Travis Oliphant:

Could there have been a reason why the {shape=[1], strides=[-5]}
case was considered but the general case was not?


Or is it generally accepted among the numpy devs that not considering
the general case was just an oversight?

--

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



[issue22445] Memoryviews require more strict contiguous checks then necessary

2014-09-22 Thread Sebastian Berg

Sebastian Berg added the comment:

Yeah, the code does much the same as the old numpy code (at least most of the 
same funny little things, though I seem to remember the old numpy code had 
something yet a bit weirder, would have to check).

To be honest, I do not know. It isn't implausible that the original numpy code 
dates back 15 years or more to numeric. I doubt whoever originally wrote it 
thought much about it, but there may be some good reason, and there is the 
safety considerations that people use the strides in a way they should not, 
which may trip us here in any case.

--

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



[issue22458] Add fractions benchmark

2014-09-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Where are Fractions used in the real world?

--
nosy: +pitrou, skrah

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



[issue22458] Add fractions benchmark

2014-09-22 Thread Stefan Behnel

Stefan Behnel added the comment:

As I said, where ever exact calculations are needed. I use them for currency 
calculations, for example, as they inherently avoid rounding errors during the 
calculations regardless of the relative size of values. They are basically like 
Decimal but with arbitrary precision.

--

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



[issue22458] Add fractions benchmark

2014-09-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 22/09/2014 14:51, Stefan Behnel a écrit :
 
 I use them for currency calculations, for example,
 as they inherently avoid rounding errors during the
 calculations regardless of the relative size of values.

Do other people use them for that purpose, or are you
the only one?

--

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



[issue22461] Test failure: Lib/test/test_pydoc.py line 851, topic?key=def

2014-09-22 Thread Larry Hastings

New submission from Larry Hastings:

I get a test failure in the regression test suite.  This appears to be the 
important bit:

Traceback (most recent call last):
  File /tmp/Python-3.4.2rc1/Lib/test/test_pydoc.py, line 851, in 
test_url_requests
self.assertEqual(result, title, text)
AssertionError: 'Pydoc: Error - topic?key=def' != 'Pydoc: KEYWORD def'
- Pydoc: Error - topic?key=def
+ Pydoc: KEYWORD def

I can ship 3.4.2rc1 like this, but I'd really like this fixed before 3.4.2 
final.

Does anybody own pydoc?  There's no expert listed on the Python Experts page.

(Adding you, Georg, because you're the DE.)

--
messages: 227267
nosy: georg.brandl, larry
priority: deferred blocker
severity: normal
stage: needs patch
status: open
title: Test failure: Lib/test/test_pydoc.py line 851, topic?key=def
type: behavior
versions: Python 3.4

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



[issue22461] Test failure: Lib/test/test_pydoc.py line 851, topic?key=def

2014-09-22 Thread Georg Brandl

Georg Brandl added the comment:

I have no idea about that code, and I can't reproduce the failure.

(Could the buildbots?)

--

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



[issue22458] Add fractions benchmark

2014-09-22 Thread Stefan Behnel

Stefan Behnel added the comment:

I admit that I keep meeting developers who are not aware of their merits, 
simply because many other programming languages don't have them available. 
Specifically, many developers with a Java background firmly believe that 
BigDecimal is the only way to do money calculations. That's clearly wrong, and 
the heap of (Big-)Decimal bugs in their software that I've been fixing over the 
years shows just how wrong it is. Using Fractions would have avoided most of 
them. Decimal is surprisingly difficult to use right, Fractions are actually 
difficult to get wrong. They are a major feature of the standard library.

Your question is another good indication that the general awareness for them 
still needs to be raised. I'm not entirely sure how this relates to this 
ticket, though. I doubt that you are seriously suggesting that I am the only 
person using a module in the stdlib, so what exactly are you trying to say?

--

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



[issue22461] Test failure: Lib/test/test_pydoc.py line 851, topic?key=def

2014-09-22 Thread R. David Murray

R. David Murray added the comment:

I can't reproduce it either, and none of the failing stable buildbots show this 
error.  Unfortunately we can only look at tip since we can't see your tag yet.  
But I doubt that's the issue...the last commit to pydoc or its tests was on the 
17th, and was a one line change in an unrelated area.  Last change before that 
was in June.

--
nosy: +r.david.murray

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



[issue22461] Test failure: Lib/test/test_pydoc.py line 851, topic?key=def

2014-09-22 Thread Larry Hastings

Larry Hastings added the comment:

FWIW, 3.4.2rc1 is based on 7af0315bdfe0.  (The release process creates a couple 
additional changesets.)

The failure is on my laptop, Ubuntu 14.04 x64.

--

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



[issue22461] Test failure: Lib/test/test_pydoc.py line 851, topic?key=def

2014-09-22 Thread R. David Murray

R. David Murray added the comment:

No failure running test_pydoc for me on gentoo linux with that changeset.

--

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



[issue22278] urljoin duplicate slashes

2014-09-22 Thread Demian Brecht

Demian Brecht added the comment:

Heh, I'd finally gotten a few minutes to address the comments... And it's 
already taken care of ;) Thanks Senthil.

--

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



[issue12006] strptime should implement %V or %u directive from libc

2014-09-22 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I find this footnote somewhat confusing:


(8) Similar to %U and %W, %V is only used in calculations when the day of the 
week and the ISO year (%G) are specified when used with the strptime method.


The existing footnote (7) is much clearer:


(7) When used with the strptime() method, %U and %W are only used in 
calculations when the day of the week and the year are specified.


Why not use the same language in (8)?


(7) When used with the strptime() method, %V is only used in calculations when 
the day of the week and the ISO year (%G) are specified.



--
nosy: +tim.peters

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



[issue12006] strptime should implement %V or %u directive from libc

2014-09-22 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

How was %Y %V issue resolved?  I don't see any tests for this case.

--

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



[issue22458] Add fractions benchmark

2014-09-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

My point is that if fractions are little used right now, there's little point 
in adding a benchmark about them in the official benchmark suite. The 
benchmark suite does not aim at measuring every possible aspect of Python 
performance, but at showcasing representative workloads.

--

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



[issue22444] Floor divide should return int

2014-09-22 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

[Raymond]
 The current behavior has been around for a long time and is implemented in 
 several modules including decimal and fractions.

No, in the fractions module floor division returns an int:

 type(Fraction(2) // Fraction(1))
class 'int'

It is also implemented in the datetime module where

 type(timedelta(2) // timedelta(1))
class 'int'


[Raymond]
# Here is a simple example of a chain of calculations 
# where preserving the type matters
..

def f(x, y):
return x // 3 * 5 / 7 + y

def g(x, y):
return int(x // 3) * 5 / 7 + y
[/Raymond]

I am not sure what is the problem here.  In Python 3:

 f(12.143, 0.667)
3.5241428571428575
 g(12.143, 0.667)
3.5241428571428575

--

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



[issue22462] Modules/pyexpat.c violates PEP 384

2014-09-22 Thread Mark Shannon

New submission from Mark Shannon:

Modules/pyexpat.c includes some archaic code to create temporary frames
so that, in even of an exception being raised, expat appears in the traceback.

The way this is implemented is a problem for three reasons:

1. It violates PEP 384.
2. It  is incorrect, see http://bugs.python.org/issue6359.
3. It is inefficient, as a frame is generated for each call, regardless of 
whether an exception is raised or not.

The attached patch fixes these issues.

--
components: Library (Lib)
files: expat.patch
keywords: patch
messages: 227278
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Modules/pyexpat.c violates PEP 384
versions: Python 3.5
Added file: http://bugs.python.org/file36686/expat.patch

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



[issue22462] Modules/pyexpat.c violates PEP 384

2014-09-22 Thread Mark Shannon

Changes by Mark Shannon m...@hotpy.org:


--
nosy: +nedbat

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



[issue22444] Floor divide should return int

2014-09-22 Thread Mark Dickinson

Mark Dickinson added the comment:

-1 from me, too.  It's an unnecessary change, and the conversion from float to 
integer potentially expensive compared to the computation of the floating-point 
result (especially in extended floating-point implementations that allow a 
wider exponent range).

If this is about consistency between `//` and `math.floor`, I'd much rather see 
`math.floor` go back to returning a float instead of an int.

--
nosy: +mark.dickinson

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



[issue22458] Add fractions benchmark

2014-09-22 Thread Mark Dickinson

Mark Dickinson added the comment:

I've always viewed the `Fraction` type as more of a teaching tool than 
something intended for real-world calculations.  If that's not how others see 
it, then it might be worth investing some effort in reimplementing 
`Fractions.gcd` in C: the `Fraction` type is almost unusably slow for serious 
work, and the gcd computations are a clear bottleneck. I've experimented in the 
past with a C-based implementation of Lehmer's algorithm for gcd computation, 
getting around a ten-fold speedup.

--

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



[issue22444] Floor divide should return int

2014-09-22 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

[Raymond]
 The PEP should be revised to say that floor division is defined to 
 return a value that is *equal* to an Integral but not place any
 restriction on the return type.

If we take this route, what float('inf') // 1 and float('nan') // 1 should 
return?

--

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



[issue22444] Floor divide should return int

2014-09-22 Thread Mark Dickinson

Mark Dickinson added the comment:

 If we take this route, what float('inf') // 1 and float('nan') // 1 should 
 return?

Probably exactly the same as they do right now.  I think there's an argument 
that `float('inf') // 1` should have been `float('inf')`.  But I'm not sure 
there's much of a case for *changing* the current return value.

--

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



[issue22463] Warnings when building on AIX

2014-09-22 Thread Julien ÉLIE

New submission from Julien ÉLIE:

Building Python 2.7.8 on AIX 7.1 gives the following warnings:

Parser/pgen.c:282:9: warning: variable 'i' set but not used 
[-Wunused-but-set-variable]
Include/objimpl.h:164:66: warning: right-hand operand of comma expression has 
no effect [-Wunused-value]
/home/iulius/autobuild/src/Python-2.7.8/Modules/cPickle.c:4495:8: warning: 
assuming signed overflow does not occur when assuming that (X - c)  X is 
always false [-Wstrict-overflow]
/home/iulius/autobuild/src/Python-2.7.8/Modules/cPickle.c:202:8: warning: 
assuming signed overflow does not occur when assuming that (X - c)  X is 
always false [-Wstrict-overflow]
/home/iulius/autobuild/src/Python-2.7.8/Modules/readline.c:777:1: warning: 
'on_completion_display_matches_hook' defined but not used [-Wunused-function]
./pyconfig.h:1182:0: warning: _POSIX_C_SOURCE redefined
./pyconfig.h:1204:0: warning: _XOPEN_SOURCE redefined
/home/iulius/autobuild/src/Python-2.7.8/Modules/tkappinit.c:29:15: warning: 
variable 'main_window' set but not used [-Wunused-but-set-variable]
/home/iulius/autobuild/src/Python-2.7.8/Modules/_ctypes/ctypes.h:456:13: 
warning: 'capsule_destructor_CTYPES_CAPSULE_WCHAR_T' defined but not used 
[-Wunused-function]
/home/iulius/autobuild/src/Python-2.7.8/Modules/_ctypes/cfield.c:50:29: 
warning: variable 'length' set but not used [-Wunused-but-set-variable]
/home/iulius/autobuild/src/Python-2.7.8/Modules/_ctypes/ctypes.h:456:13: 
warning: 'capsule_destructor_CTYPES_CAPSULE_WCHAR_T' defined but not used 
[-Wunused-function]

--
components: Build
messages: 227283
nosy: jelie
priority: normal
severity: normal
status: open
title: Warnings when building on AIX
type: compile error
versions: Python 2.7

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Stefan Behnel

New submission from Stefan Behnel:

Fractions are an excellent way to do exact money calculations and largely beat 
Decimal in terms of simplicity, accuracy and safety. Clearly not in terms of 
speed, though.

The current implementation does some heavy type checking and dispatching in 
__new__() and a simplistic gcd based normalisation. Here is a profiling run 
from the benchmark proposed in issue 22458 (which matches more or less the 
results with my own code):

 6969671 function calls (6969278 primitive calls) in 4.835 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   5196441.3240.0002.9280.000 fractions.py:73(__new__)
   5196320.6540.0000.6540.000 fractions.py:17(gcd)
   3197440.6370.0002.6940.000 fractions.py:400(_add)
  10392600.5070.0000.9500.000 abc.py:178(__instancecheck__)
40.4590.1154.8211.205 bm_telco_fractions.py:38(run)
  10393000.4430.0000.4430.000 _weakrefset.py:70(__contains__)
   5196160.3010.0004.3290.000 fractions.py:373(forward)
   1998720.2720.0001.3350.000 fractions.py:416(_mul)
  15987200.1170.0000.1170.000 fractions.py:278(denominator)
   9592320.0740.0000.0740.000 fractions.py:274(numerator)

The instantiation itself takes twice as much time as the gcd calculations, and 
both dominate the overall runtime of the benchmark by about 60%. Improving the 
instantiation time would thus bring a substantial benefit.

--
components: Library (Lib)
messages: 227284
nosy: scoder
priority: normal
severity: normal
status: open
title: Speed up fractions implementation
versions: Python 3.5

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



[issue22458] Add fractions benchmark

2014-09-22 Thread Stefan Behnel

Stefan Behnel added the comment:

Speed improvements for fractions should have their own ticket(s). I created 
issue 22464 for this.

--

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



[issue22461] Test failure: Lib/test/test_pydoc.py line 851, topic?key=def

2014-09-22 Thread Zachary Ware

Zachary Ware added the comment:

R. David Murray wrote (on python-committers):
 So...Larry broke it, but it is not obvious how.  Could it be something
 wrong with the pydoc topics update for the release?

Indeed, it looks like somehow the pydoc-topics update turned all of the values 
in the topics dict into bytes literals rather than plain strings.

Unfortunately, I don't have the right setup currently to look into it further, 
but my best guess would be that perhaps the pydoc-topics Sphinx builder needs 
an update for Python 3?

--
nosy: +zach.ware

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



[issue22461] Test failure: Lib/test/test_pydoc.py line 851, topic?key=def

2014-09-22 Thread Georg Brandl

Georg Brandl added the comment:

That is very likely the reason. So far nobody has run the builder with Python 3.

--

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



[issue22461] Test failure: Lib/test/test_pydoc.py line 851, topic?key=def

2014-09-22 Thread Ned Deily

Ned Deily added the comment:

Duplicate of Issue21431?

--
nosy: +ned.deily

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



[issue22461] Test failure: Lib/test/test_pydoc.py line 851, topic?key=def

2014-09-22 Thread Georg Brandl

Georg Brandl added the comment:

Yep.

--
resolution:  - duplicate
status: open - closed
superseder:  - 3.4.1rc1 test_pydoc fails: pydoc_data.topics.topics values are 
type bytes not str

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Stefan Behnel

Stefan Behnel added the comment:

Adding Mark Dickinson to the noisy list who mentioned having worked on a C 
implementation for gcd(). I think this would be a good thing to try. However, 
the most important part would be to restructure and specialise 
Fraction.__new__().

--
nosy: +mark.dickinson

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



[issue22458] Add fractions benchmark

2014-09-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 Where are Fractions used in the real world?

For example Andrew Svetlov uses them in his online game [1]. May be it will 
explain this in detail.

[1] http://asvetlov.blogspot.com/2012/08/numerics.html (on Russian).

--
nosy: +asvetlov, serhiy.storchaka

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



[issue18629] future division breaks timedelta division by integer

2014-09-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
status: open - pending

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Stefan Behnel

Stefan Behnel added the comment:

Here is a straight forward patch that special cases int values in the 
constructor. It gives me a 35% speedup in the benchmark.

--
keywords: +patch
Added file: http://bugs.python.org/file36687/special_case_int.patch

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


--
type:  - performance

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



[issue21431] 3.4.1rc1 test_pydoc fails: pydoc_data.topics.topics values are type bytes not str

2014-09-22 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


--
nosy: +zach.ware

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



[issue22463] Warnings when building on AIX

2014-09-22 Thread David Edelsohn

Changes by David Edelsohn dje@gmail.com:


--
nosy: +David.Edelsohn

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Stefan Behnel

Stefan Behnel added the comment:

Updated patch - there is a somewhat hidden attempt in the code to keep 
nominator and denominater plain int values, not subtypes. That means that it's 
safer to restrict the optimisation to plain ints as well, which should still 
hit 95% of the use cases.

--
Added file: http://bugs.python.org/file36688/special_case_int2.patch

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



[issue22396] AIX posix_fadvise and posix_fallocate

2014-09-22 Thread David Edelsohn

David Edelsohn added the comment:

Any feedback about which approach would be acceptable?

--

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


Added file: http://bugs.python.org/file36689/special_case_int3.patch

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What speedup give you second change?

--
nosy: +serhiy.storchaka

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



[issue21431] 3.4.1rc1 test_pydoc fails: pydoc_data.topics.topics values are type bytes not str

2014-09-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d71c351a6a0f by Georg Brandl in branch '3.4':
Closes #21431: make docs depend on Sphinx 1.2 and fix pydoc-topics builder to
https://hg.python.org/cpython/rev/d71c351a6a0f

--
nosy: +python-dev
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

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



[issue21431] 3.4.1rc1 test_pydoc fails: pydoc_data.topics.topics values are type bytes not str

2014-09-22 Thread Georg Brandl

Georg Brandl added the comment:

Should be fixed now. I didn't merge into default since someone (cough) has to 
null-merge all the release related stuff first.

--

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Stefan Behnel

Stefan Behnel added the comment:

The second isn't a big difference because it only hits plain instantiations 
from integers. They are less likely to be performance critical than those from 
a quotient, which happen for all calculations.

It's more for symmetry, I guess.

--

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Stefan Behnel

Stefan Behnel added the comment:

I found one more place where special casing helps: equal comparisons to 
integers, e.g. f == 0 or f == 1 or so. timeit shows me a speedup by a factor of 
three for this, with only a tiny slow-down when comparing fractions on both 
sides.

I put all of them in one patch, deselecting after applying should be easy 
enough.

--
Added file: http://bugs.python.org/file36690/special_case_int4.patch

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Microbenchmarks show about 2x speedup in both cases.

The patch LGTM.

--

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



[issue22444] Floor divide should return int

2014-09-22 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Mark,

Raymond suggested that The PEP 3141 should be revised to say that floor 
division is defined to return a value that is *equal* to an Integral.

Since nan or inf are not *equal* to any Integral, the current implementation 
does not comply.  In the absence of a recommendation in the PEP, implementers 
of new numeric types are left with little guidance because existing types are 
inconsistent:

 Decimal('inf') // 1
Decimal('Infinity')
 float('inf') // 1
nan

--

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Stefan Behnel

Stefan Behnel added the comment:

Benchmark profile after the patch:

 5930670 function calls (5930288 primitive calls) in 3.748 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   5196320.8280.0000.8280.000 fractions.py:17(gcd)
   5196440.8060.0001.7000.000 fractions.py:73(__new__)
   3197440.6300.0001.9830.000 fractions.py:408(_add)
40.3930.0983.7350.934 bm_telco_fractions.py:38(run)
   5196160.2770.0003.3160.000 fractions.py:381(forward)
   1998720.2750.0000.9010.000 fractions.py:424(_mul)
  15987200.1610.0000.1610.000 fractions.py:285(denominator)
   5202570.1550.0000.1550.000 {built-in method isinstance}
   9592320.1180.0000.1180.000 fractions.py:281(numerator)
   5196570.0660.0000.0660.000 {built-in method __new__ of type 
object at 0x9d1c40}

Note that the gcd() call inside of __new__() now takes about as much time as 
the rest of the __new__() itself. It's clearly still worth optimising that.

--

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



[issue22444] Floor divide should return int

2014-09-22 Thread Stefan Krah

Stefan Krah added the comment:

Alexander Belopolsky rep...@bugs.python.org wrote:
 Raymond suggested that The PEP 3141 should be revised to say that floor 
 division is defined to return a value that is *equal* to an Integral.

I guess it should say equal to an Integral or a special value.

 Since nan or inf are not *equal* to any Integral, the current implementation 
 does not comply.  In the absence of a recommendation in the PEP, implementers 
 of new numeric types are left with little guidance because existing types are 
 inconsistent:
 
  Decimal('inf') // 1
 Decimal('Infinity')
  float('inf') // 1
 nan

I think both should return inf.

--

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



[issue22465] Number agreement error in section 3.2 of web docs

2014-09-22 Thread Pau Amma

New submission from Pau Amma:

In 
https://docs.python.org/2/reference/datamodel.html#the-standard-type-hierarchy, 
under numbers.Real (float), in sentence

  the savings in processor and memory usage that are usually the reason for 
using these is dwarfed by the overhead of using objects in Python

either is dwarfed should be are dwarfed (preferred) or are usually should 
be is usually

--
assignee: docs@python
components: Documentation
messages: 227304
nosy: docs@python, pauamma
priority: normal
severity: normal
status: open
title: Number agreement error in section 3.2 of web docs
type: enhancement
versions: Python 2.7

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



[issue22444] Floor divide should return int

2014-09-22 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

skrah I think both should return inf.

What about this case:

 Decimal('1') // Decimal('-inf')
Decimal('-0')
 1. // float('-inf')
-1.0

--

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



[issue22444] Floor divide should return int

2014-09-22 Thread Mark Dickinson

Mark Dickinson added the comment:

I think that one's covered by #22198.

--

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



[issue22198] Odd floor-division corner case

2014-09-22 Thread Alexander Belopolsky

Changes by Alexander Belopolsky alexander.belopol...@gmail.com:


--
nosy: +belopolsky

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



[issue22198] Odd floor-division corner case

2014-09-22 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I wonder if it would make sense to rewrite float_divmod using the newer 
POSIX/C99 remquo function.  I believe it is designed to compute the exact value 
of round(x/y), but getting floor instead should not be hard.  Its behavior on 
special values is fully specified. 



From the Linux man-page (I believe POSIX/C99 only guarantees 3 bits in quo):

NAME
 remquo -- floating-point remainder and quotient function

SYNOPSIS
 #include math.h

 double
 remquo(double x, double y, int *quo);

 long double
 remquol(long double x, long double y, int *quo);

 float
 remquof(float x, float y, int *quo);

DESCRIPTION
 The remquo() functions compute the value r such that r = x - n*y, where n 
is
 the integer nearest the exact value of x/y.

 If there are two integers closest to x/y, n shall be the even one. If r is
 zero, it is given the same sign as x.  This is the same value that is
 returned by the remainder() function.  remquo() also calculates the lower
 seven bits of the integral quotient x/y, and gives that value the same sign
 as x/y. It stores this signed value in the object pointed to by quo.

SPECIAL VALUES
 remquo(x, y, quo) returns a NaN and raises the invalid floating-point
 exception if x is infinite or y is 0.

--

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



[issue22198] Odd floor-division corner case

2014-09-22 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue22464] Speed up fractions implementation

2014-09-22 Thread Stefan Behnel

Stefan Behnel added the comment:

Here is another little optimisation that removes the redundant property lookups 
for the denominator in __add__() and __sub__().

New profile:

 5291182 function calls (5290800 primitive calls) in 3.596 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   5196320.8430.0000.8430.000 fractions.py:17(gcd)
   5196440.8000.0001.7090.000 fractions.py:73(__new__)
   3197440.5200.0001.8160.000 fractions.py:408(_add)
40.4010.1003.5820.896 bm_telco_fractions.py:38(run)
   5196160.2910.0003.1560.000 fractions.py:381(forward)
   1998720.2740.0000.9040.000 fractions.py:424(_mul)
   5202570.1450.0000.1450.000 {built-in method isinstance}
   9592320.1080.0000.1080.000 fractions.py:285(denominator)
   9592320.1080.0000.1080.000 fractions.py:281(numerator)
   5196570.0660.0000.0660.000 {built-in method __new__ of type 
object at 0x9d1c40}

--
Added file: 
http://bugs.python.org/file36691/avoid_redundant_property_lookups.patch

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



[issue22459] str.strip() documentation: wrong example

2014-09-22 Thread Raúl Cumplido

Raúl Cumplido added the comment:

It was also incorrect on the example for bytes split:
 b'1,2,3'.split(b',', maxsplit=1)
  [b'1', b'2 3']

Patch submitted.

--
keywords: +patch
Added file: http://bugs.python.org/file36692/issue22459.patch

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



[issue22433] Argparse considers unknown optional arguments with spaces as a known positional argument

2014-09-22 Thread paul j3

paul j3 added the comment:

Proposed patches like this are supposed to be generated against the current 
development version (3.5...), especially if they are 'enhancements' (as opposed 
to bugs).  But there isn't much of a difference in argparse between 2.7+ and 
3.4+ (except one nested yield expression).

Tests are in 'lib/test/...'

argparse does implement the '--' syntax.  That is, anything after it is 
understood to be positional, regardless of its prefix characters.  But before 
that, optionals and positionals can be freely mixed (within limits).

I agree that '--foo=one two' looks a lot more like an unknown optional than the 
test case 'a badger'.  Strings with '=' are tested earlier in _parse_optional.  

A fix that passes test_argparse.py and your example is:

if '=' in arg_string:
option_string, explicit_arg = arg_string.split('=', 1)
if option_string in self._option_string_actions:
action = self._option_string_actions[option_string]
return action, option_string, explicit_arg
else: # added for unrecognized
return None, option_string, explicit_arg
# or return None, arg_string, None

But the '=' case is also tested in the following line:

option_tuples = self._get_option_tuples(arg_string)

The obvious difference is that _get_option_tuples handles abbreviations.

I wonder if the two can be refined to reduce the duplication, and handler your 
case as well.

There are other bug issues dealing with multiple '--', the mixing of optionals 
and positionals, and controlling whether abbreviations are allowed or not.  I 
don't recall any others dealing with strings that contain '=' or space.

--

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



[issue21431] 3.4.1rc1 test_pydoc fails: pydoc_data.topics.topics values are type bytes not str

2014-09-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1248796b7945 by Ned Deily in branch 'default':
Issue #21431: merge from 3.4
https://hg.python.org/cpython/rev/1248796b7945

--

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



[issue21431] 3.4.1rc1 test_pydoc fails: pydoc_data.topics.topics values are type bytes not str

2014-09-22 Thread Ned Deily

Ned Deily added the comment:

To expedite matters, I did the almost-null post-release cleanup merge and then 
merged the fix for this issue.  So I think this issue is now complete.

--

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



[issue21431] 3.4.1rc1 test_pydoc fails: pydoc_data.topics.topics values are type bytes not str

2014-09-22 Thread Larry Hastings

Larry Hastings added the comment:

If this is fixed, then how come I hit it again today?

--

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



[issue21431] 3.4.1rc1 test_pydoc fails: pydoc_data.topics.topics values are type bytes not str

2014-09-22 Thread Ned Deily

Ned Deily added the comment:

It was just fixed today, after the release.

--

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



[issue21431] 3.4.1rc1 test_pydoc fails: pydoc_data.topics.topics values are type bytes not str

2014-09-22 Thread Larry Hastings

Larry Hastings added the comment:

Oh, because it was only fixed today.  As Emily Litella used to say... never 
mind!

--

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



[issue22396] AIX posix_fadvise and posix_fallocate

2014-09-22 Thread STINNER Victor

STINNER Victor added the comment:

10812_aix.patch just hides the problem.

I understand that AIX doesn't declare the function prototype correctly? I would 
prefer to disable the function in the posix module (don't declare it) if it's 
the case.

--
nosy: +haypo

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



[issue22396] AIX posix_fadvise and posix_fallocate

2014-09-22 Thread STINNER Victor

STINNER Victor added the comment:

 I understand that AIX doesn't declare the function prototype correctly?

AIX bug report:
http://www-01.ibm.com/support/docview.wss?uid=isg1IV56170

I like Ruby's patch:

-#ifdef HAVE_POSIX_FADVISE
+/* AIX currently does not support a 32-bit call to posix_fadvise()
+ * if _LARGE_FILES is defined.
+ */
+#if defined(HAVE_POSIX_FADVISE)  !(defined(_AIX)  defined(_LARGE_FILES)  
!defined(_ARCH_PPC64))

--

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



[issue19746] No introspective way to detect ModuleImportFailure in unittest

2014-09-22 Thread Robert Collins

Robert Collins added the comment:

I can certainly write the reporter glue to work with either a string or a full 
reference. Note that the existing late-reporting glue captures the import error 
into a string, and then raises an exception containing that string - so what 
I've done is consistent with that.

As for why the original code is like that - well I've had plenty of bad 
experiences with memory loops due to objects held in stack frames of 
exceptions, I don't like to keep long lived references to them, and I wager 
Michael has had the same experience.

--

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



[issue22466] problem with installing python 2.7.8

2014-09-22 Thread Khalid

New submission from Khalid:

when I'm installing python 2.7.8 I get error there is a problem with this 
windows installer package. a DLL required for this install to complete could 
not be run. I'm using windows 8.1 64bit

--
components: Installation
files: Capture.JPG
messages: 227319
nosy: elctr0
priority: normal
severity: normal
status: open
title: problem with installing python 2.7.8
type: compile error
versions: Python 2.7
Added file: http://bugs.python.org/file36693/Capture.JPG

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



[issue22466] problem with installing python 2.7.8

2014-09-22 Thread Eric V. Smith

Eric V. Smith added the comment:

Where did you download the installer from?

How are you running the installer?

--
nosy: +eric.smith

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



[issue22198] Odd floor-division corner case

2014-09-22 Thread Case Van Horsen

Changes by Case Van Horsen cas...@gmail.com:


--
nosy: +casevh

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



[issue22466] problem with installing python 2.7.8

2014-09-22 Thread Khalid

Khalid added the comment:

Downloaded from official website  I run it by simply double click.  by the
way there is no run as admin
On Sep 23, 2014 4:51 AM, Eric V. Smith rep...@bugs.python.org wrote:


 Eric V. Smith added the comment:

 Where did you download the installer from?

 How are you running the installer?

 --
 nosy: +eric.smith

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


--

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



[issue22461] Test failure: Lib/test/test_pydoc.py line 851, topic?key=def

2014-09-22 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: needs patch - resolved

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



[issue22459] str.strip() documentation: wrong example

2014-09-22 Thread Josh Rosenberg

Josh Rosenberg added the comment:

LGTM. About a straightforward as it gets.

--
nosy: +josh.rosenberg

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



[issue22459] str.strip() documentation: wrong example

2014-09-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8eb4eec8626c by Benjamin Peterson in branch '3.4':
fix error in split() examples (closes #22459)
https://hg.python.org/cpython/rev/8eb4eec8626c

New changeset 6dcc96fa3970 by Benjamin Peterson in branch 'default':
merge 3.4 (#22459)
https://hg.python.org/cpython/rev/6dcc96fa3970

--
nosy: +python-dev
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue22467] Lib/http/server.py, inconsistent header casing

2014-09-22 Thread DS6

New submission from DS6:

Inconsistent casing, such as Content-type vs Content-Type, Content-Length 
vs Content-length, while technically not breaking any RFC or other 
HTTP-related rules (headers are case-insensitive, after all), can occasionally 
cause problems when attempting to retrieve already-set headers from 
http.server.BaseHTTPRequestHandler._headers_buffer (in my situation 
specifically, trying to retrie the Content-Type header in the sendfile method 
in an extended BaseHTTPRequestHandler class). This happens a lot in the file 
and I wouldn't be surprised if the problem were to crop up in other places as 
well.
I'm a new user of Python, so despite having searched for an answer to this 
problem, if there's a case-insensitive way to obtain items from a list and I'm 
just daft, please feel free to point me in the right direction, though I feel 
that the casing should be corrected regardless for consistency and optimization 
sake.

(Aside: I would try to publish a patch along with this issue report with the 
casing issues fixed, but I'm not too knowledgeable about versioning and stuff 
and would have no idea where to start.)

--
components: Library (Lib)
messages: 227324
nosy: DS6
priority: normal
severity: normal
status: open
title: Lib/http/server.py, inconsistent header casing
versions: Python 3.4

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



[issue22467] Lib/http/server.py, inconsistent header casing

2014-09-22 Thread Senthil Kumaran

Senthil Kumaran added the comment:

First thing (and the easiest is), if you find inconsistent casing in 
http/server.py itself, then make it consistent in your patch against cpython 
default branch (from hg.python.org). Make it Content-Length and Content-Type in 
your patch.

Next part is while receiving the request with these headers, the client and 
server should store it in case-insensitive dict (there is open request and 
patch, which can churn up again and we can fix it as part of that issue).

--
nosy: +orsenthil

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



[issue22467] Lib/http/server.py, inconsistent header casing

2014-09-22 Thread DS6

DS6 added the comment:

Erp, *retrieve, and I meant copyfile, not sendfile. I'm tired.

Very quick reply, by the way.

I suppose I forgot to mention that _headers_buffer is for sending headers, not 
for receiving them. As far as I can read, the received header information is 
already case-insensitive, due to email.message.Message being used.

It also occurs to me that the _headers_buffer field probably wasn't designed to 
be directly accessed, seeing as how it's usually flushed immediately after 
being modified...

--

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