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

[QUESTION] IPython 7.10.1 on Python 3.8.0 "Press ENTER to continue..." possible bug? #12025

Open
yanniskatsaros opened this issue Dec 10, 2019 · 11 comments

Comments

@yanniskatsaros
Copy link

@yanniskatsaros yanniskatsaros commented Dec 10, 2019

When using IPython 7.10.1 with Python 3.8.0, the terminal will (randomly?) prompt me to Press ENTER to continue... after submitting a command. See screenshot attached below.

image

Is this by design, or this is a bug? I haven't encountered this on previous versions (so I suspect it's a Python 3.8 issue) and ideally it's not something I want.

Additional Info

python -c "import IPython; print(IPython.sys_info())"

{'commit_hash': 'e508b6e4d',
 'commit_source': 'installation',
 'default_encoding': 'utf-8',
 'ipython_path': 'C:\\Users\\Yannis.Katsaros\\AppData\\Local\\Continuum\\anaconda3\\envs\\aoc\\Lib\\site-packages\\IPython',
 'ipython_version': '7.10.1',
 'os_name': 'nt',
 'platform': 'Windows-10-10.0.17134-SP0',
 'sys_executable': 'C:\\Users\\Yannis.Katsaros\\AppData\\Local\\Continuum\\anaconda3\\envs\\aoc\\python.exe',
 'sys_platform': 'win32',
 'sys_version': '3.8.0 (default, Nov  6 2019, 16:00:02) [MSC v.1916 64 bit '
                '(AMD64)]'}
@Carreau
Copy link
Member

@Carreau Carreau commented Dec 11, 2019

Likely a bug due to update to prompt toolkit 3.
You can try to downgrade to prompt_toolkit 2 to avoid this; or run from github/master branch and modify the source to print the stack trace when this happens to debug.

@yanniskatsaros
Copy link
Author

@yanniskatsaros yanniskatsaros commented Dec 12, 2019

Likely a bug due to update to prompt toolkit 3.
You can try to downgrade to prompt_toolkit 2 to avoid this; or run from github/master branch and modify the source to print the stack trace when this happens to debug.

@Carreau that's a good idea - I also tried looking through prompt-toolkit's current issues but nothing relevant seemed to stand out.

@H4CKY54CK
Copy link

@H4CKY54CK H4CKY54CK commented Dec 14, 2019

Downgrading prompt-toolkit from 3.0.2 to 2.0.2 did the trick for me. 2.0.1 caused a problem.

@Carreau
Copy link
Member

@Carreau Carreau commented Dec 16, 2019

7.10.2 has been released; let me know if it fixes this issue.

@Carreau Carreau added this to the 7.10.2 milestone Dec 16, 2019
@yanniskatsaros
Copy link
Author

@yanniskatsaros yanniskatsaros commented Dec 18, 2019

7.10.2 has been released; let me know if it fixes this issue.

Some quick tests I did suggested that the issue had been resolved at first, but then a new/similar issue popped up:
image

Once again, this was with the following package info:

{'commit_hash': 'f7f2eae63',
 'commit_source': 'installation',
 'default_encoding': 'utf-8',
 'ipython_path': 'C:\\Users\\Yannis.Katsaros\\AppData\\Local\\Continuum\\anaconda3\\envs\\aoc\\Lib\\site-packages\\IPython',
 'ipython_version': '7.10.2',
 'os_name': 'nt',
 'platform': 'Windows-10-10.0.17134-SP0',
 'sys_executable': 'C:\\Users\\Yannis.Katsaros\\AppData\\Local\\Continuum\\anaconda3\\envs\\aoc\\python.exe',
 'sys_platform': 'win32',
 'sys_version': '3.8.0 (default, Nov  6 2019, 16:00:02) [MSC v.1916 64 bit '
                '(AMD64)]'}
@Carreau Carreau removed this from the 7.10.2 milestone Feb 1, 2020
@H4CKY54CK
Copy link

@H4CKY54CK H4CKY54CK commented Feb 19, 2020

7.12.0, fresh IPython install, edge-case?
image

