[arvados] updated: 2.6.0-51-g02ae62dcd

git repository hosting git at public.arvados.org
Wed Apr 19 14:08:25 UTC 2023


Summary of changes:
 sdk/python/discovery2pydoc.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

       via  02ae62dcdc5d5cd9231b32b407bd525e74633003 (commit)
      from  7ea5b1b2b78ceaa326d8f21ce1d08df0be1d9cda (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 02ae62dcdc5d5cd9231b32b407bd525e74633003
Author: Brett Smith <brett.smith at curii.com>
Date:   Wed Apr 19 09:58:49 2023 -0400

    18799: Force UTF-8 encoding for discovery2pydoc output
    
    Refs #18799.
    
    Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith at curii.com>

diff --git a/sdk/python/discovery2pydoc.py b/sdk/python/discovery2pydoc.py
index dad27f09a..9f7f87d98 100755
--- a/sdk/python/discovery2pydoc.py
+++ b/sdk/python/discovery2pydoc.py
@@ -318,10 +318,11 @@ If not provided, retrieved dynamically from Arvados client configuration.
         parts = urllib.parse.urlsplit(args.discovery_url)
         if not (parts.scheme or parts.netloc):
             args.discovery_url = pathlib.Path(args.discovery_url).resolve().as_uri()
+    # Our output is Python source, so it should be UTF-8 regardless of locale.
     if args.output_file == STDSTREAM_PATH:
-        args.out_file = sys.stdout
+        args.out_file = open(sys.stdout.fileno(), 'w', encoding='utf-8', closefd=False)
     else:
-        args.out_file = args.output_file.open('w')
+        args.out_file = args.output_file.open('w', encoding='utf-8')
     return args
 
 def main(arglist: Optional[Sequence[str]]=None) -> int:
@@ -364,6 +365,7 @@ def main(arglist: Optional[Sequence[str]]=None) -> int:
         }
         print(Method(name, method_spec).doc(), file=args.out_file)
 
+    args.out_file.close()
     return os.EX_OK
 
 if __name__ == '__main__':

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list