New submission from Lennart Regebro :
The documentation on Using Python, 2.3. Python-related paths and files says
that "exec_prefix/bin/python" is the recommended location for the interpreter,
while for Python 3 it's "exec_prefix/bin/python3".
http://docs.python
Lennart Regebro added the comment:
We *do* care about NotImplemented, that's the whole point of this bug report. I
don't see how this is a problem in the new_total_ordering.py example. Can you
give an example of when you get a stack overflow?
The examples in new_total_order
Lennart Regebro added the comment:
I'm attaching a file with the example classes returning NotImplemented, and a
different implementation of a total ordering, as an example of how returning
NotImplemented by one class will give the chance to the other class. This is
the ultimate cause o
Lennart Regebro added the comment:
Ah! I see how you mean. The problem isn't just if you turn the conversion
around from self > other to other < self. The problem in fact appears when a
rich text function uses the <>!= operators on self directly.
I tried a version whic
Lennart Regebro added the comment:
Yeah, I can't say it's pretty though. :) Anyway this is an issue for 3.2 and
2.7 as well, then, so I add them back.
--
versions: +Python 2.7, Python 3.2
___
Python tracker
<http://bugs.python.o
Lennart Regebro added the comment:
I was also surprised by the special return value, but it seems a bit overkill
to change the implementation of rich comparison operators just because it's
tricky to make a short and pretty class decorator that extends some operators
to all operators. :)
Lennart Regebro added the comment:
I can confirm on Ubuntu and with other example mailboxes. Looping through the
messages and printing the subjects takes around 200-300 times longer under
Python 3 than under Python 2.
--
nosy: +lregebro
___
Python
Lennart Regebro added the comment:
3.2 sees a small improvement when running the Steve test:
Python 2.6.6: 0.0291s
Python 3.1.2: 31.1s
Python 3.2b2+: 28.8s
This is Ubuntu 10.04 on ext3, with all Pythons compiled from source, with no
configure attributes except a prefix.
I wonder if the
New submission from Lennart Regebro :
In Python 2 the file used for csv.writer() should be opened in binary mode,
while in Python 3 is should be opened in text mode but with newlines set to ''.
This change is neither warned for by python -3, nor is there a fixer for it
(and maki
Changes by Lennart Regebro :
--
nosy: +sjmachin
___
Python tracker
<http://bugs.python.org/issue10954>
___
___
Python-bugs-list mailing list
Unsubscribe:
Lennart Regebro added the comment:
This also affects Python 2.7, where it hasn't been fixed. Maybe reopen it?
--
nosy: +lregebro
___
Python tracker
<http://bugs.python.org/is
Lennart Regebro added the comment:
In the worst case, not checking for newline='' is not a big problem, as anyone
moving from Python 2 to Python 3 will open the file in binary mode. That error
message could tell the user to use binary mode newlines=''.
Using textmode
Changes by Lennart Regebro :
Removed file: http://bugs.python.org/file15537/python-py3k-exception-detail.diff
___
Python tracker
<http://bugs.python.org/issue7
Changes by Lennart Regebro :
Removed file:
http://bugs.python.org/file15538/python-trunk-exception-detail.diff
___
Python tracker
<http://bugs.python.org/issue7
Lennart Regebro added the comment:
New diff for trunk, with the additional test
--
Added file: http://bugs.python.org/file15972/python-trunk-exception-detail.diff
___
Python tracker
<http://bugs.python.org/issue7
Lennart Regebro added the comment:
New diff for Py3k with the additional test
--
Added file: http://bugs.python.org/file15973/python-py3k-exception-detail.diff
___
Python tracker
<http://bugs.python.org/issue7
Lennart Regebro added the comment:
The ellipsis doesn't work, because when you have an ellipsis at the beginning
of the message, doctest will not understand that it's supposed to be an
Exception, so it doesn't even try to match exceptions, and it will therefo
Lennart Regebro added the comment:
Sure: Catch the exception in the test, and fail if it isn't catched.
>>> try:
... do_something_that_raises_exception()
... raise Assertionerror("Exception Blah was not raised")
... except Blah:
... pass
Ugly, yes, but ea
Lennart Regebro added the comment:
It's not possible for 2to3 to reformat exceptions, as the formatting would need
to go from TheException to themodule.TheException, and there is no way to
figure out the module name...
--
___
Python tracker
Lennart Regebro added the comment:
Sure, but +IGNORE_EXCEPTION_DETAIL will only work on Python 3.2+, so 2to3 can't
solve the issue. It can only help once 3.2 does the actual solving. ;)
3to2 could simply remove the module name from exceptions in the output. You
don't nee
New submission from Lennart Regebro :
If we return unicode, SpoofOut's buf variable becomes automagically converted
to unicode. This means all subsequent output becomes converted to unicode, and
if the output contains non-ascii characters that fails.
That means that
>>>
New submission from Lennart Regebro :
If the doctest file has both Windows and unix lineendings you get an error.
Yeah, I know, it's not a serious bug, but it's also easy to fix.
Attached patch with test. Seems to not be an issue on Python 3.
--
components: Extension Modu
New submission from Lennart Regebro <[EMAIL PROTECTED]>:
The whatsnew/3.0.rst document claims
"It is not recommended to try to write source code that runs unchanged
under both Python 2.6 and 3.0; you’d have to use a very contorted coding
style, e.g. avoiding print statements, metac
Lennart Regebro <[EMAIL PROTECTED]> added the comment:
That is not true, and statement as it stands now is still factually
incorrect.
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Lennart Regebro <[EMAIL PROTECTED]> added the comment:
A future import is not much of a contortion, and metaclasses is not
exactly an everyday occurrence, after 9 years of python I have yet to
write a metaclass...
Of course I don't like that it specifically mentiones 2.6, while 2.6 h
Lennart Regebro <[EMAIL PROTECTED]> added the comment:
I've never said that is the goal. You are misrepresenting or
misinterpreting my standpoint.
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.
Lennart Regebro <[EMAIL PROTECTED]> added the comment:
Well, that *is* the intention of a from __future__ import, isn't it?
That doesn't mean that's the intention of 2.6 as a whole, just that
statement.
___
Python tracker <
Lennart Regebro <[EMAIL PROTECTED]> added the comment:
Fair enough, but I still think we can come up with a better example that
requires more contortions than "print", which doesn't.
I think a good example of contortions is binary file data, which has two
different types
New submission from Lennart Regebro :
If you have urlparse before cStringIO in an import line, 2to3 will not
convert the cStringIO to io. However, reverse the order, and urlparse
will not get translated.
So this file:
import urlparse, cStringIO
import cStringIO, urlparse
will with 2to3 return
Lennart Regebro added the comment:
Heres my test file.
Added file: http://bugs.python.org/file12357/test3.py
___
Python tracker
<http://bugs.python.org/issue4
Lennart Regebro added the comment:
What version are you running? Can you post the output?
___
Python tracker
<http://bugs.python.org/issue4664>
___
___
Python-bugs-list m
Lennart Regebro added the comment:
filecmp is still there in Python 3.3 Alpha 3. I can't find any reference to it
being deprecated.
--
nosy: +lregebro
___
Python tracker
<http://bugs.python.org/is
New submission from Lennart Regebro:
If you install Python 3.3b2 with "sudo make install", a standard way of
installing it so that users don't have rights to install global modules, then
everytime lib2to3.pgen2.driver.load_grammar() is called, it aims to generate a
a grammar
Changes by Lennart Regebro :
--
components: +Installation
___
Python tracker
<http://bugs.python.org/issue15760>
___
___
Python-bugs-list mailing list
Unsubscribe:
Lennart Regebro added the comment:
Yes, and for some reason it didn't show up when I searched for "Grammar" 10
minutes ago, but now it does. :-) It's a duplicate, indeed.
--
status: open -> closed
___
Python tracker
Lennart Regebro added the comment:
I can confirm that this is an issue on Ubuntu 12.04 as well, and that removing
the existing pre 3.3b2 install before installing solves the problem.
--
nosy: +lregebro
___
Python tracker
<http://bugs.python.
New submission from Lennart Regebro:
Pystone uses some floats in Python 3, while in Python 2 it's all integers. And
since it is, as far as I can tell, based on Dhrystone, it should be all ints.
After fixing the division in the loop to be a floor division it runs the same
as in Python 2.
Lennart Regebro added the comment:
Yes, good point, I added this in a new diff.
--
Added file: http://bugs.python.org/file35443/pystone12.diff
___
Python tracker
<http://bugs.python.org/issue21
Lennart Regebro added the comment:
Oups, yes, that's a typo.
--
___
Python tracker
<http://bugs.python.org/issue21634>
___
___
Python-bugs-list mailing list
Lennart Regebro added the comment:
Awesome, thanks!
--
___
Python tracker
<http://bugs.python.org/issue21634>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Lennart Regebro :
In Python 3.x [1] the exception formatting prints the module path, while
under 2.x it prints only the exception class name. This makes it very
tricky to make doctests that pass under both Python 2 and Python 3
without resorting to ugly tricks.
Since
Changes by Lennart Regebro :
Added file: http://bugs.python.org/file15538/python-trunk-exception-detail.diff
___
Python tracker
<http://bugs.python.org/issue7490>
___
___
Lennart Regebro added the comment:
Yes, x.y.Exception and a.b.Exception should match. I just realized I
didn't add an explicit test for that, but maybe that's not strictly
necessary.
--
___
Python tracker
<http://bugs.python.
New submission from Lennart Regebro :
The run_2to3 method, and therefore also the Mixin2to3 class doesn't take
a parameter for doctest_only parameter that refactor has. That means you
have to do a lot of code duplication if you want to write distutil
commands that handle doctest files.
Th
Lennart Regebro added the comment:
Also, the run_2to3 method takes the explicit parameter, but does not
pass it into the DistutilsRefactoringTool.
--
___
Python tracker
<http://bugs.python.org/issue5
New submission from Lennart Regebro:
If you have a local folder (without an __init__.py, hence just a normal folder)
with the same name as a non local module, the import statements of that module
will assumed to be local and transformed from for example ``import datetime``
to ``from . import
Changes by Lennart Regebro :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue17393>
___
___
Python-bugs-list mailing list
Unsubscri
Lennart Regebro added the comment:
Not really, but they are related. The fixer looks for a local module, and if it
finds it it will assume the import is local.
#13317 is caused by it not finding the module, since it's not built and hence
assuming it's a global import.
This bug, co
New submission from Lennart Regebro:
When calling tzname() on a timezone object it will return "UTC" + the offset.
>>> from datetime import timezone, timedelta, datetime
>>> tz = timezone(timedelta(hours=3))
>>> dt = datetime(2013, 3, 14, 12, 30, tzinfo=tz)
Lennart Regebro added the comment:
FYI me and Berker started over here: https://bitbucket.org/regebro/cpython
--
___
Python tracker
<http://bugs.python.org/issue23
50 matches
Mail list logo