Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prompts: bugfix: prompt_for_input breaking input #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yanivhasbani
Copy link

prompt_for_input breaks long input strings incorrectly due to a bug in python's input functions.

E.G:

from humanfriendly.prompts import prompt_for_input, prompt_for_choice

x = [
'/System/Library/CoreServices/SpringBoard.app/SpringBoard', 
'/System/Library/PrivateFrameworks/SpringBoard.framework/SpringBoard', 
'/System/Library/PrivateFrameworks/SpringBoardHome.framework/SpringBoardHome', 
'/System/Library/PrivateFrameworks/SpringBoardFoundation.framework/SpringBoardFoundation', 
'/System/Library/PrivateFrameworks/SpringBoardUIServices.framework/SpringBoardUIServices', 
'/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices', 
'/System/Library/PrivateFrameworks/SpringBoardUI.framework/SpringBoardUI', 
'/System/Library/PrivateFrameworks/AXSpringBoardServerInstance.framework/AXSpringBoardServerInstance', 
'/System/Library/SpringBoardPlugins/StoreDemoPlugin.servicebundle/StoreDemoPlugin'
]

prompt_for_choice(x)

Expected result:

1. /System/Library/CoreServices/SpringBoard.app/SpringBoard
2. /System/Library/PrivateFrameworks/SpringBoard.framework/SpringBoard
3. /System/Library/PrivateFrameworks/SpringBoardHome.framework/SpringBoardHome
4. /System/Library/PrivateFrameworks/SpringBoardFoundation.framework/SpringBoardFoundation
5. /System/Library/PrivateFrameworks/SpringBoardUIServices.framework/SpringBoardUIServices
6. /System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
7. /System/Library/PrivateFrameworks/SpringBoardUI.framework/SpringBoardUI
8. /System/Library/PrivateFrameworks/AXSpringBoardServerInstance.framework/AXSpringBoardServerInstance
9. /System/Library/SpringBoardPlugins/StoreDemoPlugin.servicebundle/StoreDemoPlugin

Enter your choice as a number or unique substring (Control-C aborts):

actual result:

1. /System/Library/CoreServices/SpringBoard.app/SpringBoard
2. /System/Library/PrivateFrameworks/SpringBoard.framework/SpringBoard
3. /System/Library/PrivateFrameworks/SpringBoardHome.framework/SpringBoardHome
pringBoardFoundation.framework/SpringBoardFoundation
5. /System/Library/PrivateFrameworks/SpringBoardUIServices.framework/SpringBoardUIServices
6. /System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
/PrivateFrameworks/SpringBoardUI.framework/SpringBoardUI
8. /System/Library/PrivateFrameworks/AXSpringBoardServerInstance.framework/AXSpringBoardServerInstance
9. /System/Library/SpringBoardPlugins/StoreDemoPlugin.servicebundle/StoreDemoPlugin

your choice as a number or unique substring (Control-C aborts):

prompt_for_input breaks long input strings incorrectly due to a bug in python's input functions.
@yanivhasbani
Copy link
Author

Anyone???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant