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

Bug/Patch: Problem with xml/__init__.py when using freeze.py #46277

Closed
glomde mannequin opened this issue Jan 31, 2008 · 7 comments
Closed

Bug/Patch: Problem with xml/__init__.py when using freeze.py #46277

glomde mannequin opened this issue Jan 31, 2008 · 7 comments
Labels

Comments

@glomde
Copy link
Mannequin

glomde mannequin commented Jan 31, 2008

BPO 1985
Nosy @gvanrossum, @tiran

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:

assignee = None
closed_at = <Date 2010-08-04.23:53:58.974>
created_at = <Date 2008-01-31.22:40:53.584>
labels = ['easy']
title = 'Bug/Patch: Problem with xml/__init__.py when using freeze.py'
updated_at = <Date 2010-08-04.23:53:58.973>
user = 'https://bugs.python.org/glomde'

bugs.python.org fields:

activity = <Date 2010-08-04.23:53:58.973>
actor = 'terry.reedy'
assignee = 'none'
closed = True
closed_date = <Date 2010-08-04.23:53:58.974>
closer = 'terry.reedy'
components = []
creation = <Date 2008-01-31.22:40:53.584>
creator = 'glomde'
dependencies = []
files = []
hgrepos = []
issue_num = 1985
keywords = ['easy']
message_count = 7.0
messages = ['61937', '61963', '61984', '61989', '62089', '70754', '112253']
nosy_count = 4.0
nosy_names = ['gvanrossum', 'christian.heimes', 'glomde', 'meatballhat']
pr_nums = []
priority = 'low'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1985'
versions = ['Python 2.6', 'Python 2.5']

@glomde
Copy link
Mannequin Author

glomde mannequin commented Jan 31, 2008

Hi,

I tried to do freeze.py for my script that uses ElementTree.
But got the this error:

File "/usr/lib/python2.5/xml/init.py", line 45, in <module>
_xmlplus.__path__.extend(path)
AttributeError: 'str' object has no attribute 'extend'

The reason seems that _xmlplus.__path__ is a string
after freeze.py.

I fixed it by changing the import to:

        try:
            _xmlplus.__path__.extend(__path__)
            sys.modules[__name__] = _xmlplus
        except AttributeError:
            pass

This might not be the correct solution but it works for me. I do not
really now
how the __path__ variable works in a freezed environment.

Best regards

@gvanrossum
Copy link
Member

I think nobody really cares about freeze any more -- it isn't maintained.

@tiran
Copy link
Member

tiran commented Feb 2, 2008

Should freeze be removed if it's no longer maintained? Freeze is partly
used by py2exe and py2app. Maybe the maintainers of the apps can step in
and maintain the parts of the freeze api they require. The rest could
then be deprecated for Python 2.6 and removed from 3.0.

@gvanrossum
Copy link
Member

Why don't you ask that question on python-dev? Maybe someone volunteers!

@glomde
Copy link
Mannequin Author

glomde mannequin commented Feb 6, 2008

I still think the __init__ file should be changed and use
the extend_path function instead of extend.

Se below for answer I got on the python list.

The extend_path function (found in the pkgutil standard module) can handle
this.
http://docs.python.org/lib/module-pkgutil.html

--
Gabriel Genellina

@gvanrossum
Copy link
Member

Nobody seems to care enough.

@akuchling akuchling added the easy label Aug 6, 2008
@meatballhat
Copy link
Mannequin

meatballhat mannequin commented Aug 1, 2010

can this be closed? I'd do it myself if I had the triage bit :)

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants