View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016265 | Scribus | Scripter | public | 2020-10-09 07:10 | 2020-11-07 14:52 |
Reporter | sreerajp | Assigned To | jghali | ||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Windows | OS | 10 | OS Version | 1909 |
Product Version | 1.5.6.svn | ||||
Fixed in Version | 1.5.6.svn | ||||
Summary | 0016265: Python script error when using "i" as a variable name | ||||
Description | Python - 3.8.1 My Script is import scribus i = scribus.ImageExport() i.type = "jpg" print(i.type) Error Displayed 1024 Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'str' object has no attribute 'type' Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'str' object has no attribute 'type' | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
Unable to reproduce here. |
|
When I changed the script as below it is working import scribus im = scribus.ImageExport() im.type = "JPG" im.dpi = 150 print(im.dpi) |
|
After investigation, it appears this is a python 3.8 behavior change or issue when assigning a variable to another variable already defined with another type. In this case, "i" was already used as an internal variable with type string. With python 3.7, the line "i = scribus.ImageExport()" appropriately change the type of "i", with python 3.8 the type change apparently does not occur and after assignment, python 3.8 still considers "i" as a string. I committed an easy workaround which avoid using this common variable name. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-10-09 07:10 | sreerajp | New Issue | |
2020-10-09 12:52 | jghali | Note Added: 0048152 | |
2020-10-09 13:04 | sreerajp | Note Added: 0048154 | |
2020-10-09 17:24 | jghali | Assigned To | => jghali |
2020-10-09 17:24 | jghali | Status | new => resolved |
2020-10-09 17:24 | jghali | Resolution | open => fixed |
2020-10-09 17:24 | jghali | Fixed in Version | => 1.5.6.svn |
2020-10-09 17:24 | jghali | Note Added: 0048156 | |
2020-10-09 17:24 | jghali | Summary | While running ImageExport() python script error is coming => Python script error when using "i" as a variable name |
2020-11-07 14:52 | cbradney | Status | resolved => closed |