[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

The main bugs have been fixed in Python 3.6 and 3.7 (master).

Python 2.7 only has the bug in Tools/scripts/treesync.py, but I don't think 
that it's worth it to fix this old script in the stable 2.7 branch. I just 
removed this script from the master branch (bpo-32159).

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 71bd588646b282c9eebc390b31184a5bdb54e712 by Victor Stinner in 
branch 'master':
bpo-32155: Revert distutils.config change (#4618)
https://github.com/python/cpython/commit/71bd588646b282c9eebc390b31184a5bdb54e712


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 6979fcdc91114b1ccb16345e26734d6df4cccbc3 by Victor Stinner in 
branch '3.6':
bpo-32155: Bugfixes found by flake8 F841 warnings (#4619)
https://github.com/python/cpython/commit/6979fcdc91114b1ccb16345e26734d6df4cccbc3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4533

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

I proposed PR 4618 to revert the distutils.config changes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4532

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread Éric Araujo

Éric Araujo  added the comment:

The best course of action would be to revert the distutils changes.

There are a handful of tickets related to register/upload commands, which are 
funky commands with their own config file not 100% in line with other distutils 
commands.  Changes in that code need tests.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread Berker Peksag

Berker Peksag  added the comment:

I don't think distutils changes are correct.

('realm', self.DEFAULT_REALM)

'realm' is the config name and 'self.DEFAULT_REALM' is its default value. In 
the 'for key, default in ...:' loop,

1. It checks if it's already set in the config file
2. Sets its value to 'current' if it does
3. If it doesn't, uses self.DEFAULT_REALM

distutils sets default values for undefined options via 'finalize_options' 
methods and there is the following command in 
'PyPIRCCommand.finalize_options()' method:

if self.realm is None:
self.realm = self.DEFAULT_REALM

So unless there is a user set value for the 'realm' option (see the 'upload' 
and 'register' commands), 'self.realm' equals to 'self.DEFAULT_REALM'.

I'd remove the following code instead:

realm = self.realm or self.DEFAULT_REALM

--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

> If you have replaced self.DEFAULT_REALM with realm why not replace 
> self.DEFAULT_REPOSITORY with repository?

Oh, I didn't notice that there is also a repository variable which is not used 
in all code paths.

> I don't know what is correct. Added distutils experts for review.

Now I'm not sure that my realm change is correct.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

If you have replaced self.DEFAULT_REALM with realm why not replace 
self.DEFAULT_REPOSITORY with repository?

I don't know what is correct. Added distutils experts for review.

--
nosy: +dstufft, eric.araujo, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4526

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 696b501cd11dc429a0f661adeb598bfaf89e4112 by Victor Stinner in 
branch 'master':
bpo-32155: Bugfixes found by flake8 F841 warnings (#4608)
https://github.com/python/cpython/commit/696b501cd11dc429a0f661adeb598bfaf89e4112


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread STINNER Victor

Change by STINNER Victor :


--
keywords: +patch
pull_requests: +4524
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32155] Fix flake8 warning F841: local variable ... is assigned to but never used

2017-11-28 Thread STINNER Victor

New submission from STINNER Victor :

Using flake8, I found some bugs in the standard libraries and tools.

I already fixed another flake8 error:
---
commit 28e61650b23119b68cd7943ccc01b8b9af1b4103
Author: Victor Stinner 
Date:   Tue Nov 28 00:34:08 2017 +0100

bpo-31245: asyncio: Fix typo, isistance => isinstance (#4594)
---

Attached patch fix 3 bugs found by the flake8 F841 warning.

Note: Python 2.7 is not impacted by the turtledemo bug, but it's impacted by 
the two other bugs.

--
components: Library (Lib)
messages: 307120
nosy: vstinner
priority: normal
severity: normal
status: open
title: Fix flake8 warning F841: local variable ... is assigned to but never used
versions: Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com