Title: Can Not import a module with - (DASH) in filename
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: bscholln, skip.montanaro
Priority: normal Keywords:

Created on 2004-03-03 18:07 by bscholln, last changed 2004-03-03 20:26 by skip.montanaro. This issue is now closed.

Messages (2)
msg20164 - (view) Author: Benjamin Schollnick (bscholln) Date: 2004-03-03 18:07
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-", that refuses to be imported.

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 
>>> 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.
msg20165 - (view) Author: Skip Montanaro (skip.montanaro) * Date: 2004-03-03 20:26
Logged In: YES 

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 or
Date User Action Args
2004-03-03 18:07:57bschollncreate