File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -277,8 +277,8 @@ def send(self, line):
277277 # make sure we are connected before sending
278278 if not self ._connected :
279279 yield from self ._connected_future
280- line = line . splitlines ()[ 0 ] [:500 ] + "\r \n "
281- data = line .encode ("utf-8" , "replace" )
280+ line = line [:500 ] + "\r \n "
281+ data = line .encode ("utf-8" )
282282 self ._transport .write (data )
283283
284284 def data_received (self , data ):
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ def password(text, notice):
3232
3333 if length > 50 :
3434 notice ("Maximum length is 50 characters." )
35+ return
3536
3637 # add alpha characters
3738 if "alpha" in text or "letter" in text :
@@ -65,18 +66,18 @@ def password(text, notice):
6566@hook .command ("wpass" , "wordpass" , "wordpassword" , autohelp = False )
6667def word_password (text , notice ):
6768 """[length] - generates an easy to remember password with [length] (default 4) commonly used words"""
68- if text :
69- try :
70- length = int (text )
71- except ValueError :
72- notice ("Invalid input '{}'" .format (text ))
73- return
74- else :
75- length = 4
69+ try :
70+ length = int (text )
71+ except ValueError :
72+ length = 3
73+
74+ if length > 10 :
75+ notice ("Maximum length is 50 characters." )
76+ return
77+
7678 words = []
7779 # generate password
7880 for x in range (length ):
7981 words .append (gen .choice (common_words ))
8082
8183 notice ("Your password is '{}'. Feel free to remove the spaces when using it." .format (" " .join (words )))
82-
You can’t perform that action at this time.
0 commit comments