<p dir="auto">I'm having a hard time figuring a few things out as I'm not the world's best programmer. I often don't know if I've done something wrong in Python or something specific to Scrapy, and there aren't a great deal of beginner level examples out there.</p>
<p dir="auto">I'm looking for somewhere I could ask a few dumb questions, and I expect that Github isn't the best place. Ideally I'm looking for some kind of chat room where I can informally ask things and anyone kind enough could point out what likely very stupid and small thing I'm doing wrong. I only need a few tips / hints when I get stuck. I've already asked the IRC channel but no responses there.</p>
<p dir="auto">Maybe there's a Discord / Slack server somewhere I could ask? There was a <a href="https://www.reddit.com/r/scrapy/comments/nf6hch/slack_server_dedicated_to_scrapy/" rel="nofollow">reddit post the other day about this</a>, but it seems there isn't one. Perhaps one could be created?</p>
<p dir="auto">Sorry if it's not appropriate to ask about this kind of thing here but I don't know where else to ask. Please feel free to remove this / tell me to go away. Thanks for any help!</p>
<h3 dir="auto">Description</h3>
<p dir="auto">I'm trying to export <code class="notranslate">scrapy crawl</code> results to JSON Lines format to the file with extension <code class="notranslate">.jsonl</code> (this is requirement of the external system in our case) and ovewrite the file for multiple executions.<br>
As I understand, only <code class="notranslate">.jl</code> and <code class="notranslate">.jsonlines</code> extensions are supported now and <code class="notranslate">.jsonl</code> was discussed in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="723735983" data-permission-text="Title is private" data-url="https://github.com/scrapy/scrapy/issues/4848" data-hovercard-type="pull_request" data-hovercard-url="/scrapy/scrapy/pull/4848/hovercard" href="https://github.com/scrapy/scrapy/pull/4848">#4848</a> but not supported yet.<br>
So in this case I tried to use <code class="notranslate">-O</code> argument with <code class="notranslate">--output-format</code> for <code class="notranslate">scrapy crawl</code> command.</p>
<h3 dir="auto">Steps to Reproduce</h3>
<ol dir="auto">
<li><code class="notranslate">scrapy crawl -O &lt;filename&gt;.jsonl --output-format jl &lt;spider_name&gt;</code><br>
OR<br>
<code class="notranslate">scrapy crawl -O &lt;filename&gt;.jsonl --output-format jsonlines &lt;spider_name&gt;</code></li>
</ol>
<p dir="auto"><strong>Expected behavior:</strong> File is ovewritten with parsed content.</p>
<p dir="auto"><strong>Actual behavior:</strong> Parsed content is appended to the end of existing file.</p>
<p dir="auto"><strong>Reproduces how often:</strong> 100%</p>
<h3 dir="auto">Versions</h3>
<p dir="auto">Scrapy       : 2.6.1<br>
lxml         : 4.9.0.0<br>
libxml2      : 2.9.14<br>
cssselect    : 1.1.0<br>
parsel       : 1.6.0<br>
w3lib        : 1.22.0<br>
Twisted      : 22.4.0<br>
Python       : 3.10.4 (main, Jun  4 2022, 14:29:37) [GCC 9.4.0]<br>
pyOpenSSL    : 22.0.0 (OpenSSL 3.0.3 3 May 2022)<br>
cryptography : 37.0.2<br>
Platform     : Linux-5.13.0-44-generic-x86_64-with-glibc2.31</p>
<h3 dir="auto">Additional context</h3>
<p dir="auto">If I use <code class="notranslate">scrapy crawl -O &lt;filename&gt;.jl &lt;spider_name&gt;</code> or <code class="notranslate">scrapy crawl -O &lt;filename&gt;.jsonlines &lt;spider_name&gt;</code>, file is overwritten successfully, but it seems that the case above is expected to have the same behaviour.</p>