@@ -2224,22 +2224,24 @@ def ftp_OPTS(self, line):
22242224 raise ValueError ("Invalid number of arguments" )
22252225 if " " in line :
22262226 cmd , arg = line .split (" " )
2227- if ";" not in arg :
2228- raise ValueError ("Invalid argument" )
22292227 else :
22302228 cmd , arg = line , ""
2231- # actually the only command able to accept options is MLST
2232- if cmd .upper () != "MLST" or "MLST" not in self .proto_cmds :
2229+ # the only commands able to accept options are MLST and UTF8
2230+ if cmd .upper () in ("UTF8" , "UTF-8" ):
2231+ self .respond ('200 Always in UTF8 mode.' )
2232+ elif cmd .upper () == "MLST" and "MLST" in self .proto_cmds :
2233+ if arg and ';' not in arg :
2234+ raise ValueError ('Invalid argument' )
2235+ facts = [x .lower () for x in arg .split (";" )]
2236+ self ._current_facts = [
2237+ x for x in facts if x in self ._available_facts
2238+ ]
2239+ f = "" .join ([x + ";" for x in self ._current_facts ])
2240+ self .respond ("200 MLST OPTS " + f )
2241+ else :
22332242 raise ValueError (f'Unsupported command "{ cmd } "' )
22342243 except ValueError as err :
22352244 self .respond (f"501 { err } ." )
2236- else :
2237- facts = [x .lower () for x in arg .split (";" )]
2238- self ._current_facts = [
2239- x for x in facts if x in self ._available_facts
2240- ]
2241- f = "" .join ([x + ";" for x in self ._current_facts ])
2242- self .respond ("200 MLST OPTS " + f )
22432245
22442246 def ftp_NOOP (self , line ):
22452247 """Do nothing."""
0 commit comments