Skip to content

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