mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Do not load netrc config files
This commit is contained in:
parent
688d6f907f
commit
a490544405
1 changed files with 9 additions and 0 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
import re
|
import re
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
|
|
@ -17,6 +19,13 @@ from .utils import expand_path
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
USERAGENT = f"vdirsyncer/{__version__}"
|
USERAGENT = f"vdirsyncer/{__version__}"
|
||||||
|
|
||||||
|
# 'hack' to prevent aiohttp from loading the netrc config,
|
||||||
|
# but still allow it to read PROXY_* env vars.
|
||||||
|
# Otherwise, if our host is defined in the netrc config,
|
||||||
|
# aiohttp will overwrite our Authorization header.
|
||||||
|
# https://github.com/pimutils/vdirsyncer/issues/1138
|
||||||
|
os.environ["NETRC"] = "NUL" if platform.system() == "Windows" else "/dev/null"
|
||||||
|
|
||||||
|
|
||||||
class AuthMethod(ABC):
|
class AuthMethod(ABC):
|
||||||
def __init__(self, username, password):
|
def __init__(self, username, password):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue