This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: conversion tool does not fix "from Tkinter import N,E"
Type: behavior Stage:
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.0
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, wplappert
Priority: high Keywords:

Created on 2008-11-06 17:31 by wplappert, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg75571 - (view) Author: Winfried Plappert (wplappert) Date: 2008-11-06 17:31
I tried to check the tracker for an existing issue with the conversion
tool, but I could not find one. I am using the "python2.6
Python2.6/Tools/scripts/2to3 -w -v ." command to convert existing Python
scripts to Python3.0.

I made two observations:

1. Tkinter
   from Tkinter import (N, E, ...) does NOT get translated to
   from tkinter import (N, E, ...)

2. 2to3 produces relative imports for stuff which lives in the same
directory, but trying to compile the stuff, I get the error:

org: from global_stuff                import *
2t3: from .global_stuff                import *
ValueError: Attempted relative import in non-package
msg75572 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-11-06 17:59
The relative import problem has been fixed that will be released in 2.6.1.
msg75573 - (view) Author: Winfried Plappert (wplappert) Date: 2008-11-06 18:04
and it is also fixed in 3.0rc1: I reran the conversion, but issue 2
still persists,
msg75574 - (view) Author: Winfried Plappert (wplappert) Date: 2008-11-06 18:05
Sorry, issue 1 still persists: 
From Tkinter import (bla,blah, blahh)
msg75642 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-11-08 18:29
The other problem is fixed in r67170.
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48521
2008-11-08 18:29:05benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg75642
2008-11-06 18:06:41benjamin.petersonsetpriority: high
2008-11-06 18:05:54wplappertsetmessages: + msg75574
2008-11-06 18:04:44wplappertsetmessages: + msg75573
2008-11-06 17:59:32benjamin.petersonsettype: compile error -> behavior
messages: + msg75572
nosy: + benjamin.peterson
2008-11-06 17:31:52wplappertcreate