[1.0] some_name.sikuli hides a Python module some_name at import and gives weird errors

Bug #1210474 reported by RaiMan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Won't Fix
Undecided
Unassigned

Bug Description

--- problem ----
a Sikuli script xml.sikuli found on sys.path "hides" the Python module

users should obey the rule:
A Sikuli script, that can be found on sys.path at runtime, should not be named like a Python module, that is to be imported in the same script run.
-----------------------------------------------------------------------

with a simple script like

from xml.dom import minidom

I get the following error

File "/Users/colej/Documents/xml.sikuli/xml.py", line 1, in <module>
    from xml.dom import minidom
ImportError: No module named dom !!WHILE IMPORTING!!

I did not find any method, to get minidom imported to use the minidom.parse... options.

RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
Revision history for this message
RaiMan (raimund-hocke) wrote :

I again checked the problem with any combination of Sikuli and Jython 2.5.3 and 2.5.4:
I do not get the error anymore.

The only situation:
if a xml.sikuli can be found in sys.path (might be in the same directory or even the current script), the import fails.
Sikuli's import support prioritizes .sikuli scripts when searching along the sys.path, so a Sikuli script should not be named as a Python module, when this Python module should be imported.

Nevertheless I leave this a s bug, to check wether this can be avoided somehow.

description: updated
RaiMan (raimund-hocke)
Changed in sikuli:
status: In Progress → Won't Fix
importance: Medium → Undecided
assignee: RaiMan (raimund-hocke) → nobody
milestone: 1.1.0 → none
description: updated
summary: - [1.0] Problems importing xml.dom.minidom in script running mode
+ [1.0] some_name.sikuli hides a Python module some_name at import and
+ gives weird errors
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.