eric ide

Issue381

Classification
Title: Shell scoping rules
Type: behavior Product: eric6
Process
Priority: normal    
Status: closed Resolution: fixed
Superseder: Nosy List: detlev, termim
Assigned to: Keywords:

Created on 2021-03-04.22:51:46 by termim, last changed by detlev.

Files
File Name Uploaded Description Remove
eric6_error.log termim, 2021-03-13.21:27:40
shell_scope.png termim, 2021-03-06.06:49:55
stest.png termim, 2021-03-04.22:51:46
test-eric.tgz termim, 2021-03-10.02:33:36
Messages (9.0)
msg1437 (view) Author: detlev Date: 2021-03-14.11:49:19
Not really. However, the error log indicates, that Python tried to mix the HG workspace 
sources with the installed ones. As I don't know how eric was invoked I suggest the 
follwoing.

1. cd <HG workspace>/eric6
2. <path to Python executable> ./eric6.py

If this is a fresh checkout of the sources (i.e. has never been there before) you must 
execute the compileUiFiles.py script first. This step is needed in order to generate the 
Python sources for all the form files (*.ui).
msg1436 (view) Author: termim Date: 2021-03-13.21:27:40
I tried to test it from the HG workspace but got an exception. Should I do something special when running from the workspace?
msg1435 (view) Author: detlev Date: 2021-03-13.18:47:24
This issue was caused by the Python scoping rules. The fix will emulate it in the debugger 
backend. Fixed with changeset 08b8b3d2deb1. It will be included in release 21.4.
msg1431 (view) Author: detlev Date: 2021-03-11.16:30:19
I see the same effect. I think it is caused by some magic done by asyncio. Right now I have 
no idea how to fix it.
msg1429 (view) Author: termim Date: 2021-03-10.02:33:36
Attached is a project that reproduces the problem for me.
It requires aiohttp installed. Instructions how to reproduce 
are in test.py file.
msg1428 (view) Author: detlev Date: 2021-03-06.08:16:38
I am not able to reproduce your observation. Please create a minimal script that generates 
this issue and indicate the place, where to set the breakpoint.
msg1427 (view) Author: termim Date: 2021-03-06.06:49:55
Sorry for the confusion - tried to simplify example and did it wrong.
Please take a look at the new screenshot. At the top - fresh eric session
where everything works fine. At the bottom - one of my projects waiting 
at some breakpoint. Here the same expression gives the NameError exception.
msg1426 (view) Author: detlev Date: 2021-03-05.17:08:48
It works absolutely fine for me. The screenshot indicates that there is an issue in your 
input. The range(len(d)) results in key values of 0, 1, 2. Key 0 is not part of the 
dictionary, hence the KeyError. Python is right in pointing the finger at you.
msg1425 (view) Author: termim Date: 2021-03-04.22:51:46
In the Shell widget local variables are not available in list/dict/set comprehensions.
History
Date User Action Args
2021-03-14 11:49:19detlevsetmessage_count: 8.0 -> 9.0
messages: + msg1437
2021-03-13 21:27:40termimsetfiles: + eric6_error.log
message_count: 7.0 -> 8.0
messages: + msg1436
2021-03-13 18:47:24detlevsetstatus: open -> closed
resolution: fixed
messages: + msg1435
message_count: 6.0 -> 7.0
2021-03-11 16:30:19detlevsetstatus: closed -> open
resolution: rejected -> (no value)
messages: + msg1431
message_count: 5.0 -> 6.0
2021-03-10 02:33:36termimsetfiles: + test-eric.tgz
message_count: 4.0 -> 5.0
messages: + msg1429
2021-03-06 08:16:38detlevsetmessage_count: 3.0 -> 4.0
messages: + msg1428
2021-03-06 06:49:55termimsetfiles: + shell_scope.png
message_count: 2.0 -> 3.0
messages: + msg1427
2021-03-05 17:08:48detlevsetstatus: new -> closed
resolution: rejected
messages: + msg1426
message_count: 1.0 -> 2.0
nosy: + detlev
2021-03-04 22:51:46termimcreate