-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
scrapy genspider
should not overwrite existing file
#4561
Comments
Hey, is this Issue up for grabs?? |
As far as I am concerned, yes.
…On Mon, May 11, 2020, 4:02 AM Jay Rajput ***@***.***> wrote:
Hey, is this Issue up for grabs??
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4561 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAFGLK7MXQJNHDX4I4AB2DRQ6WIHANCNFSM4M5FRRDQ>
.
|
@Gallaecio @elacuesta thoughts?? |
I would not have thought this was an issue, as I'd expect spider code to be covered by source control. On the other hand, it should be only a matter of doing a file system check, so I think a clean implementation could be approved. |
Alright! I will work on this one |
Hi @metaperl @elacuesta, I would like to understand this properly. I've tried to create a spider with the same name twice but it does not allow me to do so.
Could you please let me know what exactly is the issue so that I can try attempting to resolve or enhance? Thanks & Regards. |
Issue scrapy#4561 enhancement. The bug occurs when genspider is called outside of a startproject. I added a small and simple check to compare the new spider names to the current files in the directory. If there is already a spider with the file name it will return and stop the function.
Is this issue still up for grabs? |
@sivoham Indeed, there is already a check in place, but what it does is try to load a spider by its @faraz16iqbal I'd recommend you not to duplicate efforts, since there are already open PRs about this. You're more than welcome to check any other open issues though. You could check the "good first issue" tag if you're unsure about where to start, and don't hesitate to ask for guidance if you need. |
Summary
If the file mentioned in
scrapy genspider
already exists, then genspider should refuse to generate the the file.Motivation
As it stands, existing code can be blown away if this command runs twice.
Describe alternatives you've considered
Prompting the user for overwriting existing spider.
The text was updated successfully, but these errors were encountered: