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
rename spider will load the old left .pyc instead of renamed spider #2181
Comments
Isn't this just normal Python .pyc problems? Pretty sure it's not scrapy specific. If you're actively moving/editing source code, you should just clear all .pyc files to avoid any issues (they'll get regenerated automatically). |
@candlejack297 You're right. |
That is just how Python works. (No?) Scrapy is written in Python. That means it is restricted by all constraints that applies to Python scripts/programs. I think it is not a Scrapy bug. |
May not be worth the effort, but if it's to be investigated, I believe it'd be around |
I think we shouldn't mess with pyc files and implement special handling of them; pyc files are standard Python feature and it'd be too opinionated to assume that .pyc modules shouldn't be loaded - e.g. someone may choose to deploy pyc files instead of .py files. What I think we should do is to warn if there are several spiders with the same name. It is a more general problem; it is specific to scrapy, not to .pyc files handling. |
Arrived here searching DuckDuckGo for "There are several spiders with the same name" in quotes. I'm new to Python and this discussion helped me when I needed to get past the warning mentioned in the title, especially given Atom editor hides files with the |
Hi all, I'm not sure if this is an issue.
If got
y.py
andy.pyc
in thespider
directory.Then rename it with
mv y.py x.py
and update the newx.py
.After updates, run
scrapy crawl spider
will use the old version of spider instead of updates in thex.py
.Have to remove
y.pyc
first.Thanks!
The text was updated successfully, but these errors were encountered: