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

Project named test causes error #428

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

Comments

Projects
None yet
3 participants
@srmaximiano
Contributor

srmaximiano commented Oct 16, 2013

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

This comment has been minimized.

Show comment
Hide comment
@dangra

dangra Oct 17, 2013

Member

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

Member

dangra commented Oct 17, 2013

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

@srmaximiano

This comment has been minimized.

Show comment
Hide comment
@srmaximiano

srmaximiano Oct 21, 2013

Contributor

Just sent pull request #434
Please review and comment.

Contributor

srmaximiano commented Oct 21, 2013

Just sent pull request #434
Please review and comment.

@pablohoffman

This comment has been minimized.

Show comment
Hide comment
@pablohoffman

pablohoffman Feb 1, 2014

Member

Let's continue this on #434

Member

pablohoffman commented Feb 1, 2014

Let's continue this on #434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment