title: Using getpass() fails in the self.__init__() method but works fine when used functionally. Why is this?
body: <p>I can't work out what I'm doing wrong here. I want to set up a new user if this class is instantiated and there is no user already pickled. My <code>__init__</code> method currently looks like this:</p>
  <pre><code>class User:
      def __init__(self, *args, **kwargs):
          if os.path.isfile(f&quot;{get_cwd()}/user.pickle&quot;):
              self.load_user()
          else:
              self.email_address = input(&quot;What's your email address?: &quot;)
              self.email_password = base64.b64encode(getpass(&quot;What's your email password?: &quot;).encode(&quot;utf-8&quot;))
              self.save_user()
  </code></pre>
  <p>However, when I instantiate the class, it doesn't get past asking for self.email_address. If I change the self.email_password to a simple input function it works. What am I doing wrong with using <code>getpass()</code> here?</p>
  <p>I've tried making a separate function to receive / encode the password variable and calling that from within the <code>__init__</code> method but it does the same thing.</p>
  <p>If I make the whole script functional if works (but it's a little lengthy!)</p>
  <p>Why am I having problems with <code>getpass</code> and a class-based approach??</p>
  <p><strong>EDIT</strong>: was trying to run through PyCharm terminal and the above is more or less irrelevant.</p>