[issue19510] lib2to3.fixes.fix_import gets confused if implicit relative imports and absolute imports are on the same line

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue19510] lib2to3.fixes.fix_import gets confused if implicit relative imports and absolute imports are on the same line

2019-10-29 Thread Batuhan

Batuhan  added the comment:

> It’s still a bug though :)

It gives a warning about this though
 RefactoringTool: ### In file test/t.py ###
 RefactoringTool: Line 1: absolute and local imports together

If it still counts as a bug, let me know and i'll try to prepare a patch.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue19510] lib2to3.fixes.fix_import gets confused if implicit relative imports and absolute imports are on the same line

2014-03-14 Thread Éric Araujo

Éric Araujo added the comment:

To be fair to 2to3, that line disrespects some Python best practices (use 
explicit relative imports (2.5+), put one import per line, group imports by 
stdlib/non-stdlib).  It’s still a bug though :)

--
nosy: +benjamin.peterson, eric.araujo

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



[issue19510] lib2to3.fixes.fix_import gets confused if implicit relative imports and absolute imports are on the same line

2013-11-05 Thread Augie Fackler

New submission from Augie Fackler:

While tinkering (again) with Mercurial Python 3 messes, I ran across this gem:

import error, osutil, encoding, collections

(http://selenic.com/hg/file/e1317d3e59e1/mercurial/util.py#l17)

That import statement contains 3 relative imports (that is, mercurial.error, 
mercurial.osutil, and mercurial.encoding), and one standard library import 
(collections). Because of the standard lib import on that line, lib2to3 doesn't 
rewrite any of the imports. If I instead move collections to its own line, then 
the first three imports get correctly rewritten to the from . import error 
form.

I've got Python 3.3.2 locally, and the lib2to3 is the one from that stdlib.

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 202248
nosy: durin42, twouters
priority: normal
severity: normal
status: open
title: lib2to3.fixes.fix_import gets confused if implicit relative imports and 
absolute imports are on the same line
versions: Python 3.3

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