2 messages in org.python.python-bugs-list[ python-Bugs-909226 ] Can Not import...
FromSent OnAttachments
SourceForge.netMar 3, 2004 3:17 pm 
SourceForge.netMar 3, 2004 3:27 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[ python-Bugs-909226 ] Can Not import a module with - (DASH) in filenameActions...
From:SourceForge.net (nore@sourceforge.net)
Date:Mar 3, 2004 3:27:47 pm
List:org.python.python-bugs-list

Bugs item #909226, was opened at 2004-03-03 12:07 Message generated for change (Settings changed) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=909226&group_id=5470

Category: Python Interpreter Core Group: Python 2.3

Status: Closed Resolution: Invalid

Priority: 5 Submitted By: Benjamin Schollnick (bscholln) Assigned to: Nobody/Anonymous (nobody) Summary: Can Not import a module with - (DASH) in filename

Initial Comment: I am currently running, Python 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32.

I have a file that I am attempting to import "report- manager.py", that refuses to be imported.

C:\develope\versions>python Python 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import report-manager

File "<stdin>", line 1 import report-manager ^ SyntaxError: invalid syntax

import "report-manager"

File "<stdin>", line 1 import "report-manager"

If this is not a bug, and is indeed expected behavior, is this documented in any manner? I have not found any references covering this.

----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)

Date: 2004-03-03 14:26

Message: Logged In: YES user_id=44345

Yes it is expected and documented behavior. Module names as mentioned in import statements must be valid Python identifiers. Hyphens are not allowed in identifiers. Try renaming the file to reportmanager.py or report_manager.py.

----------------------------------------------------------------------