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

DistributionMetaData error ? #38204

Closed
dutoitc mannequin opened this issue Mar 23, 2003 · 4 comments
Closed

DistributionMetaData error ? #38204

dutoitc mannequin opened this issue Mar 23, 2003 · 4 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@dutoitc
Copy link
Mannequin

dutoitc mannequin commented Mar 23, 2003

BPO 708320
Nosy @theller

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 = 'https://github.com/theller'
closed_at = <Date 2009-04-17.15:29:42.473>
created_at = <Date 2003-03-23.10:52:46.000>
labels = ['library']
title = 'DistributionMetaData error ?'
updated_at = <Date 2009-04-17.15:29:42.473>
user = 'https://bugs.python.org/dutoitc'

bugs.python.org fields:

activity = <Date 2009-04-17.15:29:42.473>
actor = 'varash'
assignee = 'theller'
closed = True
closed_date = None
closer = None
components = ['Distutils']
creation = <Date 2003-03-23.10:52:46.000>
creator = 'dutoitc'
dependencies = []
files = []
hgrepos = []
issue_num = 708320
keywords = []
message_count = 4.0
messages = ['15237', '15238', '15239', '86076']
nosy_count = 4.0
nosy_names = ['nnorwitz', 'theller', 'dutoitc', 'varash']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue708320'
versions = ['Python 2.2']

@dutoitc
Copy link
Mannequin Author

dutoitc mannequin commented Mar 23, 2003

I'm trying to create an .exe from python files and got the
following errors :

--------------------------------------------------------------------------------

L:\build\gimini\giminiV15-2-exe\src>c:\python22\python 
setup.py py2exe
Traceback (most recent call last):
  File "setup.py", line 8, in ?
    data_files=[   (   "img",
  File "C:\PYTHON22\distutils\core.py", line 101, in setup
    _setup_distribution = dist = klass(attrs)
  File "C:\PYTHON22\distutils\dist.py", line 130, in 
__init__
    setattr(self, method_name, getattr(self.metadata, 
method_name))
AttributeError: DistributionMetadata instance has no 
attribute 'get___doc__'

C.Dutoit

@dutoitc dutoitc mannequin closed this as completed Mar 23, 2003
@dutoitc dutoitc mannequin assigned theller Mar 23, 2003
@dutoitc dutoitc mannequin added the stdlib Python modules in the Lib dir label Mar 23, 2003
@dutoitc dutoitc mannequin closed this as completed Mar 23, 2003
@dutoitc dutoitc mannequin assigned theller Mar 23, 2003
@dutoitc dutoitc mannequin added the stdlib Python modules in the Lib dir label Mar 23, 2003
@nnorwitz
Copy link
Mannequin

nnorwitz mannequin commented Mar 23, 2003

Logged In: YES
user_id=33168

Is this a bug in python or in py2exe?

@dutoitc
Copy link
Mannequin Author

dutoitc mannequin commented Mar 23, 2003

Logged In: YES
user_id=64541

This seems to be a problem of version. I installed the latest
version and it is ok.

@varash
Copy link
Mannequin

varash mannequin commented Apr 17, 2009

I'm running py2exe on python 2.6 and have this error, too. I'm look
through distutils/dist.py and read following:

self.metadata = DistributionMetadata()
method_basenames = dir(self.metadata) + \
                    ['fullname', 'contact', 'contact_email']

for basename in method_basenames:
    method_name = "get_" + basename
    setattr(self, method_name, getattr(self.metadata, method_name))

I'm printing dir(self.metadata) and get this lines:
['__doc__', '__init__', '__module__', 'author', 'author_email',
'description', 'get_author', 'get_author_email', 'get_co
ntact', 'get_contact_email', 'get_description', 'get_fullname',
'get_keywords', 'get_licence', 'get_long_description', '
get_maintainer', 'get_maintainer_email', 'get_name', 'get_platforms',
'get_url', 'get_version', 'keywords', 'licence', '
long_description', 'maintainer', 'maintainer_email', 'name',
'platforms', 'url', 'version', 'write_pkg_info']

code in dist.py trying add all methods from metadata to self, even
'magic' and getters. I think, that's wrong, because no method like
get___doc, get_get_contact and other.
I'm solve this problem by adding regexp for checking is this method
allow for adding to self.

this is my (ugly, i think) code:
for basename in method_basenames:
if re.match(r'(__|get_|write_)\w+', basename) is None: #MY FIXES!
method_name = "get_" + basename
setattr(self, method_name, getattr(self.metadata, method_name))

With this change, all py2exe works work correctly (and i don't try
distutils in other cases).
P.S. i don't know, is this python or py2exe problem: maybe py2exe
replcae nature python distutils module.

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

No branches or pull requests

1 participant