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

Error reading address when debugging delphivcl library. #1288

Closed
fansxs opened this issue Jan 18, 2024 · 5 comments
Closed

Error reading address when debugging delphivcl library. #1288

fansxs opened this issue Jan 18, 2024 · 5 comments

Comments

@fansxs
Copy link

fansxs commented Jan 18, 2024

When debugging using the Delphivcl library, stop in the click event of the control, then switch to the variables panel, click on the globals node, and a read address error will pop up, as shown in the figure. But debugging non delphivcl py files is normal.
QQ图片20240118170706
QQ图片20240118170629

@pyscripter
Copy link
Owner

pyscripter commented Jan 19, 2024

What is PythonStudio.exe?
Could you please post a minimal sample script to replicate the error?

@fansxs
Copy link
Author

fansxs commented Jan 19, 2024

The version is 4.3.4.0 x64. Here is the example code, thanks :)

from delphivcl import *

class MainForm(Form):

def __init__(self, owner):
    self.Caption = "A VCL Form..."
    self.SetBounds(10, 10, 500, 400)
    self.Position = "poScreenCenter"

    self.lblHello = Label(self)   # For example, breakpoints here, Then click on globals in the variable panel
    self.lblHello.SetProps(Parent=self,
        Caption="Hello DelphiVCL for Python", Color=clRed)
    self.lblHello.SetBounds(10, 10, 300, 24)

def main():
Application.Initialize()
Application.Title = "Hello Python"
Main = MainForm(Application)
Main.Show()
FreeConsole()
Application.Run()
Main.Destroy()

main()

@limelect
Copy link

this is your source
it runs ok
Uploading Screenshot - 19_01_2024 , 17_05_41.jpg…

@pyscripter
Copy link
Owner

This is a delphivcl issue. See Embarcadero/DelphiVCL4Python#84.

Hopefully this will be fixed in the next release.

@pyscripter
Copy link
Owner

In version 1.05 the culprit is Screen.Realign

Run the following script:

from delphivcl import Screen
print(Screen.Realign.__doc__)

Output:

Traceback (most recent call last):
  File "<module1>", line 2, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 37: invalid start byte

Workaround:

from delphivcl import *
del(Screen)

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

No branches or pull requests

3 participants