Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import new fails #51213

Closed
illume mannequin opened this issue Sep 22, 2009 · 6 comments
Closed

import new fails #51213

illume mannequin opened this issue Sep 22, 2009 · 6 comments
Assignees
Labels
topic-2to3 type-bug An unexpected behavior, bug, or error

Comments

@illume
Copy link
Mannequin

illume mannequin commented Sep 22, 2009

BPO 6964
Nosy @brettcannon, @birkenfeld, @benjaminp

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/benjaminp'
closed_at = <Date 2009-09-22.20:33:52.241>
created_at = <Date 2009-09-22.09:16:47.076>
labels = ['type-bug', 'expert-2to3']
title = 'import new fails'
updated_at = <Date 2012-07-22.08:47:24.624>
user = 'https://bugs.python.org/illume'

bugs.python.org fields:

activity = <Date 2012-07-22.08:47:24.624>
actor = 'techtonik'
assignee = 'benjamin.peterson'
closed = True
closed_date = <Date 2009-09-22.20:33:52.241>
closer = 'brett.cannon'
components = ['2to3 (2.x to 3.x conversion tool)']
creation = <Date 2009-09-22.09:16:47.076>
creator = 'illume'
dependencies = []
files = []
hgrepos = []
issue_num = 6964
keywords = []
message_count = 6.0
messages = ['92974', '92976', '92978', '93016', '93032', '166110']
nosy_count = 6.0
nosy_names = ['brett.cannon', 'georg.brandl', 'illume', 'techtonik', 'quentin.gallet-gilles', 'benjamin.peterson']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue6964'
versions = ['Python 3.1']

@illume
Copy link
Mannequin Author

illume mannequin commented Sep 22, 2009

python3.1

>>> import new
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named new

2to3-3.1 doesn't mention how to change it.

@illume illume mannequin added topic-2to3 type-bug An unexpected behavior, bug, or error labels Sep 22, 2009
@quentingallet-gilles
Copy link
Mannequin

quentingallet-gilles mannequin commented Sep 22, 2009

The 'new' module has been removed in python 3.0. The documentation
advices you to use the 'types' modules instead
(http://docs.python.org/library/new.html).

I'm also pretty sure you get a message for this module if you enable the
warnings at interpreter startup in python 2.6.

@illume
Copy link
Mannequin Author

illume mannequin commented Sep 22, 2009

Hi,

yes it does report a warning with 2.6, thanks.

python2.6 -3 -c "import new"
-c:1: DeprecationWarning: The 'new' module has been removed in Python
3.0; use the 'types' module instead.

I guess it should be a TODO item with 2to3.

cheers,

@brettcannon
Copy link
Member

Benjamin can re-open if he wants, but having 2to3 emit warnings about
deprecated modules is not what it is meant to do. 2to3 is supposed to only
be run once you are running against 2.6 w/ no DeprecationWarning or
Py3KWarning being raised, which would have covered this issue.

If the docs don't make this clear then they need to be changed to do so
(and that should be a new issue anyway).

@birkenfeld
Copy link
Member

Bottom line: move over to the types module *before* running 2to3.

@techtonik
Copy link
Mannequin

techtonik mannequin commented Jul 22, 2012

Damn it. I've run 2to3 during setup.py phase and went smoothly, but when I run examples the package fails.

It should at least warn about this "import new". It should not be that hard to catch.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-2to3 type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants