[issue27672] x fromat of % operator broken in Python 3.5.2

2016-08-03 Thread Peter Tomcsanyi

New submission from Peter Tomcsanyi:

In Python 3.4.4 (64-bit) and in many previous versions it worked like this:

>>> "%02x" % 12.99
'0c'

Now in Python 3.5.2 (64-bit) it shows an error:
>>> "%02x" % 12.99
Traceback (most recent call last):
  File "", line 1, in 
"%02x" % 12.99
TypeError: %x format: an integer is required, not float

This problem broke some of my code which uses turtle.py (which is part of the 
cpython distribution), but I can see similar problems also in some third party 
code (e.g. I can see it in canvasvg3.py).
So I kindly ask for returning the 3.4-like interpretation of the x format (and 
o format and maybe also other formats).

--
components: Interpreter Core
messages: 271894
nosy: PeterTom
priority: normal
severity: normal
status: open
title: x fromat of % operator broken in Python 3.5.2
type: behavior
versions: Python 3.5

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



[issue27672] x fromat of % operator broken in Python 3.5.2

2016-08-03 Thread Peter Tomcsanyi

Peter Tomcsanyi added the comment:

So it is even worse, it is an "intentional break".

I will need to review a few thousands lines of code because of this.
I think that breaking others' code by redefining a "built-in" operator is 
acceptable when changing major versions (like 2 to 3), not minor ones (3.4 to 
3.5).

--
resolution: wont fix -> 
status: closed -> open

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