internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: aio-libs/aiohttp

Issue:
Setting empty str as data does not set text/plain header
Setting empty str as data does not set text/plain header
```
await session.post(url, data='')
```
will set
```
'Content-Type': 'application/octet-stream'
```
in the header.

Expected would be
```
'Content-Type': 'text/plain'
```

This is also described in the [docs](https://docs.aiohttp.org/en/stable/client_advanced.html#custom-request-headers).
It shows ``data`` as a shortcut for ``text/plain``.

📋 **Versions**
<!-- Attach your version of the Python. -->
```console
Python/3.8
aiohttp/3.7.3
```



Discussion:

Resolving patch:
diff --git a/aiohttp/client_reqrep.py b/aiohttp/client_reqrep.py
--- a/aiohttp/client_reqrep.py
+++ b/aiohttp/client_reqrep.py
@@ -311,7 +311,7 @@ def __init__(
         self.update_proxy(proxy, proxy_auth, proxy_headers)
 
         self.update_body_from_data(data)
-        if data or self.method not in self.GET_METHODS:
+        if data is not None or self.method not in self.GET_METHODS:
             self.update_transfer_encoding()
         self.update_expect_continue(expect100)
         if traces is None:
@@ -449,7 +449,7 @@ def update_cookies(self, cookies: Optional[LooseCookies]) -> None:
 
     def update_content_encoding(self, data: Any) -> None:
         """Set request content encoding."""
-        if not data:
+        if data is None:
             return
 
         enc = self.headers.get(hdrs.CONTENT_ENCODING, "").lower()
@@ -499,7 +499,7 @@ def update_auth(self, auth: Optional[BasicAuth]) -> None:
         self.headers[hdrs.AUTHORIZATION] = auth.encode()
 
     def update_body_from_data(self, body: Any) -> None:
-        if not body:
+        if body is None:
             return
 
         # FormData


Test patch:
diff --git a/tests/test_client_functional.py b/tests/test_client_functional.py
--- a/tests/test_client_functional.py
+++ b/tests/test_client_functional.py
@@ -3007,3 +3007,22 @@ async def handler(request):
 
     async with await client.get("/", read_bufsize=4) as resp:
         assert resp.content.get_read_buffer_limits() == (4, 8)
+
+
+async def test_http_empty_data_text(aiohttp_client) -> None:
+    async def handler(request):
+        data = await request.read()
+        ret = "ok" if data == b"" else "fail"
+        resp = web.Response(text=ret)
+        resp.headers["Content-Type"] = request.headers["Content-Type"]
+        return resp
+
+    app = web.Application()
+    app.add_routes([web.post("/", handler)])
+
+    client = await aiohttp_client(app)
+
+    async with await client.post("/", data="") as resp:
+        assert resp.status == 200
+        assert await resp.text() == "ok"
+        assert resp.headers["Content-Type"] == "text/plain; charset=utf-8"
Repository: aio-libs/aiohttp

Issue:
Missing `f` prefix on f-strings
Some strings looks like they're meant to be f-strings but are missing the `f` prefix meaning variable interpolation won't happen.

https://github.com/aio-libs/aiohttp/blob/e79a03de3c6b855ebe23a06f536fbdcd763beef6/aiohttp/client_reqrep.py#L218

I found this issue automatically. I'm a bot. Beep Boop 🦊. See other issues I found in your repo [here](https://codereview.doctor/aio-libs/aiohttp)


Discussion:

Resolving patch:
diff --git a/aiohttp/client_reqrep.py b/aiohttp/client_reqrep.py
--- a/aiohttp/client_reqrep.py
+++ b/aiohttp/client_reqrep.py
@@ -215,7 +215,7 @@ def __init__(
         if match:
             raise ValueError(
                 f"Method cannot contain non-token characters {method!r} "
-                "(found at least {match.group()!r})"
+                f"(found at least {match.group()!r})"
             )
         assert isinstance(url, URL), url
         assert isinstance(proxy, (URL, type(None))), proxy


Test patch:
Repository: aio-libs/aiohttp

Issue:
Is aio-libs.discourse.group dead?
### Discussed in https://github.com/aio-libs/aiohttp/discussions/7140 (@pepoluan)

<div type='discussions-op-text'>

<sup>Originally posted by **pepoluan** December 23, 2022</sup>
Though I still find references to it if I do a search, trying to access https://aio-libs.discourse.group/ fails, and using down detectors all seem to agree that it's down.

Is it going to be a permanent down or just a temporary one?
</div>


Discussion:
I assume @asvetlov set this up. We should obviously remove it from the docs if it is no longer intended to be running.
I've found a private discussion dating Oct 30-31, 2021 on Gitter where we agreed that GitHub Discussions is a way to go, and it doesn't make sense to keep the community fragmented. We talked about sunsetting Discourse and Google Groups, but it seems there was no action taken after that, short of putting https://github.com/aio-libs/.github/discussions as an org URL. Looks like I also edited https://github.com/aio-libs/aiohttp/issues/4257 on Nov1, 2021, replacing the link there. Dunno why/when Discourse stopped being available. I think I've lost my privileges there at some point, randomly. But I stopped checking it out long ago.

So the action item would be to start cleaning up the links, removing references to the said locations.

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -200,12 +200,6 @@
             "height": "20",
             "alt": "Latest PyPI package version",
         },
-        {
-            "image": f"https://img.shields.io/discourse/status?server=https%3A%2F%2F{github_repo_org}.discourse.group",
-            "target": f"https://{github_repo_org}.discourse.group",
-            "height": "20",
-            "alt": "Discourse status",
-        },
         {
             "image": "https://badges.gitter.im/Join%20Chat.svg",
             "target": f"https://gitter.im/{github_repo_org}/Lobby",


Test patch:
Repository: aio-libs/aiohttp

Issue:
Websocket client send wrong Connection header
### Describe the bug

In websocket standard , the `Connection` header shoule be `Upgrade`, but we send a `upgrade` . 
It's a lowercase word.

### To Reproduce

connect to server with strict case sensitive checking will failed

### Expected behavior

Send a 
`Connection: Upgrade`
header

### Logs/tracebacks

```python-traceback
no traceback
```


### Python Version

```console
Python 3.8.16
```


### aiohttp Version

```console
Name: aiohttp
Version: 3.8.4
Summary: Async http client/server framework (asyncio)
Home-page: https://github.com/aio-libs/aiohttp
Author: 
Author-email: 
License: Apache 2
Location: /opt/homebrew/lib/python3.8/site-packages
Requires: aiosignal, async-timeout, attrs, charset-normalizer, frozenlist, multidict, yarl
Required-by: web3
```


### multidict Version

```console
Name: multidict
Version: 6.0.4
Summary: multidict implementation
Home-page: https://github.com/aio-libs/multidict
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache 2
Location: /opt/homebrew/lib/python3.8/site-packages
Requires: 
Required-by: aiohttp, yarl
```


### yarl Version

```console
Name: yarl
Version: 1.8.2
Summary: Yet another URL library
Home-page: https://github.com/aio-libs/yarl/
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache 2
Location: /opt/homebrew/lib/python3.8/site-packages
Requires: idna, multidict
Required-by: aiohttp, gql
```


### OS

MacOs

### Related component

Client

### Additional context

_No response_

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct


Discussion:

Resolving patch:
diff --git a/aiohttp/client.py b/aiohttp/client.py
--- a/aiohttp/client.py
+++ b/aiohttp/client.py
@@ -742,7 +742,7 @@ async def _ws_connect(
 
         default_headers = {
             hdrs.UPGRADE: "websocket",
-            hdrs.CONNECTION: "upgrade",
+            hdrs.CONNECTION: "Upgrade",
             hdrs.SEC_WEBSOCKET_VERSION: "13",
         }
 


Test patch:
Repository: aio-libs/aiohttp

Issue:
Websocket client send wrong Connection header
### Describe the bug

In websocket standard , the `Connection` header shoule be `Upgrade`, but we send a `upgrade` . 
It's a lowercase word.

### To Reproduce

connect to server with strict case sensitive checking will failed

### Expected behavior

Send a 
`Connection: Upgrade`
header

### Logs/tracebacks

```python-traceback
no traceback
```


### Python Version

```console
Python 3.8.16
```


### aiohttp Version

```console
Name: aiohttp
Version: 3.8.4
Summary: Async http client/server framework (asyncio)
Home-page: https://github.com/aio-libs/aiohttp
Author: 
Author-email: 
License: Apache 2
Location: /opt/homebrew/lib/python3.8/site-packages
Requires: aiosignal, async-timeout, attrs, charset-normalizer, frozenlist, multidict, yarl
Required-by: web3
```


### multidict Version

```console
Name: multidict
Version: 6.0.4
Summary: multidict implementation
Home-page: https://github.com/aio-libs/multidict
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache 2
Location: /opt/homebrew/lib/python3.8/site-packages
Requires: 
Required-by: aiohttp, yarl
```


### yarl Version

```console
Name: yarl
Version: 1.8.2
Summary: Yet another URL library
Home-page: https://github.com/aio-libs/yarl/
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache 2
Location: /opt/homebrew/lib/python3.8/site-packages
Requires: idna, multidict
Required-by: aiohttp, gql
```


### OS

MacOs

### Related component

Client

### Additional context

_No response_

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct


Discussion:
The server implementation is wrong, it's case-insensitive.

Resolving patch:
diff --git a/aiohttp/client.py b/aiohttp/client.py
--- a/aiohttp/client.py
+++ b/aiohttp/client.py
@@ -772,7 +772,7 @@ async def _ws_connect(
 
         default_headers = {
             hdrs.UPGRADE: "websocket",
-            hdrs.CONNECTION: "upgrade",
+            hdrs.CONNECTION: "Upgrade",
             hdrs.SEC_WEBSOCKET_VERSION: "13",
         }
 


Test patch:
Repository: aio-libs/aiohttp

Issue:
typo in payload.py class AsyncIterablePayload error message
### Describe the bug

https://github.com/aio-libs/aiohttp/blob/bf9d753edc928e7ecbc590c32603ebd3c1fc6282/aiohttp/payload.py#L419 has a typo in place of the intended `collections.abc.AsyncIterable`.

### To Reproduce

N/A

### Expected behavior

N/A

### Logs/tracebacks

```python-traceback
N/A
```


### Python Version

```console
$ python --version
Python 3.9.13
```


### aiohttp Version

```console
$ python -m pip show aiohttp
Version: 3.8.4
```


### multidict Version

```console
$ python -m pip show multidict
Version: 6.0.4
```


### yarl Version

```console
$ python -m pip show yarl
Version: 1.9.2
```


### OS

Windows 10

### Related component

Client

### Additional context

_No response_

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct


Discussion:

Resolving patch:
diff --git a/aiohttp/payload.py b/aiohttp/payload.py
--- a/aiohttp/payload.py
+++ b/aiohttp/payload.py
@@ -416,7 +416,7 @@ def __init__(self, value: _AsyncIterable, *args: Any, **kwargs: Any) -> None:
         if not isinstance(value, AsyncIterable):
             raise TypeError(
                 "value argument must support "
-                "collections.abc.AsyncIterablebe interface, "
+                "collections.abc.AsyncIterable interface, "
                 "got {!r}".format(type(value))
             )
 


Test patch:
Repository: aio-libs/aiohttp

Issue:
typo in payload.py class AsyncIterablePayload error message
### Describe the bug

https://github.com/aio-libs/aiohttp/blob/bf9d753edc928e7ecbc590c32603ebd3c1fc6282/aiohttp/payload.py#L419 has a typo in place of the intended `collections.abc.AsyncIterable`.

### To Reproduce

N/A

### Expected behavior

N/A

### Logs/tracebacks

```python-traceback
N/A
```


### Python Version

```console
$ python --version
Python 3.9.13
```


### aiohttp Version

```console
$ python -m pip show aiohttp
Version: 3.8.4
```


### multidict Version

```console
$ python -m pip show multidict
Version: 6.0.4
```


### yarl Version

```console
$ python -m pip show yarl
Version: 1.9.2
```


### OS

Windows 10

### Related component

Client

### Additional context

_No response_

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct


Discussion:
#7370 

Resolving patch:
diff --git a/aiohttp/payload.py b/aiohttp/payload.py
--- a/aiohttp/payload.py
+++ b/aiohttp/payload.py
@@ -423,7 +423,7 @@ def __init__(self, value: _AsyncIterable, *args: Any, **kwargs: Any) -> None:
         if not isinstance(value, AsyncIterable):
             raise TypeError(
                 "value argument must support "
-                "collections.abc.AsyncIterablebe interface, "
+                "collections.abc.AsyncIterable interface, "
                 "got {!r}".format(type(value))
             )
 


Test patch:
Repository: aio-libs/aiohttp

Issue:
typo in payload.py class AsyncIterablePayload error message
### Describe the bug

https://github.com/aio-libs/aiohttp/blob/bf9d753edc928e7ecbc590c32603ebd3c1fc6282/aiohttp/payload.py#L419 has a typo in place of the intended `collections.abc.AsyncIterable`.

### To Reproduce

N/A

### Expected behavior

N/A

### Logs/tracebacks

```python-traceback
N/A
```


### Python Version

```console
$ python --version
Python 3.9.13
```


### aiohttp Version

```console
$ python -m pip show aiohttp
Version: 3.8.4
```


### multidict Version

```console
$ python -m pip show multidict
Version: 6.0.4
```


### yarl Version

```console
$ python -m pip show yarl
Version: 1.9.2
```


### OS

Windows 10

### Related component

Client

### Additional context

_No response_

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct


Discussion:
#7370 

Resolving patch:
diff --git a/aiohttp/payload.py b/aiohttp/payload.py
--- a/aiohttp/payload.py
+++ b/aiohttp/payload.py
@@ -421,7 +421,7 @@ def __init__(self, value: _AsyncIterable, *args: Any, **kwargs: Any) -> None:
         if not isinstance(value, AsyncIterable):
             raise TypeError(
                 "value argument must support "
-                "collections.abc.AsyncIterablebe interface, "
+                "collections.abc.AsyncIterable interface, "
                 "got {!r}".format(type(value))
             )
 


Test patch:
Repository: aio-libs/aiohttp

Issue:
[3.9] Import fails on Windows PyPy
### Describe the bug

Importing aiohttp 3.9.0 on Windows in PyPy 3.8 fails with an error about `time.gmtime`.



### To Reproduce

* Run PyPy 3.8 on Windows
* import aiohttp

### Expected behavior

No crash

### Logs/tracebacks

```python-traceback
.tox\ci-pypy3\lib\site-packages\aiohttp\__init__.py:6: in <module>
    from .client import (
.tox\ci-pypy3\lib\site-packages\aiohttp\client.py:76: in <module>
    from .cookiejar import CookieJar
.tox\ci-pypy3\lib\site-packages\aiohttp\cookiejar.py:39: in <module>
    class CookieJar(AbstractCookieJar):
.tox\ci-pypy3\lib\site-packages\aiohttp\cookiejar.py:64: in CookieJar
    calendar.timegm(time.gmtime(MAX_TIME))
E   ValueError: Invalid argument
```

(Seen in [Black's CI](https://github.com/psf/black/actions/runs/6914280784/job/18811967454?pr=4010))
```


### Python Version

```console
Successfully set up PyPy 7.3.11 with Python (3.8.16)
```


### aiohttp Version

```console
Successfully installed aiohttp-3.9.0 aiosignal-1.3.1 async-timeout-4.0.3 attrs-23.1.0 black-0.1.dev1+g7e1ebdd click-8.1.7 frozenlist-1.4.0 idna-3.4 multidict-6.0.4 mypy-extensions-1.0.0 pathspec-0.11.2 typing-extensions-4.8.0 yarl-1.9.2
```


### multidict Version

```console
multidict-6.0.4
```


### yarl Version

```console
yarl-1.9.2
```


### OS

Windows

### Related component

Server

### Additional context

This seems related to #7824. It already catches OSError; I suspect PyPy just throws a different exception here.

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct


Discussion:
Ah, I bumped the CI to Pypy 3.9 because it segfaults 50% of the time (didn't actually help, still segfaults), so must have missed this one.
@Rongronggg9 

Resolving patch:
diff --git a/aiohttp/cookiejar.py b/aiohttp/cookiejar.py
--- a/aiohttp/cookiejar.py
+++ b/aiohttp/cookiejar.py
@@ -62,9 +62,10 @@ class CookieJar(AbstractCookieJar):
     )
     try:
         calendar.timegm(time.gmtime(MAX_TIME))
-    except OSError:
+    except (OSError, ValueError):
         # Hit the maximum representable time on Windows
         # https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/localtime-localtime32-localtime64
+        # Throws ValueError on PyPy 3.8 and 3.9, OSError elsewhere
         MAX_TIME = calendar.timegm((3000, 12, 31, 23, 59, 59, -1, -1, -1))
     except OverflowError:
         # #4515: datetime.max may not be representable on 32-bit platforms


Test patch:
Repository: aio-libs/aiohttp

Issue:
[3.9] Import fails on Windows PyPy
### Describe the bug

Importing aiohttp 3.9.0 on Windows in PyPy 3.8 fails with an error about `time.gmtime`.



### To Reproduce

* Run PyPy 3.8 on Windows
* import aiohttp

### Expected behavior

No crash

### Logs/tracebacks

```python-traceback
.tox\ci-pypy3\lib\site-packages\aiohttp\__init__.py:6: in <module>
    from .client import (
.tox\ci-pypy3\lib\site-packages\aiohttp\client.py:76: in <module>
    from .cookiejar import CookieJar
.tox\ci-pypy3\lib\site-packages\aiohttp\cookiejar.py:39: in <module>
    class CookieJar(AbstractCookieJar):
.tox\ci-pypy3\lib\site-packages\aiohttp\cookiejar.py:64: in CookieJar
    calendar.timegm(time.gmtime(MAX_TIME))
E   ValueError: Invalid argument
```

(Seen in [Black's CI](https://github.com/psf/black/actions/runs/6914280784/job/18811967454?pr=4010))
```


### Python Version

```console
Successfully set up PyPy 7.3.11 with Python (3.8.16)
```


### aiohttp Version

```console
Successfully installed aiohttp-3.9.0 aiosignal-1.3.1 async-timeout-4.0.3 attrs-23.1.0 black-0.1.dev1+g7e1ebdd click-8.1.7 frozenlist-1.4.0 idna-3.4 multidict-6.0.4 mypy-extensions-1.0.0 pathspec-0.11.2 typing-extensions-4.8.0 yarl-1.9.2
```


### multidict Version

```console
multidict-6.0.4
```


### yarl Version

```console
yarl-1.9.2
```


### OS

Windows

### Related component

Server

### Additional context

This seems related to #7824. It already catches OSError; I suspect PyPy just throws a different exception here.

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct


Discussion:
Ah, I bumped the CI to Pypy 3.9 because it segfaults 50% of the time (didn't actually help, still segfaults), so must have missed this one.
@Rongronggg9 
Oh, we never ran it on Windows though, so maybe we wouldn't have caught it.

Resolving patch:
diff --git a/aiohttp/cookiejar.py b/aiohttp/cookiejar.py
--- a/aiohttp/cookiejar.py
+++ b/aiohttp/cookiejar.py
@@ -62,9 +62,10 @@ class CookieJar(AbstractCookieJar):
     )
     try:
         calendar.timegm(time.gmtime(MAX_TIME))
-    except OSError:
+    except (OSError, ValueError):
         # Hit the maximum representable time on Windows
         # https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/localtime-localtime32-localtime64
+        # Throws ValueError on PyPy 3.8 and 3.9, OSError elsewhere
         MAX_TIME = calendar.timegm((3000, 12, 31, 23, 59, 59, -1, -1, -1))
     except OverflowError:
         # #4515: datetime.max may not be representable on 32-bit platforms


Test patch:
Repository: aio-libs/aiohttp

Issue:
using server_host name param for ws_connect
### Is your feature request related to a problem?

if i understand correctly, SNI is currently supported using the server_hostname parameter.
the issue is i see it only exists in _request, and the call for ws_connect doesnt support this param.


### Describe the solution you'd like

simply add the server_hostname  parameter to ws_connect so it will be passed to _request method.

### Describe alternatives you've considered

no alternatives, the solution is simple.

### Related component

Client

### Additional context

_No response_

### Code of Conduct

- [X] I agree to follow the aio-libs Code of Conduct


Discussion:

Resolving patch:
diff --git a/aiohttp/client.py b/aiohttp/client.py
--- a/aiohttp/client.py
+++ b/aiohttp/client.py
@@ -689,6 +689,7 @@ def ws_connect(
         proxy: Optional[StrOrURL] = None,
         proxy_auth: Optional[BasicAuth] = None,
         ssl: Union[SSLContext, Literal[False], None, Fingerprint] = None,
+        server_hostname: Optional[str] = None,
         proxy_headers: Optional[LooseHeaders] = None,
         compress: int = 0,
         max_msg_size: int = 4 * 1024 * 1024,
@@ -711,6 +712,7 @@ def ws_connect(
                 proxy=proxy,
                 proxy_auth=proxy_auth,
                 ssl=ssl,
+                server_hostname=server_hostname,
                 proxy_headers=proxy_headers,
                 compress=compress,
                 max_msg_size=max_msg_size,
@@ -735,6 +737,7 @@ async def _ws_connect(
         proxy: Optional[StrOrURL] = None,
         proxy_auth: Optional[BasicAuth] = None,
         ssl: Union[SSLContext, Literal[False], None, Fingerprint] = None,
+        server_hostname: Optional[str] = None,
         proxy_headers: Optional[LooseHeaders] = None,
         compress: int = 0,
         max_msg_size: int = 4 * 1024 * 1024,
@@ -806,6 +809,7 @@ async def _ws_connect(
             proxy=proxy,
             proxy_auth=proxy_auth,
             ssl=ssl,
+            server_hostname=server_hostname,
             proxy_headers=proxy_headers,
         )
 


Test patch:
Repository: nf-core/tools

Issue:
problem with nfcore_cache.sqlite within /tmp
Hi all,
I think will be a nice idea to have the nfcore_cache.sqlite within a subfolder in tmp because if two users use the program at the same time the privileges will prevent to use the tool.

For example I cannot even use nf-core --help 

Luca


Discussion:
Thanks @lucacozzuto well spotted!

This is the code line that makes trouble:

https://github.com/nf-core/tools/blob/4ab80b83cd8b6562a88bb38b6aa0a3d082fd4de6/nf_core/utils.py#L79

I suggest to setup the cache directory locally in a folder `.nfcore_cache` in the user's home folder, instead of a system-wide available mount point.

Any objections?

Resolving patch:
diff --git a/nf_core/utils.py b/nf_core/utils.py
--- a/nf_core/utils.py
+++ b/nf_core/utils.py
@@ -8,7 +8,6 @@
 import logging
 import os
 import subprocess
-import tempfile
 
 def fetch_wf_config(wf_path, wf=None):
     """Uses Nextflow to retrieve the the configuration variables
@@ -70,20 +69,18 @@ def fetch_wf_config(wf_path, wf=None):
 def setup_requests_cachedir():
     """Sets up local caching for faster remote HTTP requests.
 
-    Caching directory will be generated by tempfile.gettempdir() under
-    a nfcore_cache subdir.
+    Caching directory will be set up in the user's home directory under
+    a .nfcore_cache subdir.
     """
     # Only import it if we need it
     import requests_cache
+    
 
-    cachedir = os.path.join(tempfile.gettempdir(), 'nfcore_cache')
+    cachedir = os.path.join(os.getenv("HOME"), os.path.join('.nfcore', 'cache'))
     if not os.path.exists(cachedir):
-        os.mkdir(cachedir)
+        os.makedirs(cachedir)
     requests_cache.install_cache(
-        os.path.join(cachedir, 'nfcore_cache'),
+        os.path.join(cachedir, 'github_info'),
         expire_after=datetime.timedelta(hours=1),
         backend='sqlite',
     )
-    # Make world-writeable so that multi-user installations work
-    os.chmod(cachedir, 0o777)
-    os.chmod(os.path.join(cachedir, 'nfcore_cache.sqlite'), 0o777)


Test patch: