title: TypeError: expected string or bytes-like object python
body: <p>I am creating a password validation system. However I have received an error message and i do not understand why or where the error is. I tested these individual pieces of validations on a separate files and they worked okay, however when they were implemented into my actual program, it seems to not work.
  This is the code responsible for the validation.</p>
  
  <pre><code>#Ensures passwords match and writes the account details to the database
  def Checker():
      if re.match(user_password2v2, user_passwordv2):
          match+=1
      else:
          match=match
      if len(user_namev2) &gt; 5 and len(user_passwordv2)&gt;7:#Ensures the username and passwor are of a minimum length
          match+=1
      else:
          match=match
      if re.search(r"\W", user_password2): #Ensures a character is present in the password
          match+=1
      else:
          match=match
      if re.search(r'[0-9]', user_weightv2):#Ensures numbers are used in the weight entry
          match+=1
      else:
          match=match
      if match==4:
          user_information.append(user_namev2)
          user_information.append(user_passwordv2)
          user_information.append(weight)
          Goal_Select()
      if match!=4:
          Error()
  </code></pre>
  
  <p><code>Error()</code> should be ran if any of these conditional statements are not met. </p>
  
  <p><code>user_namev2</code>, <code>user_passwordv2</code> and <code>user_weightv2</code> are all variables which are pulled from tkinter entry boxes.</p>
  
  <p>Here is a screenshot of my whole error message.
  <a href="https://i.stack.imgur.com/xDlhD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xDlhD.png" alt="enter image description here"></a></p>