File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ Quick summary of major changes:
95
95
96
96
[ ![ License] ( https://img.shields.io/github/license/cylc/cylc-flow.svg?color=lightgrey )] ( https://github.com/cylc/cylc-flow/blob/master/COPYING )
97
97
98
- Copyright (C) 2008-<span actions:bind =' current-year ' >2023 </span > NIWA & British Crown (Met Office) & Contributors.
98
+ Copyright (C) 2008-<span actions:bind =' current-year ' >2024 </span > NIWA & British Crown (Met Office) & Contributors.
99
99
100
100
Cylc is free software: you can redistribute it and/or modify it under the terms
101
101
of the GNU General Public License as published by the Free Software Foundation,
Original file line number Diff line number Diff line change @@ -104,12 +104,14 @@ def _parse_cli(*ids: str) -> List[Tokens]:
104
104
>>> parse_back('//cycle')
105
105
Traceback (most recent call last):
106
106
InputError: Relative reference must follow an incomplete one.
107
- E.G: workflow //cycle/task
108
107
109
108
>>> parse_back('workflow//cycle', '//cycle')
110
109
Traceback (most recent call last):
111
110
InputError: Relative reference must follow an incomplete one.
112
- E.G: workflow //cycle/task
111
+
112
+ >>> parse_back('workflow///cycle/')
113
+ Traceback (most recent call last):
114
+ InputError: Invalid ID: workflow///cycle/
113
115
114
116
"""
115
117
# upgrade legacy ids if required
@@ -125,7 +127,11 @@ def _parse_cli(*ids: str) -> List[Tokens]:
125
127
if id_ .endswith ('/' ) and not id_ .endswith ('//' ): # noqa: SIM106
126
128
# tolerate IDs that end in a single slash on the CLI
127
129
# (e.g. CLI auto completion)
128
- tokens = Tokens (id_ [:- 1 ])
130
+ try :
131
+ # this ID is invalid with or without the trailing slash
132
+ tokens = Tokens (id_ [:- 1 ])
133
+ except ValueError :
134
+ raise InputError (f'Invalid ID: { id_ } ' )
129
135
else :
130
136
raise InputError (f'Invalid ID: { id_ } ' )
131
137
is_partial = tokens .get ('workflow' ) and not tokens .get ('cycle' )
Original file line number Diff line number Diff line change 14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
17
- _copyright_year = 2023 # This is set by GH Actions update_copyright workflow
17
+ _copyright_year = 2024 # This is set by GH Actions update_copyright workflow
You can’t perform that action at this time.
0 commit comments