Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 656975

Summary: collisions with builtin functions
Product: Red Hat Enterprise Linux 6 Reporter: Miroslav Suchý <msuchy>
Component: subscription-managerAssignee: Bryan Kearney <bkearney>
Status: CLOSED WONTFIX QA Contact: Bryan Kearney <bkearney>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: bkearney, jmolet, jsefler, shaines
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-28 18:05:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 682238    

Description Miroslav Suchý 2010-11-24 15:52:48 UTC
It is not quite safe to name variable with the same name, which match to python builtin function.

While "Method could be a function" can be ignored, "Redefining built-in" should be fixed.

certificate.py
116:Certificate.valid: Redefining built-in 'range'
196:Certificate.__cmp__: Redefining built-in 'range'
639:ProductCertificate.getProduct: Redefining built-in 'hash'
654:ProductCertificate.getProducts: Redefining built-in 'hash'
846:Product.__init__: Redefining built-in 'hash'
121:Certificate.bogus: Method could be a function
275:DateRange._convert_to_utc: Method could be a function
422:Extensions.__ext: Method could be a function

certlib.py
301:Directory.listAll: Redefining built-in 'all'
318:Directory.listdirs: Redefining built-in 'dir'
404:CertificateDirectory.findAllByProduct: Redefining built-in 'hash'
412:CertificateDirectory.findByProduct: Redefining built-in 'hash'
89:Action.build: Method could be a function
141:UpdateAction.syslogResults: Method could be a function
163:UpdateAction.getExpected: Method could be a function
168:UpdateAction.bashSerials: Method could be a function
180:UpdateAction.delete: Method could be a function
209:UpdateAction.mayLinger: Method could be a function
227:Writer.__ufn: Method could be a function
420:CertificateDirectory.certClass: Method could be a function
573:UpdateReport.write: Method could be a function

connection.py
245:UEPConnection.registerConsumer: Redefining built-in 'type'
132:Restlib.validateResponse: Method could be a function

lock.py
94:Lock.__init__: Redefining built-in 'dir'

managercli.py:
557:ListCommand._format_name: Method could be a function
91:CliCommand.assert_should_be_registered: Method could be a function

managerlib_async.py
7:list_pools: Redefining built-in 'all'

managerlib.py:
371:list_pools: Redefining built-in 'all'
385:getAvailableEntitlements: Redefining built-in 'all'
333:PoolFilter.filter_product_name: Method could be a function
280:PoolFilter.filter_pools_by_products: Method could be a function

productid.py
104:ProductManager.updateInstalled: Redefining built-in 'hash'
117:ProductManager.updateRemoved: Redefining built-in 'hash'

repolib.py:
89:UpdateAction.getContent: Redefining built-in 'id'
127:Repo.__init__: Redefining built-in 'id'
132:Repo._clean_id: Redefining built-in 'id'
101:UpdateAction.join: Method could be a function

hwprobe.py:
114:Hardware._get_dmi_data: Method could be a function

facts.py:
32:Facts.read: Method could be a function

factlib.py:
65:UpdateAction.updateFacts: Method could be a function

Comment 5 Bryan Kearney 2011-06-23 20:46:42 UTC
Fixed in 3f54299dee5ebb882ac340de00dd2102adb75c68. Checked into master.

Comment 8 Miroslav Suchý 2011-06-29 09:39:31 UTC
in subscription-manager git:

[msuchy@dri/~/rhn/subscription-manager{master}]$ find src -name '*.py'|xargs pylint |grep built-in
No config file found, using default configuration
W:131:UpdateAction.get_content: Redefining built-in 'id'
W:192:Repo.__init__: Redefining built-in 'id'
W:200:Repo._clean_id: Redefining built-in 'id'
W:327:CellRendererDate.do_set_property: Redefining built-in 'property'
W:122:ProductManager.updateInstalled: Redefining built-in 'hash'
W:154:ProductManager.updateRemoved: Redefining built-in 'hash'
W:278:Directory.listAll: Redefining built-in 'all'
W:295:Directory.listdirs: Redefining built-in 'dir'
W:381:CertificateDirectory.findAllByProduct: Redefining built-in 'hash'
W:389:CertificateDirectory.findByProduct: Redefining built-in 'hash'
W:140:Hardware.getDistribution: Redefining built-in 'id'
W: 95:Lock.__init__: Redefining built-in 'dir'
W:343:list_pools: Redefining built-in 'all'
W:360:getAvailableEntitlements: Redefining built-in 'all'

Comment 9 Bryan Kearney 2011-06-29 10:47:57 UTC
please look at http://git.fedorahosted.org/git/?p=subscription-manager.git

Comment 11 RHEL Program Management 2011-07-28 18:05:32 UTC
Quality Engineering Management has reviewed and declined this request.  You may
appeal this decision by reopening this request.