Skip to content

Project named test causes error #428

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

Closed
srmaximiano opened this issue Oct 16, 2013 · 3 comments
Closed

Project named test causes error #428

srmaximiano opened this issue Oct 16, 2013 · 3 comments

Comments

@srmaximiano
Copy link

When creating a new project with the command 'startproject' and setting the name of the project to 'test', the project is created but it will cause future errors, such as the error below (reported in issue #54):


 Traceback (most recent call last):
  File "/home/max/testscrapy/venv/bin/scrapy", line 8, in 
    execfile(__file__)
  File "/home/max/workspace/scrapy/bin/scrapy", line 4, in 
    execute()
  File "/home/max/workspace/scrapy/scrapy/cmdline.py", line 108, in execute
    settings = get_project_settings()
  File "/home/max/workspace/scrapy/scrapy/utils/project.py", line 57, in get_project_settings
    settings_module = __import__(settings_module_path, {}, {}, [''])
ImportError: No module named settings

In this case test is the name of a python library, and as such there is no settings module.

To avoid this problem we would like to add a validation, at least for 'test'. Is this something worth doing? We took some time before realizing, but on the other hand we can't cover all cases (i.e. project named 're'). What do you think?

Scrapy : 0.19.0
lxml : 3.2.3.0
libxml2 : 2.7.8
Twisted : 13.1.0
Python : 2.7.3 (default, Sep 26 2013, 20:03:06) - [GCC 4.6.3]
Platform: Linux-3.8.0-31-generic-x86_64-with-Ubuntu-12.04-precise

@dangra
Copy link
Member

dangra commented Oct 17, 2013

what kind of validation? like trying to import the projectname before creating it?

@srmaximiano
Copy link
Author

Just sent pull request #434
Please review and comment.

@pablohoffman
Copy link
Member

Let's continue this on #434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants