title: input() function throwing error in presence of threading in python
body: <p>Following code works as expected. It takes two inputs and outputs the same</p>
  
  <pre><code>import sys
  import threading
  def main():
      n = int(input("input n:"))
      parents = list(map(int, input("input parents:").split()))
      print("n is {0} and parents is {1}".format(n,str(parents)))
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>The moment I add this additional code for enabling more depth for recursion and threading, it throws a value error. Inputs I give are '3' for the first input (without quotes) and '-1 0 1' for the second input (without quotes). </p>
  
  <pre><code>import sys
  import threading
  def main():
      n = int(input("input n:"))
      parents = list(map(int, input("input parents:").split()))
      print("n is {0} and parents is {1}".format(n,str(parents)))
  
  sys.setrecursionlimit(10**7)  # max depth of recursion
  threading.stack_size(2**27)   # new thread will get stack of such size
  threading.Thread(target=main).start()
  
  if __name__ == "__main__":
      main()
  </code></pre>