Skip to content

StdoutSpace makes input function not flush prompt #10

@matomatical

Description

@matomatical

Okay, I can't seem to figure out what StdoutSpace is used for, so I am absolutely raising this issue without fully understanding what's going on, but goodness it threw me for a few loops just now.

Steps to produce bug:

I Installed this project as per instructions in README. Then, I set username and password to None in settings_example.py. Finally, note that I don't have a 'Downloads/Uni' folder, but I left that as the downloads folder in settings. Note: setting username to None is enough by itself to produce the bug.

Result:

Matt (master *) lectureDL $ py lectureDL.py 
yes
/Users/Matt/Downloads/Uni doesn't exist.
Would you like to use the Downloads folder instead? Welcome to lectureDL.py
Would you like to download lectures from specific weeks or since a particular date?    
Using 12-12                                                                            
Lectures will be downloaded for the dates between 16 October and 22 October, inclusive.
Starting up Chrome instance
Starting login process                                                                 
farrugiam1
Enter your password: (password hidden by getpass)
Enter your username:                                                                   
Building list of subjects                                                              
Waiting for course list to load...                                                     
Waiting for course list to load... 
...

As you can see, it's all out of order. In particular, I need to type 'y' and, later, my username, before I am prompted for these things. I guess input() prints to sys.stdout and StdoutSpace holds off printing to stdout until it receives a newline. getpass probably avoids printing to stdout via sys.stdout.

Whatever the use of StdoutSpace, I suggest that another method be sought (one that doesn't involve meddling with regular stdout). I will disable it for now as per the instructions in the comments, and continue my attempt to understand why it's there in the first place and whether there's an alternative.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions