From 02fea029bfc5bfd64e43de9e810aef2dd3c8cb2c Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Tue, 11 Sep 2018 04:57:20 -0700 Subject: Prefer builtin open() over io.open() and codecs.open() In Python3, the functions io.open() is an alias of the builtin open() and codecs.open() is functionally equivalent. To reduce indirection, number of imports, and number of patterns, always prefer the builtin. https://docs.python.org/3/library/io.html#high-level-module-interface > io.open() > > This is an alias for the builtin open() function. --- sphinx/cmd/quickstart.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sphinx/cmd/quickstart.py') diff --git a/sphinx/cmd/quickstart.py b/sphinx/cmd/quickstart.py index 174298579..51285efa5 100644 --- a/sphinx/cmd/quickstart.py +++ b/sphinx/cmd/quickstart.py @@ -18,7 +18,6 @@ import re import sys import time from collections import OrderedDict -from io import open from os import path # try to import readline, unix specific enhancement @@ -445,7 +444,7 @@ def generate(d, overwrite=True, silent=False, templatedir=None): if overwrite or not path.isfile(fpath): if 'quiet' not in d: print(__('Creating file %s.') % fpath) - with open(fpath, 'wt', encoding='utf-8', newline=newline) as f: + with open(fpath, 'wt', encoding='utf-8', newline=newline) as f: # type: ignore f.write(content) else: if 'quiet' not in d: -- cgit v1.2.1