title: TypeError: expected str, bytes or os.PathLike object, not tuple
body: <p>So I am trying to create a form of encryption program with a GUI. Here is the code:</p>
  
  <pre><code>import sys
  from PyQt4 import QtGui, QtCore
  import os
  from Crypto.Hash import SHA256
  from Crypto import Random
  from Crypto.Cipher import AES
  
  class Window(QtGui.QMainWindow):
  
      def __init__(self):
          super(Window, self).__init__()
          self.setGeometry(50, 50, 500, 300)
          self.setWindowTitle("Encryptionprogram")
          self.setWindowIcon(QtGui.QIcon('pythonicon.png'))
  
          self.container = QtGui.QWidget()
          self.setCentralWidget(self.container)
          self.container_lay = QtGui.QVBoxLayout()
          self.container.setLayout(self.container_lay)
  
  
  
          extractAction = QtGui.QAction("Leave", self)
          extractAction.setShortcut("Ctrl+Q")
          extractAction.setStatusTip("Leave the app")
          extractAction.triggered.connect(self.close_application)
  
          mainMenu = self.menuBar()
          fileMenu = mainMenu.addMenu('&amp;File')
          fileMenu.addAction(extractAction)
  
          #Inputs
          self.Input = QtGui.QLineEdit("Filname", self)
  
          self.Input.setFixedWidth(200)
          self.Input.setFixedHeight(25)
          self.Input.move(20, 200)
          self.Input.setSizePolicy(QtGui.QSizePolicy.Fixed,
                                   QtGui.QSizePolicy.Fixed)
  
          self.Input2 = QtGui.QLineEdit("password", self)
  
          self.Input2.setFixedWidth(200)
          self.Input2.setFixedHeight(25)
          self.Input2.move(220, 200)
          self.Input2.setSizePolicy(QtGui.QSizePolicy.Fixed,
                                    QtGui.QSizePolicy.Fixed)
  
          self.home()
  
      def home(self):
  
          #Enter
  
          self.enter_btn = QtGui.QPushButton("Enter")
          self.container_lay.addWidget(self.enter_btn)
          self.enter_btn.clicked.connect(self.run1)
  
          self.checkBox = QtGui.QCheckBox('Krypter?', self)
          self.checkBox.move(0, 60)
  
          self.checkBox2 = QtGui.QCheckBox('Decrypt', self)
          self.checkBox2.move(100, 60)
  
          extractAction = QtGui.QAction(QtGui.QIcon('CloseIcon.png'), 'Close Program', self)
          extractAction.triggered.connect(self.close_application)
  
          self.toolBar = self.addToolBar("Extraction")
          self.toolBar.addAction(extractAction)
  
  
  
          self.show()
  
  
      def enlarge_window(self, state):
          if state == QtCore.Qt.Checked:
              self.setGeometry(50, 50, 1250, 600)
          else:
              self.setGeometry(50, 50, 500, 300)
  
      def close_application(self):
          choice = QtGui.QMessageBox.question(self, 'Attention!',
                                             "Close Program?",
                                             QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
          if choice == QtGui.QMessageBox.Yes:
              print("Closing...")
              sys.exit()
          else:
              pass
  
  
      def closeEvent(self, event):
          event.ignore()
          self.close_application()
  
      def getKey(self, password):
          hasher = SHA256.new(password.encode('utf-8'))
          return hasher.digest()
  
      def run1(self):
          if self.checkBox.isChecked():
              Inputfilename = self.Input.text()
              Inputpassword = self.Input2.text()
              filename = str(Inputfilename)
              password = str(Inputpassword)
              print(filename, password)
              self.encrypt(self.getKey(password), filename)
              print("Done.")
          else:
              print("no work")
  
  
      def encrypt(self, key, filename):
          chunksize = 64 * 1024
          outputFile = "(Krypteret)", filename
          filesize = str(os.path.getsize(filename)).zfill(16)
          IV = Random.new().read(16)
  
          encryptor = AES.new(key, AES.MODE_CBC, IV)
  
          with open(filename, 'rb') as infile:
              with open(outputFile, 'wb') as outfile:
                  outfile.write(filesize.encode('utf-8'))
                  outfile.write(IV)
  
                  while True:
                      chunk = infile.read(chunksize)
  
                      if len(chunk) == 0:
                          break
                      elif len(chunk) % 16 != 0:
                          chunk += b' ' * (16 - (len(chunk) % 16))
  
                      outfile.write(encryptor.encrypt(chunk))
  
  
      def decrypt(self, key, filename):
          chunksize = 64 * 1024
          outputFile = filename[11:]
  
          with open(filename, 'rb') as infile:
              filesize = int(infile.read(16))
              IV = infile.read(16)
  
              decryptor = AES.new(key, AES.MODE_CBC, IV)
  
              with open(outputFile, 'wb') as outfile:
                  while True:
                      chunk = infile.read(chunksize)
  
                      if len(chunk) == 0:
                          break
  
                      outfile.write(decryptor.decrypt(chunk))
                  outfile.truncate(filesize)
  
  
  
  
  
  def run():
      app = QtGui.QApplication(sys.argv)
      GUI = Window()
      sys.exit(app.exec_())
  
  
  run()
  </code></pre>
  
  <p>But I'm getting this error</p>
  
  <pre><code>    Traceback (most recent call last):
    File "D:/Dokumenter - HDD/Python/GUI.py", line 119, in run1
      self.encrypt(self.getKey(password), filename)
    File "D:/Dokumenter - HDD/Python/GUI.py", line 134, in encrypt
      with open(outputFile, 'wb') as outfile:
  TypeError: expected str, bytes or os.PathLike object, not tuple
  Closing...
  
  Process finished with exit code 0
  </code></pre>
  
  <p>I dont know how to fix this I have tried to find a solution not only just on the internet but i have also tried to fix it just be lokking after any potential mistakes but at this moment i have found nothing. If anyone could explain the error and/or come with a solution it would mean the world to me.
  Thanks!</p>