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
issue with list in Python 3.8.5 #88242
Comments
I am using Python under Windows 10 on Dell for a log time. As well as choosing old data from a list, After investigation, it appears memory issues. |
I'm using tkinter 8.6 with Python |
Can you show an example code where this occurs? Which Python 3.8 subversion are you using? How do you conclude these are memory issues? |
I doubt it is a memory issue. Tell us what investigation you did that lead you to that conclusion. Python code doesn't normally just stop working for no reason. I expect that you changed your code in some way and introduced a bug. This is not a help desk for debugging your own code. If you need help with that, I recommend Reddit's r/learnpython, StackOverflow, or the Python-List mailing list. If you still think that this is a bug in Python, not in your own code, please show us the smallest program you can that demonstrates the problem:
For example, try this: L = [1, 2, 3]
L.insert(0, 999)
print(L)
# you should get [999, 1, 2, 3] If you get that result, your Python is working fine and the bug is in your code. |
I'm using tkinter for a long time, my application was running fine till 1st May, and suddenly happen this issue. After adding a new data to a list, it showing in some places of tkinter components. For example, in treeview, it shows based on running specfic function, but on click it appear this message: Traceback (most recent call last):
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
File "xxxxxxx.py", line 1423, in OnDoubleClick
itemXid = assetinfo_lst[xrec][1]
IndexError: list index out of range in OnDoubleClick: itemXid = assetinfo_lst[xrec][1] However, after exiting the program and restarting it, it is working properly. it could be the mainloop is not working: Is an issue with a new update of Windows 10? MS suggest to reinstall tkinter and recover Windows |
I tried the following method: class MasterApp(object):
def __init__(self, root):
....
def fun_astinfo_add(self):
...
assetinfo_lst.append(lst_values)
...
MasterApp(root)
The program works properly, but the screen disappears and then reappears. Which means, that mainloop() works in the first time, Reinstalling Tkinter is the right solution? Will it work? |
Hi Mohamed, you can try changing the following line: itemXid = assetinfo_lst[xrec][1] to: print('xrec',xrec)
itemXid = assetinfo_lst[xrec]
itemXid = itemXid[1] This will show you if the index error is caused by xrec or by [1] lookup. If caused by xrec lookup, you will see what xrec value is at this point. |
I made changes but result is same: xrec = self.treedata.selection()[0]
xrec = int(xrec[1:], 16) - 1
print('xrec: ', xrec)
itemXid = assetinfo_lst[xrec]
itemXid = itemXid[1] Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
File "xxxxxx.py", line 1463, in OnDoubleClick
itemXid = assetinfo_lst[xrec]
IndexError: list index out of range
As I mentioned, It seems that the recent update of Windows has affected Tkinter, |
Hi Mohamed, From the output it looks like the app is trying to get item at index 28 To get further help, I think you will need to create a minimal runnable |
Please find attached, the demo with dummy data. As I mentioned, it was working fine until May 1st. class MasterApp(object):
def __init__(self, root):
....
def fun_astinfo_add(self):
...
assetinfo_lst.append(lst_values)
...
MasterApp(root)
|
On Sun, May 09, 2021 at 10:04:29PM +0000, Mohamed wrote:
That isn't what it looks like to me. If updating Windows had affected https://duckduckgo.com/?q=latest+update+of+windows+breaks+tkinter It would be very, very suprising if you were the only person who has Mohamed, you said that you had done an investigation which showed memory So far there is no evidence for a bug in Tkinter or Python. This is not https://www.reddit.com/r/learnpython/ http://mail.python.org/mailman/listinfo/python-list news:comp.lang.python https://discuss.python.org/c/users/7 https://www.python.org/community/irc/ No matter which forum you go to, you will be asked for a minimal example https://stackoverflow.com/help/minimal-reproducible-example https://ericlippert.com/2014/03/05/how-to-debug-small-programs/ https://medium.com/swlh/how-to-ask-smart-questions-d02f053a02ac http://www.catb.org/esr/faqs/smart-questions.html Note that a minimal program **MUST** be runnable. There is no point just |
On Sun, May 09, 2021 at 11:55:56PM +0000, Mohamed wrote:
If it was working fine until May 1st, I would start my investigation by Is your source code in a source control repository? Can you compare it
Your traceback involves a keyerror and an index error. What makes you You are trying to delete a module from sys.modules:
(why?) but the key is not found. That exception is then caught and It really looks to me that your callback function fun_asset_current is
I'm not an expert at tkinter, but creating a new MasterApp object |
It doesn't seem to be a Python bug at all. This is pretty awkward that even without upgrading your Python your program is breaking. I don't know tkinter well but upgrading your Windows shouldn't affect tkinter at all. And as Steven described if that was the case IDLE wouldn't work and there would lot's of reports and issues like this. |
This statement in the main program which is calling a subprogram, to control for multiple runs. Even I close this statement, the issue is same. I've contacted Microsoft support team, they have different opinions, about the impact of the latest Windows update which was on May 1st |
I chose Python to develop a huge information system. |
Are they saying this error is result of Windows update? (It may be. I didn't notice you're talking about 21H1, I thought you're talking about other patch updates.) |
For your information Python 3.8 is now in security fix-only mode and no longer receives regular updates. That means that any potential compatibility issues with Windows updates will not be addressed. Could you please update to Python 3.9 and try again? |
These are the latest updates: There is no an option to uninstall the following: I don't know, any of these updates might have an effect. I'm using a lot of modules, it means I have to install them again on Python 3.9 |
Shortcut is store the output of pip in a file using, pip freeze > file.txt And then after installing Python 3.9 py -3.9 -m pip install -m file.txt |
Thanks a lot |
Today the nosy list is not working. When I don't even mean to add or remove someone, that person is automatically being added. |
Sorry, for the disturbance in the nosy list but it's glitching. |
Given that 3.8 is in security-fix-only mode and that it's not clear that this is actually a Python bug, I'm closing the issue. If you can reproduce the issue in Python 3.9 with a short script, do please open a new issue (or reopen this one) with the reproducer and a description of what's going wrong. In the meantime, please see either the python-list@python.org mailing list or the Users category of discuss.python.org for community support for using Tkinter. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: