[issue31817] Compilation Error with Python 3.6.1/3.6.3 with Tkinter

2017-11-28 Thread Josh Cullum

Josh Cullum  added the comment:

Hi Ned,

I've built a new machine, tried the build again using Tk and Tcl shared 
libraries, built Python-3.6.3 and it's still not worked.

The Python/3.6.3-foss-2017b/lib/python3.6/tkinter folder gets created and 
populated with several files, but when you try and import tkinter in python, it 
fails to import with:

>>> import tkinter
Traceback (most recent call last):
  File "", line 1, in 
  File "/tools/apps/Python/3.6.3-foss-2017b/lib/python3.6/tkinter/__init__.py", 
line 36, in 
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

Running __init__.py from the tkinter folder produces this output:

Traceback (most recent call last):
  File "__init__.py", line 36, in 
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

I'm guessing something is failing to build correctly but it's not being logged.

Both Tk and Tcl versions 8.6.6 and 8.6.7 are available and working on the 
system.

--

___
Python tracker 

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



Re: nospam ** infinity?

2017-11-28 Thread Peter Otten
Skip Montanaro wrote:

>> I'm 99.5% certain it's not gate_news.
> 
> A funny thing. All messages I have looked at so far with the "nospam"
> thing have a Message-ID from binkp.net. (They are also all Usenet
> posts.) For example:
> 
> Newsgroups: comp.lang.python
> Subject: Re: I have anaconda, but Pycharm can't find it
> Date: Sun, 26 Nov 2017 22:40:00 +1200
> Organization: Agency BBS, Dunedin - New Zealand | bbs.geek.nz
> Message-ID: <1783215...@f38.n261.z1.binkp.net>
> Mime-Version: 1.0
> 
> Any ideas how to investigate further?

Try to contact them, or, more likely him.
They seem to be into retro-computing, and there is a line


X-MailConverter: SoupGate-Win32 v1.05

According to

http://software.tomsweb.net/soupgate.html

development of that software ended around 2000. There is a bugfix

"""
* Fixed bug in SoupGate that would cause hosted mailing
  list messages and commands to be processed normally
  even if they were detected as being junk mail; this
  could cause quite an interesting game of virtual tennis
  between SoupGate and "Mail Delivery Subsystem"...
"""

While not exactly the same, "virtual tennis" seems to be a good description 
of what we see now, only 17 years later...

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31380] test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

> @vstinner, as the expert in this area, what do you suggest as the best way to 
> deal with this?  In support.__init__.py?  Or test_httpservers itself?

It's tricky when a filename is valid or not depending on the path, depending on 
the filesystem. The tempfile module checks if O_TMPFILE is supported: same 
issue, it depends on the path, and the user can configure the path. So we check 
each time if O_TMPFILE works or not.

--

___
Python tracker 

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



[issue32138] android: test_faulthandler fails also on API 24

2017-11-28 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
keywords: +patch
pull_requests: +4521
stage: needs patch -> patch review

___
Python tracker 

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



Re: nospam ** infinity?

2017-11-28 Thread Thomas Jollans
On 2017-11-28 02:14, Skip Montanaro wrote:
>> I'm 99.5% certain it's not gate_news.
> 
> A funny thing. All messages I have looked at so far with the "nospam"
> thing have a Message-ID from binkp.net. (They are also all Usenet
> posts.) For example:
> 
> Newsgroups: comp.lang.python
> Subject: Re: I have anaconda, but Pycharm can't find it
> Date: Sun, 26 Nov 2017 22:40:00 +1200
> Organization: Agency BBS, Dunedin - New Zealand | bbs.geek.nz
> Message-ID: <1783215...@f38.n261.z1.binkp.net>
> Mime-Version: 1.0
> 
> Any ideas how to investigate further?

No, but with this information they should be relatively easy to filter
out at the mail/news boundary, right? (It's not ideal, I know)


-- 
Thomas Jollans
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to shut down a TCPServer serve_forever() loop?

2017-11-28 Thread Chris Angelico
On Tue, Nov 28, 2017 at 11:52 PM, Marko Rauhamaa  wrote:
> Chris Angelico :
>
>> On Tue, Nov 28, 2017 at 5:04 PM, Marko Rauhamaa  wrote:
>>> Seems to be one of the fundamental multithreading issues: each thread
>>> is blocked on precisely one event. Asyncio is more flexible: you can
>>> multiplex on a number of events.
>>
>> Not really, no. Unless select() counts as "precisely one event", of
>> course.
>
> Select() counts as asyncio.

Hmm. So what DOESN'T count as asyncio? Because I can use
multithreading with select, and in fact have done so on many
occasions. It's a perfectly normal Unix kernel function.

>> That's the normal way for a thread to block on multiple events on a
>> Unix system. Windows has its own approximate equivalent.
>>
>> Surprise, surprise, that's also how event loops often implemented.
>> Including ones used in packages like asyncio.
>
> The original poster's problem seems to be caused by blocking APIs that
> cannot be multiplexed using select(). A good many Python facilities are
> the same way.
>
> Such blocknoxious APIs are at the core of the multithreading programming
> paradigm.

Some things are fundamentally not multiplexable, at the lower levels.
(On Linux, and I believe most other Unix-like operating systems,
there's no non-blocking way to open a file, nor to gethostbyname.) How
do you propose to solve those in Python? Do you have one thread that
uses select() and another that does a blocking call? Do you spin off a
thread to do the blocking call and then have that thread notify your
main thread via a file descriptor?

I don't understand why you keep insisting that asyncio and threads are
somehow incompatible, or that they're a dichotomy. They're not. They
work together very nicely.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: While, If, Count Statements

2017-11-28 Thread Cai Gengyang
On Tuesday, November 28, 2017 at 4:18:04 PM UTC+8, Frank Millman wrote:
> "Cai Gengyang"  wrote in message 
> news:c2dfc9c4-3e16-480c-aebf-553081775...@googlegroups.com...
> 
> > Sure, so how would the code look like if I want the "if" statement to be 
> > nested inside the "while" loop
> 
> Have you tried putting the 'if' statement inside the 'while' loop?
> 
> If not, give it a shot and see what happens.
> 
> Frank Millman

I tried this :

count = 0

while count < 10:
  if count < 5:
  print "Hello, I am an if statement and count is",   count
  print "Hello, I am a while and count is", count
  count += 1

but it gives an "indentation error: expected an indented block" with an arrow 
pointing at the count after the 3rd statement. Indentation error is supposed to 
be an error about tabs and spaces right ? But I can't find any mistakes with it 
...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to shut down a TCPServer serve_forever() loop?

2017-11-28 Thread Chris Angelico
On Tue, Nov 28, 2017 at 5:04 PM, Marko Rauhamaa  wrote:
> Ian Kelly :
>
>> On Sat, Nov 25, 2017 at 7:10 AM, John Pote  
>> wrote:
>>> The issue is that if I press a key on the keyboard the key is
>>> immediately shown on the screen but then the shutdown() call blocks
>>> until another TCP connection is made, text is echoed back and only
>>> then does serve_forever()return followed by shutdown()returning as
>>> can be seen from the console session,
>> [...]
>> Make a connection to the server after calling shutdown to wake up the
>> server's event loop? I'm guessing it only checks the shutdown flag
>> after responding to an event, so there's probably not much else you
>> could do.
>
> Seems to be one of the fundamental multithreading issues: each thread is
> blocked on precisely one event. Asyncio is more flexible: you can
> multiplex on a number of events.

Not really, no. Unless select() counts as "precisely one event", of course.

http://man7.org/linux/man-pages/man2/select.2.html
https://en.wikipedia.org/wiki/Select_(Unix)

That's the normal way for a thread to block on multiple events on a
Unix system. Windows has its own approximate equivalent.

Surprise, surprise, that's also how event loops often implemented.
Including ones used in packages like asyncio.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32153] mock.create_autospec fails if an attribute is a partial function

2017-11-28 Thread Claudiu Belu

Change by Claudiu Belu :


--
versions:  -Python 3.8

___
Python tracker 

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



[issue32153] mock.create_autospec fails if an attribute is a partial function

2017-11-28 Thread Claudiu Belu

New submission from Claudiu Belu :

If an object's attribute is a partial function, mock.create_autospec will fail 
while trying to copy the partial functions' details to the mocked function, as 
the partial function does not have the __name__ attribute.

Example:

import functools

from unittest import mock


class Proxy(object):
def __init__(self, obj):
self.obj

def __getattr__(self, name):
return functools.partial(self.__run_method, name)

def __run_method(self, name, *args, **kwargs):
return getattr(self.obj, name)(*args, **kwargs)


a = mock.Mock()
proxy = Proxy(a)

mock.create_autospec(proxy)

Output:

Traceback (most recent call last):
  File "py3_mock_functools.py", line 20, in 
mock.create_autospec(proxy)
  File "/usr/lib/python3.5/unittest/mock.py", line 2156, in create_autospec
_check_signature(spec, mock, is_type, instance)
  File "/usr/lib/python3.5/unittest/mock.py", line 112, in _check_signature
_copy_func_details(func, checksig)
  File "/usr/lib/python3.5/unittest/mock.py", line 117, in 
_copy_func_details
funcopy.__name__ = func.__name__
AttributeError: 'functools.partial' object has no attribute '__name__'

--
components: Library (Lib)
messages: 307115
nosy: cbelu
priority: normal
severity: normal
status: open
title: mock.create_autospec fails if an attribute is a partial function
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue31380] test_undecodable_filename() in Lib/test/test_httpservers.py broken on APFS

2017-11-28 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Another option is to skip this test unconditionally on macOS when using APFS, 
the test is already skipped on win32 and tests a generic codepath where only 
testing on Linux should be fine.

BTW. It is fairly easy to detect if a path is on APFS:

```
import subprocess
  
def is_apfs(path):
lines = subprocess.check_output(['df', path]).decode('utf-8').splitlines()
mountpoint = lines[1].split(None, 1)[0]

lines = subprocess.check_output(['mount']).decode('utf-8').splitlines()
for ln in lines:
path = ln.split(None, 1)[0]
if path == mountpoint:
return '(apfs' in ln

return False
```

--

___
Python tracker 

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



Re: nospam ** infinity?

2017-11-28 Thread breamoreboy
On Tuesday, November 28, 2017 at 1:14:51 AM UTC, Skip Montanaro wrote:
> > I'm 99.5% certain it's not gate_news.
> 
> A funny thing. All messages I have looked at so far with the "nospam"
> thing have a Message-ID from binkp.net. (They are also all Usenet
> posts.) For example:
> 
> Newsgroups: comp.lang.python
> Subject: Re: I have anaconda, but Pycharm can't find it
> Date: Sun, 26 Nov 2017 22:40:00 +1200
> Organization: Agency BBS, Dunedin - New Zealand | bbs.geek.nz
> Message-ID: <1783215...@f38.n261.z1.binkp.net>
> Mime-Version: 1.0
> 
> Any ideas how to investigate further?

Sorry, hardly my area of expertise :-(

> 
> Skip

If it's any help there's now a message on the announce list/group subject 
"TatSu v4.2.5. released" with a nospam entry.

--
Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace

2017-11-28 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



Re: nospam ** infinity?

2017-11-28 Thread Tim Golden

On 28/11/2017 10:17, Thomas Jollans wrote:

On 2017-11-28 02:14, Skip Montanaro wrote:

I'm 99.5% certain it's not gate_news.


A funny thing. All messages I have looked at so far with the "nospam"
thing have a Message-ID from binkp.net. (They are also all Usenet
posts.) For example:

Newsgroups: comp.lang.python
Subject: Re: I have anaconda, but Pycharm can't find it
Date: Sun, 26 Nov 2017 22:40:00 +1200
Organization: Agency BBS, Dunedin - New Zealand | bbs.geek.nz
Message-ID: <1783215...@f38.n261.z1.binkp.net>
Mime-Version: 1.0

Any ideas how to investigate further?


No, but with this information they should be relatively easy to filter
out at the mail/news boundary, right? (It's not ideal, I know)


I've just added a block with a regex; they seem to come in batches, so I 
won't know until the next batch arrives whether I've been successful.


TJG
--
https://mail.python.org/mailman/listinfo/python-list


[issue32108] configparser bug: section is emptied if you assign a section to itself

2017-11-28 Thread Dong-hee Na

Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



Re: While, If, Count Statements

2017-11-28 Thread Frank Millman
"Cai Gengyang"  wrote in message 
news:a8335d2c-1fb9-4ba9-b752-418d19e57...@googlegroups.com...


On Tuesday, November 28, 2017 at 4:18:04 PM UTC+8, Frank Millman wrote:
> "Cai Gengyang"  wrote in message
> news:c2dfc9c4-3e16-480c-aebf-553081775...@googlegroups.com...
>
> > Sure, so how would the code look like if I want the "if" statement to 
> > be

> > nested inside the "while" loop
>
> Have you tried putting the 'if' statement inside the 'while' loop?
>
> If not, give it a shot and see what happens.
>
> Frank Millman

I tried this :

count = 0

while count < 10:
  if count < 5:
  print "Hello, I am an if statement and count is",   count
  print "Hello, I am a while and count is", count
  count += 1

but it gives an "indentation error: expected an indented block" with an 
arrow pointing at the count after the 3rd statement. Indentation error is 
supposed to be an error about tabs and spaces right ? But I can't find any 
mistakes with it ...


You are almost there.

An 'if' statement always requires that the following statements are 
indented. This applies even if you are already at one level of indentation.


You could have, for example -

   if a == 'something':
   if b == 'something else':
   if c == 'and another one':
   do_something_if_a_and_b_and_c_are_true()

Or in your case -

   while condition:
   if a == 'something':
   do_something_if_a_is_true()
   continue with while clause

Indentation is fundamental to the way Python works, so if anything above is 
not clear, query it now. It is essential that you have a firm grasp of this.


HTH

Frank


--
https://mail.python.org/mailman/listinfo/python-list


[issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace

2017-11-28 Thread STINNER Victor

New submission from STINNER Victor :

For backward compatibility with Python 3.3, Lib/asyncio/__init__.py exports 
asyncio.selectors and asyncio._overlapped symbols. Python 3.3 reached it's end 
of line last september, it's time to move on:
https://devguide.python.org/#status-of-python-branches

This change is backward incompatible.

Attached PR removes asyncio.selectors and asyncio._overlapped symbols, and use 
directly modules from the standard library. It documents the change in the 
"Porting to Python 3.7" section of the "What's New in Python 3.7" document.

--
components: asyncio
messages: 307117
nosy: vstinner, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: Don't export selectors and _overlapped in asyncio namespace
versions: Python 3.7

___
Python tracker 

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



Re: Increasing the diversity of people who write Python (was: Benefits of unicode identifiers)

2017-11-28 Thread Thomas Jollans
On 2017-11-24 17:41, Skip Montanaro wrote:
> Perhaps for my next computer I should choose a
> non-ASCII keyboard option when configuring it.
> 
> Skip
> 

I'm quite fond of the US international keyboard layout. It lets you type
most Latin-lettered languages with relative ease (including, obviously,
the few accented letters used in English). It's conveniently available
(and almost identical) on all (major) operating systems, but alas
Windows only has a dead-keys variant built in. (But I believe you can
download a no-dead-keys variant somewhere)

It's nice because (with a no-dead-keys version) unless you press AltGr,
everything's the same as with a traditional US keyboard (which is not
entirely suitable for the English language on its own).

On Windows machines I only use occasionally (and may not have admin
rights on) I tend to set up both "US" and "US international" keyboard
layouts and switch between them depending on what I'm typing. It's not
ideal, but it's better than either programming being a pain in the arse
(with all the dead keys) or not being able to type natural-language
words properly.

-- 
Thomas Jollans
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32108] configparser bug: section is emptied if you assign a section to itself

2017-11-28 Thread Dong-hee Na

Change by Dong-hee Na :


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

___
Python tracker 

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



Re: How to shut down a TCPServer serve_forever() loop?

2017-11-28 Thread Marko Rauhamaa
Chris Angelico :

> On Tue, Nov 28, 2017 at 5:04 PM, Marko Rauhamaa  wrote:
>> Seems to be one of the fundamental multithreading issues: each thread
>> is blocked on precisely one event. Asyncio is more flexible: you can
>> multiplex on a number of events.
>
> Not really, no. Unless select() counts as "precisely one event", of
> course.

Select() counts as asyncio.

> That's the normal way for a thread to block on multiple events on a
> Unix system. Windows has its own approximate equivalent.
>
> Surprise, surprise, that's also how event loops often implemented.
> Including ones used in packages like asyncio.

The original poster's problem seems to be caused by blocking APIs that
cannot be multiplexed using select(). A good many Python facilities are
the same way.

Such blocknoxious APIs are at the core of the multithreading programming
paradigm.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32157] Remove explicit quotes around %r and {!r}

2017-11-28 Thread Yury Selivanov

Change by Yury Selivanov :


--
nosy:  -yselivanov

___
Python tracker 

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



[issue32157] Remove explicit quotes around %r and {!r}

2017-11-28 Thread Ethan Furman

Ethan Furman  added the comment:

Yup, I sure did.  :/

Looks like a good change to me.  Are these the only instances of quotes used 
with %r?

--

___
Python tracker 

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



Has anyone worked on docker with windows

2017-11-28 Thread Robert Clove
Hi,

what am i trying to achieve is, container of windows with an application
like slack on it.
Does window container has an UI?

Has anyone worked on it, is it feasible?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31440] wrong default module search path in help message

2017-11-28 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset cb79c2203953bd465f2c53b7a09a51071717575f by Christian Heimes 
(Miss Islington (bot)) in branch '3.6':
bpo-31440: Changed default module search path for windows (#4613)
https://github.com/python/cpython/commit/cb79c2203953bd465f2c53b7a09a51071717575f


--

___
Python tracker 

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



[issue31440] wrong default module search path in help message

2017-11-28 Thread Christian Heimes

Christian Heimes  added the comment:

I'll do a backport tomorrow.

--
assignee:  -> christian.heimes

___
Python tracker 

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



Salabim 2.2.7 released

2017-11-28 Thread Ruud van der Ham
This is to announce salabim version 2.2.7 .

Salabim is a discrete event event simulation (DES) package with a very
powerful animation engine.

With this release, queues and 'states' can be animated with just a couple
of lines of code. See several examples
for a demonstration of these new features,

This release also contains some minor improvements and bug fixes.

Please refer to the changelog at GitHub, accessible via www.salabim.org.

Upgrading to the latest version can be done with *pip install -U salabim* .


Happy simulating!
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue32157] Remove explicit quotes around %r and {!r}

2017-11-28 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4530

___
Python tracker 

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



Re: How to shut down a TCPServer serve_forever() loop?

2017-11-28 Thread Chris Angelico
On Wed, Nov 29, 2017 at 4:22 AM, Marko Rauhamaa  wrote:
> I have solved the gethostbyname() problem by implementing the DNS
> protocol myself (in Python).

Do you respect /etc/nsswitch.conf?

>> I don't understand why you keep insisting that asyncio and threads are
>> somehow incompatible,
>
> Where did I say that?

You talk about them as if they're fundamentally different.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32157] Remove explicit quotes around %r and {!r}

2017-11-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Yes, these are the only instances of quotes used with %r or {!r}.

--

___
Python tracker 

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



[issue32072] Issues with binary plists

2017-11-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Ronald, could you please make a review? I want to merge this before 3.7.0a3.

--

___
Python tracker 

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



[issue32157] Remove explicit quotes around %r and {!r}

2017-11-28 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

It is common to use quotes around %s. If the formatted argument is a string 
this will produce a string in qoutes, that look as a string literal in Python 
and other programming languages or just as a quoted string in English. But if 
quotes surround %r this looks like error. If the argument is a string this will 
lead to doubling qoutes. If its repr is in the form <...>, the angular 
parenthesis serve a role of qoutes, and additional qoutes are not needed.

PR 4582 removes qoutes around %r and {!r} in format strings.

--
components: Library (Lib)
messages: 307146
nosy: barry, davin, pitrou, r.david.murray, serhiy.storchaka, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Remove explicit quotes around %r and {!r}
versions: Python 3.7

___
Python tracker 

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



Re: How to shut down a TCPServer serve_forever() loop?

2017-11-28 Thread Marko Rauhamaa
Chris Angelico :

> On Tue, Nov 28, 2017 at 11:52 PM, Marko Rauhamaa  wrote:
>> The original poster's problem seems to be caused by blocking APIs that
>> cannot be multiplexed using select(). A good many Python facilities are
>> the same way.
>>
>> Such blocknoxious APIs are at the core of the multithreading programming
>> paradigm.
>
> Some things are fundamentally not multiplexable, at the lower levels.

Said function is not. Neither are, say, database methods or web
operations. Yet, they are commonly implemented in a blocking fashion.

> (On Linux, and I believe most other Unix-like operating systems,
> there's no non-blocking way to open a file, nor to gethostbyname.)

The file access problem is a fundamental glitch in Linux, but
gethostbyname() is just a silly POSIX API.

> How do you propose to solve those in Python?

I have solved the gethostbyname() problem by implementing the DNS
protocol myself (in Python).

The file access issue is philosophically somewhat deep; Linux
essentially treats files as memory and vice versa. If it became an
issue, I'd have to launch a file server process.

> I don't understand why you keep insisting that asyncio and threads are
> somehow incompatible,

Where did I say that?


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32157] Remove explicit quotes around %r and {!r}

2017-11-28 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ethan, I think you misunderstood Serhiy's proposal.

--

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2017-11-28 Thread Jan-Philip Gehrcke

Jan-Philip Gehrcke  added the comment:

Hello! I would very much appreciate if we can find a way for us to get another 
review for the last patch.

I did most of the work in August 2016 and got a review from Senthil and 
Christian which I processed. When I got back to the patch for converting it to 
the GitHub workflow about a year later I realized that the details faded from 
my mind. 4 months later, after re-digging into the details, I went into the 
patch again and resolved the merge conflicts that accumulated over time. 
Antoine kindly left another round of comments which I replied to.

Now, 2 months after that last effort I'd like to not forget about the details 
again, but instead be able to respond to review feedback while still being on 
top of the matter. So, any kind and level of feedback would be greatly 
appreciated.

Thank you!

--

___
Python tracker 

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



Re: How to shut down a TCPServer serve_forever() loop?

2017-11-28 Thread Chris Angelico
On Wed, Nov 29, 2017 at 5:03 AM, Marko Rauhamaa  wrote:
> Chris Angelico :
>
>> On Wed, Nov 29, 2017 at 4:22 AM, Marko Rauhamaa  wrote:
>>> I have solved the gethostbyname() problem by implementing the DNS
>>> protocol myself (in Python).
>>
>> Do you respect /etc/nsswitch.conf?
>
> No, but I don't need to.

Ah, right. Until the day you're wrestling with "why doesn't /etc/hosts
apply to this program". Yep, you totally don't need nsswitch.

 I don't understand why you keep insisting that asyncio and threads
 are somehow incompatible,
>>>
>>> Where did I say that?
>>
>> You talk about them as if they're fundamentally different.
>
> In this discussion I was referring to the fact that you can interrupt a
> coroutine while that is generally not possible to do to a blocking
> thread.

I'm not sure what you mean by a "blocking thread". Whether it's a
coroutine or not, you can't interrupt gethostbyname(); and whether
it's a coroutine or not, you CAN interrupt any syscall that responds
to signals (that's the whole point of EINTR).

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32107] Improve MAC address calculation and fix test_uuid.py

2017-11-28 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
title: test_uuid uses the incorrect bitmask -> Improve MAC address calculation 
and fix test_uuid.py

___
Python tracker 

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



[issue32156] Fix flake8 warning F401: ... imported but unused

2017-11-28 Thread STINNER Victor

New submission from STINNER Victor :

Attached PR removes unused imports.

--
components: Library (Lib)
messages: 307126
nosy: vstinner
priority: normal
severity: normal
status: open
title: Fix flake8 warning F401: ... imported but unused
versions: Python 3.7

___
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



[issue32150] Expand tabs to spaces in C files

2017-11-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thanks Guido!

I think now we can revive issue8912.

--
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



[issue32157] Remove explicit quotes around %r and {!r}

2017-11-28 Thread Ethan Furman

Ethan Furman  added the comment:

I make sure to use %r in error-reporting and debugging messages precisely 
because it's output is (usually) valid python.  If I see a 1 without quotes I 
know it's a number, and with quotes I know it's a string.

-1

--
nosy: +ethan.furman

___
Python tracker 

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



Re: How to shut down a TCPServer serve_forever() loop?

2017-11-28 Thread Marko Rauhamaa
Chris Angelico :

> On Wed, Nov 29, 2017 at 5:03 AM, Marko Rauhamaa  wrote:
>> Chris Angelico :
>>> Do you respect /etc/nsswitch.conf?
>>
>> No, but I don't need to.
>
> Ah, right. Until the day you're wrestling with "why doesn't /etc/hosts
> apply to this program". Yep, you totally don't need nsswitch.

Don't you worry about my programs.

>> In this discussion I was referring to the fact that you can interrupt
>> a coroutine while that is generally not possible to do to a blocking
>> thread.
>
> I'm not sure what you mean by a "blocking thread". Whether it's a
> coroutine or not, you can't interrupt gethostbyname(); and whether
> it's a coroutine or not, you CAN interrupt any syscall that responds
> to signals (that's the whole point of EINTR).

Please reread the original poster's question. It was about a blocking
TCP listener call that another thread couldn't interrupt.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32157] Remove explicit quotes around %r and {!r}

2017-11-28 Thread Ethan Furman

Change by Ethan Furman :


--
Removed message: https://bugs.python.org/msg307149

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2017-11-28 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Hello JP, I had been little inactive for a while (>2 years). However, I think, 
I can take now some load in CPython world and I will take this ticket/feature 
forward this Sunday (1-Dec-2017).

If Christian (or currently active committers) don't get to it before, then 
expect from me to move this forward. Thank you.

--

___
Python tracker 

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



Re: How to shut down a TCPServer serve_forever() loop?

2017-11-28 Thread Marko Rauhamaa
Chris Angelico :

> On Wed, Nov 29, 2017 at 4:22 AM, Marko Rauhamaa  wrote:
>> I have solved the gethostbyname() problem by implementing the DNS
>> protocol myself (in Python).
>
> Do you respect /etc/nsswitch.conf?

No, but I don't need to.

>>> I don't understand why you keep insisting that asyncio and threads
>>> are somehow incompatible,
>>
>> Where did I say that?
>
> You talk about them as if they're fundamentally different.

In this discussion I was referring to the fact that you can interrupt a
coroutine while that is generally not possible to do to a blocking
thread.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: While, If, Count Statements

2017-11-28 Thread Cai Gengyang
On Tuesday, November 28, 2017 at 8:12:09 PM UTC+8, Frank Millman wrote:
> "Cai Gengyang"  wrote in message 
> news:a8335d2c-1fb9-4ba9-b752-418d19e57...@googlegroups.com...
> >
> > On Tuesday, November 28, 2017 at 4:18:04 PM UTC+8, Frank Millman wrote:
> > > "Cai Gengyang"  wrote in message
> > > news:c2dfc9c4-3e16-480c-aebf-553081775...@googlegroups.com...
> > >
> > > > Sure, so how would the code look like if I want the "if" statement to 
> > > > be
> > > > nested inside the "while" loop
> > >
> > > Have you tried putting the 'if' statement inside the 'while' loop?
> > >
> > > If not, give it a shot and see what happens.
> > >
> > > Frank Millman
> >
> > I tried this :
> >
> > count = 0
> >
> > while count < 10:
> >   if count < 5:
> >   print "Hello, I am an if statement and count is",   count
> >   print "Hello, I am a while and count is", count
> >   count += 1
> >
> > but it gives an "indentation error: expected an indented block" with an 
> > arrow pointing at the count after the 3rd statement. Indentation error is 
> > supposed to be an error about tabs and spaces right ? But I can't find any 
> > mistakes with it ...
> 
> You are almost there.
> 
> An 'if' statement always requires that the following statements are 
> indented. This applies even if you are already at one level of indentation.
> 
> You could have, for example -
> 
> if a == 'something':
> if b == 'something else':
> if c == 'and another one':
> do_something_if_a_and_b_and_c_are_true()
> 
> Or in your case -
> 
> while condition:
> if a == 'something':
> do_something_if_a_is_true()
> continue with while clause
> 
> Indentation is fundamental to the way Python works, so if anything above is 
> not clear, query it now. It is essential that you have a firm grasp of this.
> 
> HTH
> 
> Frank

It works now ! All I had to shift the 2nd "print" statement up a few spaces and 
it worked --- This is my code:

count = 0

while count < 10:
  if count < 5:
print "Hello, I am an if statement and count is",   count
  print "Hello, I am a while and count is", count
  count += 1

Output :

Hello, I am an if statement and count is 0
Hello, I am a while and count is 0
Hello, I am an if statement and count is 1
Hello, I am a while and count is 1
Hello, I am an if statement and count is 2
Hello, I am a while and count is 2
Hello, I am an if statement and count is 3
Hello, I am a while and count is 3
Hello, I am an if statement and count is 4
Hello, I am a while and count is 4
Hello, I am a while and count is 5
Hello, I am a while and count is 6
Hello, I am a while and count is 7
Hello, I am a while and count is 8
Hello, I am a while and count is 9
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I'm not sure. Ask the RM for 3.6.

As for 2.7, does this problem exist in 2.7?

--

___
Python tracker 

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



[issue32156] Fix flake8 warning F401: ... imported but unused

2017-11-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I suggest to split your patch on several PR for different domains, and let the 
domain experts review changes separately. IDLE changes look mostly harmless to 
me. But changes in distutils should be made with a large care.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32046] 2to3 fix for operator.isCallable()

2017-11-28 Thread Éric Araujo

Éric Araujo  added the comment:

Merged in master, I suppose stable branches should be left alone?

--

___
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



[issue31901] atexit callbacks should be run at subinterpreter shutdown

2017-11-28 Thread Marcel Plch

Change by Marcel Plch :


--
keywords: +patch
pull_requests: +4527
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

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



[issue31440] wrong default module search path in help message

2017-11-28 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4528

___
Python tracker 

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



[issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy Storchaka: "Is this function publicly documented? If this is true, it 
should first be deprecated."

It's not documented, but I found a reference in the documentation:
---
try:
from socket import socketpair
except ImportError:
from asyncio.windows_utils import socketpair
---

This code continues to work on Python 3.5 and newer, the "except" block will 
just never be taken.


> It is left in the __all__ list.

Oops, fixed in my PR.

--

___
Python tracker 

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



[issue32150] Expand tabs to spaces in C files

2017-11-28 Thread Guido van Rossum

Guido van Rossum  added the comment:

OK, so I think you can go ahead with this. I was fine with the state of the 
patch yesterday, so whatever you added today is also fine.

--

___
Python tracker 

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



[issue30657] Unsafe arithmetic in PyString_DecodeEscape

2017-11-28 Thread Leo kirotawa silva

Leo kirotawa silva  added the comment:

I re-did the build here for python3.4 and couldn't reach the same test fail. So 
I'm assuming it was a false alarm. 
Said that, I believe the same patch that applies to py2.7 also applies to 3.4 
and 3.5. I've build them using the patch and did some regression tests and it 
was ok.

--

___
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



[issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace

2017-11-28 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4525

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I meant the original issue. AFAIK ResourceWarningis not raised in 2.7. And 
other warnings less likely have unique messages. Seems the problem is less 
critical in 2.7.

--

___
Python tracker 

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



[issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 4271dfd7815c05fd39b515c240050b3585bdfcd4 by Victor Stinner in 
branch 'master':
bpo-32154: Remove asyncio.selectors (#4605)
https://github.com/python/cpython/commit/4271dfd7815c05fd39b515c240050b3585bdfcd4


--

___
Python tracker 

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



[issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

I also proposed the PR 4609 to remove the old asyncio.windows_utils.socketpair 
alias.

--

___
Python tracker 

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



asyncio loop.call_soon()

2017-11-28 Thread ast

Hello

Python's doc says about loop.call_soon(callback, *arg):

Arrange for a callback to be called as soon as possible. The callback is called 
after call_soon() returns, when control returns to the event loop.


But it doesn't seem to be true; see this program:

import asyncio

async def task_func():
   print("Entering task_func")

def callback():
   print("Entering callback")

async def main():
   print("Entering main")
   task = loop.create_task(task_func())
   loop.call_soon(callback)
   await task

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Execution provides following output:

Entering main
Entering task_func
Entering callback

callback is executed AFTER task_func, I expected it
to be executed BEFORE.

When "main()" coroutine reach line "await task", it let the control 
to the event loop, and it seems that the loop starts to execute 
task instead of callback. Then, when task is over the loop runs 
callback


This is not what the doc says: callback should be called as soon
as possible when the loop has control, with a priority over other
tasks pending in the loop








--
https://mail.python.org/mailman/listinfo/python-list


[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

Victor: "I consider that PR 4489 is a bugfix, so I proposed backports to Python 
2.7 (PR 4588) and 3.6 (PR 4587)."

Serhiy: Are you ok to backport the change to stable branches?

--

___
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



[issue32156] Fix flake8 warning F401: ... imported but unused

2017-11-28 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace

2017-11-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is this function publicly documented? If this is true, it should first be 
deprecated.

It is left in the __all__ list.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32108] configparser bug: section is emptied if you assign a section to itself

2017-11-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 4607 doesn't look a correct solution to me. I don't know a precedence of 
calling deepcopy() for a value in __setitem__(). deepcopy() is too heavy, 
calling it can slow down normal cases. Using deepcopy likely means a bad design.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32046] 2to3 fix for operator.isCallable()

2017-11-28 Thread Éric Araujo

Éric Araujo  added the comment:


New changeset a489599793f9b00ddc2c68e2ce3bce9cbb2c09a2 by Éric Araujo (Dong-hee 
Na) in branch 'master':
bpo-32046: Update 2to3 when converts operator.isCallable(obj). (#4417)
https://github.com/python/cpython/commit/a489599793f9b00ddc2c68e2ce3bce9cbb2c09a2


--

___
Python tracker 

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



[issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value

2017-11-28 Thread R. David Murray

R. David Murray  added the comment:

OK, I should have used the term the docs actually use: "serialization".  
get_content() is, I hope, clearly not serialization, while as_string() is.  
Does that make it make more sense?  Do you see a way to improve the docs in 
this regard?

--

___
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



[issue31440] wrong default module search path in help message

2017-11-28 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset 08d2b86a1058b733bb7f1ae2b55818dd9687d21c by Christian Heimes 
(gauravbackback) in branch 'master':
bpo-31440: Changed default module search path for windows
https://github.com/python/cpython/commit/08d2b86a1058b733bb7f1ae2b55818dd9687d21c


--

___
Python tracker 

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



[issue31440] wrong default module search path in help message

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

I confirm that Python 2.7 is affected and should also be fixed.

--
nosy: +vstinner

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "As for 2.7, does this problem exist in 2.7?"

Yes, see my PR 4588. If you run the test without the fix, the test fails.

--

___
Python tracker 

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



[issue32150] Expand tabs to spaces in C files

2017-11-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 598ceae876ff4a23072e59945597e945583de4ab by Serhiy Storchaka in 
branch 'master':
bpo-32150: Expand tabs to spaces in C files. (#4583)
https://github.com/python/cpython/commit/598ceae876ff4a23072e59945597e945583de4ab


--

___
Python tracker 

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



Re: asyncio loop.call_soon()

2017-11-28 Thread Ian Kelly
On Tue, Nov 28, 2017 at 8:30 AM, ast  wrote:
> Hello
>
> Python's doc says about loop.call_soon(callback, *arg):
>
> Arrange for a callback to be called as soon as possible. The callback is
> called after call_soon() returns, when control returns to the event loop.
>
> But it doesn't seem to be true; see this program:
>
> import asyncio
>
> async def task_func():
>print("Entering task_func")
>
> def callback():
>print("Entering callback")
>
> async def main():
>print("Entering main")
>task = loop.create_task(task_func())
>loop.call_soon(callback)
>await task
>
> loop = asyncio.get_event_loop()
> loop.run_until_complete(main())
>
> Execution provides following output:
>
> Entering main
> Entering task_func
> Entering callback
>
> callback is executed AFTER task_func, I expected it
> to be executed BEFORE.
>
> When "main()" coroutine reach line "await task", it let the control to the
> event loop, and it seems that the loop starts to execute task instead of
> callback. Then, when task is over the loop runs callback
>
> This is not what the doc says: callback should be called as soon
> as possible when the loop has control, with a priority over other
> tasks pending in the loop

You omitted this part of the documentation:

"This operates as a FIFO queue, callbacks are called in the order in
which they are registered. Each callback will be called exactly once."

This documents the ordering of call_soon callbacks. It doesn't say
anything about how the callback will be ordered with respect to tasks
or other events that are also immediately ready to be handled.

Also, if you look at the implementation of create_task, it invokes
call_soon. This is therefore consistent with the doc, as call_soon was
actually called twice: first for task_func(), and then for callback.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to shut down a TCPServer serve_forever() loop?

2017-11-28 Thread Ian Kelly
On Tue, Nov 28, 2017 at 11:54 AM, Marko Rauhamaa  wrote:
> Chris Angelico :
>> Would the OP have been trivially able to send a signal to the
>> process? Yes.
>
>Python signal handlers are always executed in the main Python thread,
>even if the signal was received in another thread. This means that
>signals can’t be used as a means of inter-thread communication.
>
>https://docs.python.org/3/library/signal.html#signals-and-threads>

Being received in the other thread, it would still interrupt the
system call however, wouldn't it? Quoting from the doc:

"However, if the target thread is executing the Python interpreter,
the Python signal handlers will be executed by the main thread.
Therefore, the only point of sending a signal to a particular Python
thread would be to force a running system call to fail with
InterruptedError."
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31732] Add TRACE level to the logging module

2017-11-28 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
Removed message: https://bugs.python.org/msg307162

___
Python tracker 

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



[issue32160] lzma documentation: example to XZ compress file on disk

2017-11-28 Thread Daniel Himmelstein

New submission from Daniel Himmelstein :

The documentation for the lzma module currently contains 6 examples 
(https://docs.python.org/3.6/library/lzma.html#examples). However, it does not 
include an example to XZ compress a file on disk. The functionality I'm 
envisioning would be similar to the command:

```sh
xz --compress --keep path
```

I believe this is possible in python with:

```python
with open(in_path) as in_file, lzma.open(out_path, 'w') as out_file:
shutil.copyfileobj(in_path, out_file)
```

Note gzip has a similar example 
(https://docs.python.org/3.6/library/gzip.html#examples-of-usage).

Compressing an existing file on disk is a use case I commonly encounter. Python 
is ideal for the task because it provides a cross-platform solution that 
doesn't require installing additional command line utilities. Before finding 
shutil.copyfileobj, I assumed memory-efficient on-disk XZ compression was not 
possible in Python, due to its omission from the docs.

I'm happy to propose example code for the documentation.

Alternatively, if this feature is considered useful, we could consider an API 
addition to provide a one-line command for on-disk compressing/decompressing 
files. Since this would be a major addition that should be consistent across 
compression modules, perhaps we should just start with a lzma doc example?

--
components: IO
messages: 307163
nosy: dhimmel
priority: normal
severity: normal
status: open
title: lzma documentation: example to XZ compress file on disk
versions: Python 3.7, Python 3.8

___
Python tracker 

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



Re: How to shut down a TCPServer serve_forever() loop?

2017-11-28 Thread Marko Rauhamaa
Chris Angelico :
> On Wed, Nov 29, 2017 at 5:32 AM, Marko Rauhamaa  wrote:
>> Don't you worry about my programs.
>
> Okay, but you can't claim that problems are solvable if you cheat them.

What I'm saying is that there's no particular reason why glibc couldn't
offer a solution. There *is* getaddrinfo_a(), but that's suboptimal
because it uses signals and (probably) a subsidiary thread. Instead, it
should offer a file descriptor for the application to monitor.

>> Please reread the original poster's question. It was about a blocking
>> TCP listener call that another thread couldn't interrupt.
>
> Yet a SIGINT would successfully interrupt it.

A keyboard interrupt? That your magic bullet? How does that work in
practice?

> Would the OP have been trivially able to send a signal to the
> process? Yes.

   Python signal handlers are always executed in the main Python thread,
   even if the signal was received in another thread. This means that
   signals can’t be used as a means of inter-thread communication.

   https://docs.python.org/3/library/signal.html#signals-and-threads>


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: asyncio loop.call_soon()

2017-11-28 Thread Terry Reedy

On 11/28/2017 11:02 AM, Ian Kelly wrote:

On Tue, Nov 28, 2017 at 8:30 AM, ast  wrote:

Hello

Python's doc says about loop.call_soon(callback, *arg):

Arrange for a callback to be called as soon as possible. The callback is
called after call_soon() returns, when control returns to the event loop.

But it doesn't seem to be true; see this program:

import asyncio

async def task_func():
print("Entering task_func")

def callback():
print("Entering callback")

async def main():
print("Entering main")
task = loop.create_task(task_func())
loop.call_soon(callback)
await task

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Execution provides following output:

Entering main
Entering task_func
Entering callback

callback is executed AFTER task_func, I expected it
to be executed BEFORE.

When "main()" coroutine reach line "await task", it let the control to the
event loop, and it seems that the loop starts to execute task instead of
callback. Then, when task is over the loop runs callback

This is not what the doc says: callback should be called as soon
as possible when the loop has control, with a priority over other
tasks pending in the loop


You omitted this part of the documentation:

"This operates as a FIFO queue, callbacks are called in the order in
which they are registered. Each callback will be called exactly once."

This documents the ordering of call_soon callbacks. It doesn't say
anything about how the callback will be ordered with respect to tasks
or other events that are also immediately ready to be handled.

Also, if you look at the implementation of create_task, it invokes
call_soon. This is therefore consistent with the doc, as call_soon was
actually called twice: first for task_func(), and then for callback.


I believe that this means that any code in the coroutine *before* the 
first await is run immediately.  This is what I experienced in my 
experiments yesterday.



--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


[issue32158] Suppress (and other contextlib context managers) should work as decorators (where appropriate)

2017-11-28 Thread Jason R. Coombs

New submission from Jason R. Coombs :

The contextlib docs explain why a decorator is nice:

> It makes it clear that the cm applies to the whole function, rather than just 
> a piece of it (and saving an indentation level is nice, too).

However, the built-in context managers that could readily supply this interface 
don't derive from DecoratorContext.

In jaraco.context, I [added decorator support by simply deriving from the two 
base 
classes](https://github.com/jaraco/jaraco.context/commit/5aa7b0bb222cff5009a2f0dc3ea49db9e7a6b71a#diff-efbedfbbcb7f61268cfeff04a32fa59d).

But it got me thinking - couldn't suppress (and possibly other) contextlib 
decorators support this usage out of the box?

If there's interest, I'll put together a patch with test.

--
components: Library (Lib)
messages: 307155
nosy: jason.coombs
priority: normal
severity: normal
status: open
title: Suppress (and other contextlib context managers) should work as 
decorators (where appropriate)
versions: Python 3.7

___
Python tracker 

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



[issue32158] Suppress (and other contextlib context managers) should work as decorators (where appropriate)

2017-11-28 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue31732] Add TRACE level to the logging module

2017-11-28 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Perhaps a recipe should be published to explain how to add your own levels?

e.g.:

>>> import logging
>>> logging.NOTE = logging.INFO + 5
>>> logging.addLevelName(logging.INFO + 5, 'NOTE')
>>> class MyLogger(logging.Logger):
...:def note(self, msg, *args, **kwargs):
...:self.log(logging.NOTE, msg, *args, **kwargs)
...:
>>> logging.setLoggerClass(MyLogger)

>>> logging.basicConfig(level=logging.INFO)
>>> logger.note("hello %s", "Guido")
Level 25:foo:hello Guido

--
nosy: +pitrou

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-28 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



ANN: Bokeh 0.12.11 Released

2017-11-28 Thread Bryan Van de ven
On behalf of the Bokeh team, I am pleased to announce the release of version 
0.12.11 of Bokeh!

For more information and details, please see the announcement post at:

https://bokeh.github.io/blog/2017/11/28/release-0-12-11/

If you are using Anaconda/miniconda, you can install it with conda:

conda install -c bokeh bokeh

Alternatively, you can also install it with pip:

pip install bokeh

Full information including details about how to use and obtain BokehJS are at:

https://bokeh.pydata.org/en/0.12.11/docs/installation.html

Issues, enhancement requests, and pull requests can be made on the Bokeh Github 
page: https://github.com/bokeh/bokeh

Documentation is available at: https://bokeh.pydata.org/en/0.12.11

There are over 268 total contributors to Bokeh and their time and effort help 
make Bokeh such an amazing project and community. Thank you again for your 
contributions. 

Finally, for questions or technical assistance we recommend starting with 
detailed posts on Stack Overflow. Or if you are interested in contributing, 
come by the Bokeh dev chat room: https://gitter.im/bokeh/bokeh-dev

Thanks,

Bryan Van de Ven
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue32158] Suppress (and other contextlib context managers) should work as decorators (where appropriate)

2017-11-28 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> But it got me thinking - couldn't suppress (and possibly other)
> contextlib decorators support this usage out of the box?

They possibly could but probably shouldn't.   My experience is that giving them 
a dual role makes them more complicated and harder to understand.

For suppress() in particular, wrapping a whole function is likely an 
anti-pattern.  Usually we advise people to put as little as possible in the 
try-block to avoid catching unexpected exceptions.

Also, I think it would be inevitable that people would try to apply these to 
generators or awaitables and find that they don't mix well.

--
nosy: +rhettinger

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-28 Thread STINNER Victor

New submission from STINNER Victor :

CPython migrated from CVS to Subversion, to Mercurial, and then to Git. CVS and 
Subversion are no more used to develop CPython.

Changes of attached PR:

* platform module: drop support for sys.subversion. The
  sys.subversion attribute has been removed in Python 3.3.
* Remove Misc/svnmap.txt
* Remove Tools/scripts/svneol.py
* Remove Tools/scripts/treesync.py

--
components: Build
messages: 307159
nosy: vstinner
priority: normal
severity: normal
status: open
title: Remove tools for CVS and Subversion
versions: Python 3.7

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "I meant the original issue. AFAIK ResourceWarningis not raised in 2.7. 
And other warnings less likely have unique messages. Seems the problem is less 
critical in 2.7."

Oh yes, sorry, I forgot your comment and I forgot that Python 2.7 doesn't have 
ResourceWarning. I closed my PR for Python 2.7: 
https://github.com/python/cpython/pull/4588

--

___
Python tracker 

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



[issue31732] Add TRACE level to the logging module

2017-11-28 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Perhaps a recipe should be published to explain how to add your own levels?

>>> import logging
>>> logging.NOTE = logging.INFO + 5
>>> logging.addLevelName(logging.INFO + 5, 'NOTE')
>>> class MyLogger(logging.getLoggerClass()):
...:def note(self, msg, *args, **kwargs):
...:self.log(logging.NOTE, msg, *args, **kwargs)
...:
>>> logging.setLoggerClass(MyLogger)

>>> logging.basicConfig(level=logging.INFO)
>>> logger.note("hello %s", "Guido")
NOTE:foo:hello Guido

--

___
Python tracker 

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



Re: How to shut down a TCPServer serve_forever() loop?

2017-11-28 Thread Chris Angelico
On Wed, Nov 29, 2017 at 5:32 AM, Marko Rauhamaa  wrote:
> Chris Angelico :
>
>> On Wed, Nov 29, 2017 at 5:03 AM, Marko Rauhamaa  wrote:
>>> Chris Angelico :
 Do you respect /etc/nsswitch.conf?
>>>
>>> No, but I don't need to.
>>
>> Ah, right. Until the day you're wrestling with "why doesn't /etc/hosts
>> apply to this program". Yep, you totally don't need nsswitch.
>
> Don't you worry about my programs.

Okay, but you can't claim that problems are solvable if you cheat them.

>>> In this discussion I was referring to the fact that you can interrupt
>>> a coroutine while that is generally not possible to do to a blocking
>>> thread.
>>
>> I'm not sure what you mean by a "blocking thread". Whether it's a
>> coroutine or not, you can't interrupt gethostbyname(); and whether
>> it's a coroutine or not, you CAN interrupt any syscall that responds
>> to signals (that's the whole point of EINTR).
>
> Please reread the original poster's question. It was about a blocking
> TCP listener call that another thread couldn't interrupt.

Yet a SIGINT would successfully interrupt it. I'm not sure what your
point is. Would the OP have been trivially able to switch to asyncio?
Maybe. Would the OP have been trivially able to send a signal to the
process? Yes.

I'm done arguing. You're clearly not listening.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32071] Add py.test-like "-k" test selection to unittest

2017-11-28 Thread Antoine Pitrou

Antoine Pitrou  added the comment:


New changeset 4d193bcc2560b824389e4d98d9d8b9b34e33dbaf by Antoine Pitrou (Jonas 
Haag) in branch 'master':
bpo-32071: Fix regression and add What's New entry (#4589)
https://github.com/python/cpython/commit/4d193bcc2560b824389e4d98d9d8b9b34e33dbaf


--

___
Python tracker 

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



[issue32158] Suppress (and other contextlib context managers) should work as decorators (where appropriate)

2017-11-28 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

Fair enough.

For an example, here's the case where I wanted to use the decorator to avoid 
excess indentation and keep the most meaningful part of the function at the 
base of the body:

@suppress(KeyError)
def v12_to_13(manager, case):
case['sample_id'] = case.pop('caseid')


In my opinion, it's nominally nicer and clearer than:

def v12_to_13(manager, case):
with suppress(KeyError):
case['sample_id'] = case.pop('caseid')


But I see your points about encouraging overly-broad catching of exceptions... 
so it's better to have the indentation as something of a wart to dissuade 
excess wrapping.

--
resolution:  -> rejected
stage:  -> 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



[issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset ac577d7d0bd27a69921ced14c09172235ceebab5 by Victor Stinner in 
branch 'master':
bpo-32154: Remove asyncio.windows_utils.socketpair (#4609)
https://github.com/python/cpython/commit/ac577d7d0bd27a69921ced14c09172235ceebab5


--

___
Python tracker 

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



[issue32154] asyncio: Don't export selectors and _overlapped in asyncio namespace

2017-11-28 Thread STINNER Victor

Change by STINNER Victor :


--
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



[issue32157] Remove explicit quotes around %r and {!r}

2017-11-28 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
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



[issue32159] Remove tools for CVS and Subversion

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "Is svnmap.txt used for mapping Subversion references to Mercurial 
references on the tracker? r88752"

Brett, David, Ezio: any idea for Serhiy's question?

--
nosy: +brett.cannon, ezio.melotti, r.david.murray

___
Python tracker 

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



[issue32160] lzma documentation: example to XZ compress file on disk

2017-11-28 Thread Daniel Himmelstein

Change by Daniel Himmelstein :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
type:  -> enhancement

___
Python tracker 

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



[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

I ran a quick benchmark on Python 3.6: current code (3.6 branch, ref) => PR 
4587 (patch):

vstinner@apu$ python3 -m perf compare_to ref.json patch.json 
Mean +- std dev: [ref] 597 ns +- 10 ns -> [patch] 830 ns +- 15 ns: 1.39x slower 
(+39%)

I don't want to backport an optimization to a stable branch, so I prefer to not 
backport the warnings change on the ignore action to Python 3.6. I rejected my 
PR 4587.

The bug was fixed in master. I don't want to backport the change to 2.7 nor 
3.6, so I close the issue.

--
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



[issue32157] Remove explicit quotes around %r and {!r}

2017-11-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset a4a3020abc065d40f57069d6c69d0ddc85d6 by Serhiy Storchaka in 
branch 'master':
bpo-32157: Removed explicit quotes around %r and {!r}. (#4582)
https://github.com/python/cpython/commit/a4a3020abc065d40f57069d6c69d0ddc85d6


--

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset fe2d5babba5d26de2093b6518316b268488187be by Victor Stinner in 
branch 'master':
bpo-32159: Remove tools for CVS and Subversion (#4615)
https://github.com/python/cpython/commit/fe2d5babba5d26de2093b6518316b268488187be


--

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-28 Thread STINNER Victor

STINNER Victor  added the comment:

> Are you sure that these scripts are not used outside of CPython?

How would someone use it? There are only part of the code base, they are not 
installed on the system (by "make install").

If someone uses these scripts on another project which is not CPython, well, 
they can copy an old version from Python 3.6 and maintain their fork, no?

Why would Python still maintain a tool if we don't use it or test it ourself?


> The support of the svn:eol property is a thing I really lacked in Mercurial.

We are using .gitattributes to specify the end of lines of some files. A few 
examples:
---
*.gif binary
*.bat text eol=crlf
PC/readme.txt text eol=crlf
---

I understand that Git does handle end of line, and it's configurable by 
.gitattributes. Sorry, I don't know much more about that, and I'm not sure that 
this issue is the right place to ask questions about Git ;-) Maybe ask on 
python-dev if you are aware of an issue with Git?


> They were here when CPython used Subversion, they were here when CPython used 
> Mercurial, what is wrong with Git?

The scripts are very specific to CVS and Subversion. They are useful with 
Mercurial or Git.

I wrote that we already changed the SCM twice since Subversion, to justify that 
I don't think that anyone still works on a CVS or Subversion fork of CPython.

Well, if someone really does that, I don't expect that they work on the master 
branch, and so likely have a copy of these scripts :-)


> Oh, you are VERY fast in committing Victor.

The PR was approved by Brett Cannon and Ned Deily.

--

___
Python tracker 

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



  1   2   >