-
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
Add LOG_FILE_APPEND to settings #5279
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
d916450
to
b78fad1
Compare
Changed to APPEND. I'm baffled why it says here I started a review, certainly that wasn't my intention :-) |
b78fad1
to
7cd907f
Compare
7cd907f
to
ca320fe
Compare
(Sorry, I forgot to change the commit message) |
Don’t worry about keeping the commit history clean, we will probably squash your changes into a single commit upon merging anyway. |
Codecov Report
@@ Coverage Diff @@
## master #5279 +/- ##
==========================================
- Coverage 88.52% 88.49% -0.03%
==========================================
Files 163 163
Lines 10608 10608
Branches 1557 1527 -30
==========================================
- Hits 9391 9388 -3
- Misses 942 945 +3
Partials 275 275
|
Ah, sloppy/paste in the test function: thanks for removing the unused variable! |
Thanks for review and merge! By the way, I looked into the problem with recent flake8 versions -- i.e., the reason why you had to add 98ee3dd. I've submitted a PR which would, I think, resolve the issue here: If that were to be accepted, merged and released, then scrapy could drop this version pin and use latest flake8 releases. |
That’s awesome. However, freezing these static checks, and upgrading them manually regularly (e.g. after a release) is something we are actually moving towards. Even if bug free, new versions of checkers may introduce new checks that our code does not pass in |
Fair enough -- but at least you'll have the option of pinning it to the current major release, if you wanted to. (Well, if that PR is accepted, anyway). |
Hi,
First of all, thanks for a great tool!
I wanted to truncate my logfile at every new run, but noticed that the logfile is opened with
mode='a'
and there's no way to override that. So I made a PR which allows us to pass aLOG_FILE_TRUNCATE
setting, defaulting toFalse
. If it's set toTrue
, the logfile will be opened withmode='w'
. The setting has no effect unlessLOG_FILE
is set, obviously.Hopefully I've added sufficient info to the docs to explain this item.
I've also added a test, although it seems slightly out of place in
test_crawler.py
-- I put it there because it's the only file in the tests directory where I found an occurrence ofLOG_FILE
.