From dd96fe124554f59433ca7c7c740d247f9a06ccf3 Mon Sep 17 00:00:00 2001 From: mmatera Date: Sat, 10 Apr 2021 18:05:01 -0300 Subject: [PATCH 1/2] sort FileNames --- mathics/builtin/files.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mathics/builtin/files.py b/mathics/builtin/files.py index 2f7ed11b5f..9b8638c7db 100644 --- a/mathics/builtin/files.py +++ b/mathics/builtin/files.py @@ -4201,7 +4201,6 @@ def apply(self, filename, datelist, attribute, evaluation): if py_attr == "All": os.utime(py_filename, (stattime, stattime)) except OSError as e: - print(e) # evaluation.message(...) return SymbolFailed @@ -5214,7 +5213,6 @@ def apply_3(self, forms, paths, n, evaluation, **options): elif n.get_head_name() == "System`DirectedInfinity": n = None else: - print(n) evaluation.message("FileNames", "badn", n) return else: @@ -5262,4 +5260,4 @@ def apply_3(self, forms, paths, n, evaluation, **options): filenames.add(osp.join(root, fn)) break - return Expression("List", *[String(s) for s in filenames]) + return Expression("List", *[String(s) for s in sorted(filenames)]) From 69a9c7c204b29146a83c9e51437ba9de2d2df830 Mon Sep 17 00:00:00 2001 From: mmatera Date: Sat, 10 Apr 2021 18:06:34 -0300 Subject: [PATCH 2/2] changes --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index d6b5305966..34320f9a7e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,7 @@ Enhancements * ``Table`` [*expr*, *n*] is supported. * ``ToString`` accepts an optional *form* parameter. * ``ToExpression`` handles multi-line string input +* ``FileNames`` returns a sorted list (#1250). Bug fixes +++++++++