I initially thought all was good, as when I freshly install IPython and it's dependencies, I like to do something like import os and repeat the command about 30 or 40 times, as this seems fairly reliable. But this time, it only (coincidentally?) happened upon creation of an object I had not previously used before.

I don't know the super technical details, but it seemed odd that it happened on an event it had never encountered before (personally, on my computer). Dunno. Not important. But providing the above data is important, so cheers, great work, love you guys/gals, and I'll just downgrade prompt-toolkit to 2.0.2 in the meantime.

EDIT: By the way, I repeated those 18 lines preceding that import, and it didn't do it that time. Too bad it wasn't repeatable.

EDIT 2: Here ya go.

{'commit_hash': '8bda98619',
'commit_source': 'installation',
'default_encoding': 'utf-8',
'ipython_path': 'C:\Users\tk13x\AppData\Local\Programs\Python\Python38\Lib\site-packages\IPython',
'ipython_version': '7.12.0',
'os_name': 'nt',
'platform': 'Windows-10-10.0.18362-SP0',
'sys_executable': 'C:\Users\tk13x\AppData\Local\Programs\Python\Python38\python.exe',
'sys_platform': 'win32',
'sys_version': '3.8.2rc2 (tags/v3.8.2rc2:777ba07, Feb 18 2020, 09:11:15) [MSC '
'v.1916 64 bit (AMD64)]'}

@H4CKY54CK
Copy link

@H4CKY54CK H4CKY54CK commented Mar 1, 2020

I'm only just now noticing I was not on the current version. My apologies.

@Carreau
Copy link
Member

@Carreau Carreau commented Mar 1, 2020

I'm only just now noticing I was not on the current version. My apologies.

No need, 7.13 was release 2 days ago, so at the time of your comment you were on the lastest stable.

@H4CKY54CK
Copy link

@H4CKY54CK H4CKY54CK commented Mar 2, 2020

Did this get fixed in 8.0.0? I can't seem to reproduce it at all.

Edit: Nevermind, user error, apparently.

@H4CKY54CK
Copy link

@H4CKY54CK H4CKY54CK commented Mar 6, 2020

I don't know what the status on this issue is, but I came across something in a BPO. I realize this isn't a long-term solution, but until ProactorEventLoop is up to the task, this is what I've done to patch my iPython (7.13.0 & 8.0.0dev, Windows10, 64 bit, Python 3.8.1):

if sys.platform == 'win32':
  asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

in ..\site-packages\IPython\terminal\interactiveshell.py

I'm not experienced enough to know, or even suspect, if this could cause other issues elsewhere, but we'll cross that bridge when we get there.

@H4CKY54CK
Copy link

@H4CKY54CK H4CKY54CK commented Apr 25, 2020

So, after my last comment, I had ended up reinstalling python for other reasons, but I noticed that iPython was no longer producing this error. I continued on, as normal.

I ran into this again, under some interesting circumstances.
image
The context (not important): I was looking for sudoku strings, and wasn't trying to flood my terminal with 20k+ lines from the page.

What seems relevant here, is something I had briefly mentioned before, about it only happening for an action that I had not previously done before, ever (at least in iPython. i may have done this in a script, but idk). I don't use requests that often, and this is the first time I used .raw. But this is also true of many commands I've used recently. I (probbaly naively) assume there's a specific circumstance in which this seems to happen.

{'commit_hash': 'd0b255042',
'commit_source': 'installation',
'default_encoding': 'utf-8',
'ipython_path': 'C:\Users\tk13x\AppData\Local\Programs\Python\Python38\Lib\site-packages\IPython',
'ipython_version': '7.13.0',
'os_name': 'nt',
'platform': 'Windows-10-10.0.18362-SP0',
'sys_executable': 'C:\Users\tk13x\AppData\Local\Programs\Python\Python38\python.exe',
'sys_platform': 'win32',
'sys_version': '3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC '
'v.1916 64 bit (AMD64)]'}

I don't know. Just thought I'd share. In the event that it would be beneficial to be sitting in front of this terminal (albeit a few lines later), I've left this terminal open and minimized it. (You know, in case you would be able to inspect this specific point in time with a certain tool. (idk maybe I'm going insane) Had to close it

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.