[issue25988] collections.abc.Indexable

2018-01-28 Thread Raymond Hettinger

Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue32705] Current Android does not have posix_spawn

2018-01-28 Thread Chih-Hsuan Yen

Change by Chih-Hsuan Yen :


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

___
Python tracker 

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



[issue32705] Current Android does not have posix_spawn

2018-01-28 Thread Chih-Hsuan Yen

New submission from Chih-Hsuan Yen :

Currently Android does not have posix_spawn, thus posixmodule.c does not build. 
Build log attached. I'll create a patch for this.

Testing environment: my building scripts [1] + Android NDK r16b
Building target: ARM64, android-21

/cc Primary reviewer of issue 20104 and Android enthusiasts in CPython

PS. Looks like posix_spawn will be available in Android P (API 28) [2]. For now 
I propose to disable it in CPython.

[1] https://github.com/yan12125/python3-android/
[2] https://android-review.googlesource.com/c/platform/bionic/+/504842

--
components: Cross-Build
files: build.log
messages: 311078
nosy: Alex.Willmer, gregory.p.smith, vstinner, yan12125
priority: normal
severity: normal
status: open
title: Current Android does not have posix_spawn
type: compile error
versions: Python 3.7
Added file: https://bugs.python.org/file47416/build.log

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-28 Thread Nathaniel Smith

Nathaniel Smith  added the comment:


New changeset 95e214713a7da4e5cbfb73f35b2119f76074fc3f by Nathaniel J. Smith in 
branch 'master':
bpo-32591: silence deprecation warnings in test_coroutine (GH-5412)
https://github.com/python/cpython/commit/95e214713a7da4e5cbfb73f35b2119f76074fc3f


--

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2018-01-28 Thread Nick Coghlan

Nick Coghlan  added the comment:

I've also added Matthias and Barry to the cc list, in case this does turn out 
to be a Debian or Ubuntu specific quirk.

Restating the problem, the issue is that test_locale_flag in test_re may fail 
for at least the en_IN locale, and we're not sure yet whether that's a test 
bug, a locale module bug, or a distro bug:

LANG=en_IN ./python -m test -v test_re

We've only confirmed it on Ubuntu so far though - I haven't been able to 
reproduce it on Fedora, and Jaysinh hasn't been able to reproduce it since 
switching to Gentoo.

--
nosy: +barry, doko

___
Python tracker 

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



[issue32550] STORE_ANNOTATION bytecode is unnecessary and can be removed.

2018-01-28 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

There are a couple of merge conflicts in the patch.  Once deconflicted, I think 
this PR is ready to apply.

--
assignee:  -> Mark.Shannon

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2018-01-28 Thread Jaysinh shukla

Jaysinh shukla  added the comment:

Hello Nick,

At the devsprints of Pycon India 2017, a few participants were facing this 
bug. They all were from the Ubuntu land. I have switched to Gentoo distro. I am 
not facing this bug, but let me confirm from any Ubuntu user. Thanks

--

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-28 Thread Nathaniel Smith

Change by Nathaniel Smith :


--
pull_requests: +5246
stage: resolved -> patch review

___
Python tracker 

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



[issue32650] Debug support for native coroutines is broken

2018-01-28 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 3cfb84c65790f5f9377574f9be0799bdd9d0132c by Andrew Svetlov in 
branch '3.6':
[3.6] bpo-32650 Add support for async generators and more test for coroutines 
in pdb  (GH-5403). (#5411)
https://github.com/python/cpython/commit/3cfb84c65790f5f9377574f9be0799bdd9d0132c


--

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:

I knew about that "if", but it never fully registered to me why it's there and 
what it is protecting us from ;) So I had to debug half of ceval loop before I 
stumbled upon it again ;)

--

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Nick Coghlan

Nick Coghlan  added the comment:

Ah, and in my REPL example, the NameError was pending when the internal result 
storage was getting set back to None.

I'm not sure I even knew the "Don't complain when an exception is pending" 
check existed, so it would have taken me a long time to find that.

--

___
Python tracker 

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



Re: IoT automation

2018-01-28 Thread Dale Marvin via Python-list

On 1/28/18 7:39 AM, Prahallad Achar wrote:

Hello team,
Could you please help me out in automation of IoT product end to end

Regards
Prahallad



 ?

--Dale

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


[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-28 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Ah, gotcha. I'll take a look. (For posterity: the RuntimeWarnings Yury 
mentioned are also real, but they're from the branch Yury is testing for 
bpo-32605 / bpo-32703, nothing to do with this issue.)

--

___
Python tracker 

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



[issue27968] test_coroutines generates some warnings

2018-01-28 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +5245

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:

Specifically "DeprecationWarning: get_coroutine_wrapper is deprecated" needs to 
be silenced as part of this issue.

--

___
Python tracker 

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



[issue32605] Should we really hide unawaited coroutine warnings when an exception is pending?

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:

So in issue 32703 we consider removing the check.  I'll try to figure out what 
to do with "coroutine ... was never awaited" warnings in test_coroutines -- 
probably just silence them.

--

___
Python tracker 

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



[issue32591] Deprecate sys.set_coroutine_wrapper and replace it with more focused API(s)

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:

Nathaniel,

test_coroutines raises a bunch of Runtime and Deprecation warnings after this 
PR.  Could you please make a PR to silence them?


/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:1032: RuntimeWarning: 
coroutine 'CoroutineTest.test_await_12..coro' was never awaited
  return await Awaitable()
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:37: RuntimeWarning: 
coroutine 'CoroutineTest.test_await_9..bar' was never awaited
  buffer.append(coro.send(None))
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:681: RuntimeWarning: 
coroutine 'CoroutineTest.test_func_13..g' was never awaited
  g().send('spam')
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:534: RuntimeWarning: 
coroutine 'CoroutineTest.test_func_4..foo' was never awaited
  list(foo())
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:537: RuntimeWarning: 
coroutine 'CoroutineTest.test_func_4..foo' was never awaited
  tuple(foo())
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:540: RuntimeWarning: 
coroutine 'CoroutineTest.test_func_4..foo' was never awaited
  sum(foo())
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:543: RuntimeWarning: 
coroutine 'CoroutineTest.test_func_4..foo' was never awaited
  iter(foo())
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:564: RuntimeWarning: 
coroutine 'CoroutineTest.test_func_5..foo' was never awaited
  for el in foo(): pass
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:1984: 
DeprecationWarning: get_coroutine_wrapper is deprecated
  self.assertIs(sys.get_coroutine_wrapper(), wrap)
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:1991: 
DeprecationWarning: set_coroutine_wrapper is deprecated
  sys.set_coroutine_wrapper(None)
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:1993: 
DeprecationWarning: get_coroutine_wrapper is deprecated
  self.assertIsNone(sys.get_coroutine_wrapper())
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:2001: 
DeprecationWarning: get_coroutine_wrapper is deprecated
  self.assertIsNone(sys.get_coroutine_wrapper())
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:2003: 
DeprecationWarning: set_coroutine_wrapper is deprecated
  sys.set_coroutine_wrapper(1)
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:2004: 
DeprecationWarning: get_coroutine_wrapper is deprecated
  self.assertIsNone(sys.get_coroutine_wrapper())
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:2015: 
DeprecationWarning: set_coroutine_wrapper is deprecated
  sys.set_coroutine_wrapper(wrapper)
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:2024: 
DeprecationWarning: set_coroutine_wrapper is deprecated
  sys.set_coroutine_wrapper(None)
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:2037: 
DeprecationWarning: set_coroutine_wrapper is deprecated
  sys.set_coroutine_wrapper(wrap)
/Users/yury/dev/pydev/cpython/Lib/test/test_coroutines.py:2045: 
DeprecationWarning: set_coroutine_wrapper is deprecated
  sys.set_coroutine_wrapper(None)

--
status: closed -> open

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Well, I feel silly then: bpo-32605

--

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:

So the problem was that _PyGen_Finalize wasn't issuing any warnings if there's 
any error set in the current tstate.  And in Nathaniel's case, the current 
error was an AttributeError('__aexit__').

This check is weird, because right before raising the warning, we call 
PyErr_Fetch to temporarily reset the current exception if any, specifically to 
raise the warning :)

The PR just removes the check.  Unless I'm missing something this should fix 
the issue.

--

___
Python tracker 

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



[issue32650] Debug support for native coroutines is broken

2018-01-28 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
pull_requests: +5244

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Yury Selivanov

Change by Yury Selivanov :


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

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:

Ah, we should never really get to WITH_CLEANUP_START; the exception should be 
raised in BEFORE_ASYNC_WITH

--

___
Python tracker 

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




[issue32650] Debug support for native coroutines is broken

2018-01-28 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 543ec005a4c83fcc0d14ac1e4c0f1a36bf84640b by Andrew Svetlov (Miss 
Islington (bot)) in branch '3.6':
bpo-32650: Add native coroutine support to bdb when stepping over line 
(GH-5400) (#5402)
https://github.com/python/cpython/commit/543ec005a4c83fcc0d14ac1e4c0f1a36bf84640b


--

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:

So refactoring it into "c = open_file(); async with c" just prolongs the life 
of the coroutine so that it's GCed outside of 
WITH_CLEANUP_START/WITH_CLEANUP_FINISH block.  Something weird is going on in 
that block.

--

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:

The difference between these two functions is two extra opcodes: 
STORE_FAST/LOAD_FAST before BEFORE_ASYNC_WITH.  With them we have a warning.

--

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:

Changing

  async def main():
async with open_file():
  pass

to

  async def main():
c = open_file()
async with c:
  pass

also makes it print the warning :)

Also I've made a test out of this snippet and running tests in refleak mode 
shows that there's indeed no refleak here.

--

___
Python tracker 

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



[issue32704] Tracking

2018-01-28 Thread Allen

New submission from Allen :

Could someone help me use python to track the tArget phones location and i
would like to intercepts all text and emaIl.

..

--
messages: 311059
nosy: BIGAL
priority: normal
severity: normal
status: open
title: Tracking

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Nick Coghlan

Nick Coghlan  added the comment:

Looking at the ceval code, I think Yury's theory is plausible, and we may also 
be leaving the interpreter's internal stack in a dubious state. Things then get 
cleaned up if you wrap the async with in a try/except or try/finally:

==
>>> async def try_main():
... try:
... async with open_file():
... pass
... finally:
... pass
... 
>>> try_main().send(None)
sys:1: RuntimeWarning: coroutine 'open_file' was never awaited
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in try_main
AttributeError: __aexit__
==

Unfortunately for that theory, adding braces and "Py_DECREF(POP());" to the 
relevant error handling branch *doesn't* fix the problem.

I also found another way to provoke similar misbehaviour without async with:

==
>>> async def open_file():
... pass
... 
>>> open_file()

>>> _

>>> 1
__main__:1: RuntimeWarning: coroutine 'open_file' was never awaited
1
>>> open_file()

>>> del _
Traceback (most recent call last):
  File "", line 1, in 
NameError: name '_' is not defined
>>> _

>>> 1
1
>>> _
1
>>> 
==

--

___
Python tracker 

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



[issue23749] asyncio missing wrap_socket (starttls)

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 1e5b25b8c0c45ccfd58da2cb82fdf231c6823fef by Yury Selivanov in 
branch 'master':
bpo-23749: Make start-tls tests more stable on win7 buildbot (GH-5409)
https://github.com/python/cpython/commit/1e5b25b8c0c45ccfd58da2cb82fdf231c6823fef


--

___
Python tracker 

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



Re: Welcome to the "Python-list" mailing list (Digest mode)

2018-01-28 Thread nelson jon kane
When I enter the word python in the search box on my Chrome Windows 10, this is 
what comes up. Can you tell me what each of these "types" of Python mean? Thank 
you.

[cid:aa3fd74d-d71d-42c0-b063-4f20c463987b]


From: Python-list  on 
behalf of python-list-requ...@python.org 
Sent: Sunday, January 28, 2018 1:28:19 PM
To: nelsonjonka...@live.com
Subject: Welcome to the "Python-list" mailing list (Digest mode)

Welcome to the Python-list@python.org mailing list! The purpose of
this mailing list is to support general discussions about the Python
programming language.  Please remember that this list is mirrored to
the Usenet newsgroup comp.lang.python.

For more information on the Python programming language see


To post to this list, send your message to:

  python-list@python.org

General information about the mailing list is at:

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

If you ever want to unsubscribe or change your options (eg, switch to
or from digest mode, change your password, etc.), visit your
subscription page at:

  https://mail.python.org/mailman/options/python-list/nelsonjonkane6%40live.com


You can also make such adjustments via email by sending a message to:

  python-list-requ...@python.org

with the word `help' in the subject or body (don't include the
quotes), and you will get back a message with instructions.

You must know your password to change your options (including changing
the password, itself) or to unsubscribe without confirmation.  It is:

  Parkhill40

Normally, Mailman will remind you of your python.org mailing list
passwords once every month, although you can disable this if you
prefer.  This reminder will also include instructions on how to
unsubscribe or change your account options.  There is also a button on
your options page that will email your current password to you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Welcome to the "Python-list" mailing list (Digest mode)

2018-01-28 Thread nelson jon kane
Where did this guy in the video below get the version of Python that he's 
using? I don't have it in my computer.His version has this across the top:  
 
*for.py - C:/Users/Madhur/Desktop/for.py*



  https://www.youtube.com/watch?v=I5_UxvF_svw

[https://www.bing.com/th?id=OVP.24cLPPXEaXtBRV4AsjxkNwEsCo=Api]

Python Programming Tutorial - 18: The FOR 
Loop
www.youtube.com
In this tutorial we'll check out the FOR Loop in python and see how it is 
different from the WHILE Loop.





From: nelson jon kane 
Sent: Sunday, January 28, 2018 6:05:04 PM
To: python-list@python.org
Subject: Re: Welcome to the "Python-list" mailing list (Digest mode)


When I enter the word python in the search box on my Chrome Windows 10, this is 
what comes up. Can you tell me what each of these "types" of Python mean? Thank 
you.

[cid:aa3fd74d-d71d-42c0-b063-4f20c463987b]


From: Python-list  on 
behalf of python-list-requ...@python.org 
Sent: Sunday, January 28, 2018 1:28:19 PM
To: nelsonjonka...@live.com
Subject: Welcome to the "Python-list" mailing list (Digest mode)

Welcome to the Python-list@python.org mailing list! The purpose of
this mailing list is to support general discussions about the Python
programming language.  Please remember that this list is mirrored to
the Usenet newsgroup comp.lang.python.

For more information on the Python programming language see


To post to this list, send your message to:

  python-list@python.org

General information about the mailing list is at:

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

If you ever want to unsubscribe or change your options (eg, switch to
or from digest mode, change your password, etc.), visit your
subscription page at:

  https://mail.python.org/mailman/options/python-list/nelsonjonkane6%40live.com


You can also make such adjustments via email by sending a message to:

  python-list-requ...@python.org

with the word `help' in the subject or body (don't include the
quotes), and you will get back a message with instructions.

You must know your password to change your options (including changing
the password, itself) or to unsubscribe without confirmation.  It is:

  Parkhill40

Normally, Mailman will remind you of your python.org mailing list
passwords once every month, although you can disable this if you
prefer.  This reminder will also include instructions on how to
unsubscribe or change your account options.  There is also a button on
your options page that will email your current password to you.
-- 
https://mail.python.org/mailman/listinfo/python-list


IoT automation

2018-01-28 Thread Prahallad Achar
Hello team,
Could you please help me out in automation of IoT product end to end

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


[issue17048] calendar should understand full- vs. half-width characters

2018-01-28 Thread Chason Chaffin

Change by Chason Chaffin :


--
nosy: +chason.chaffin

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2018-01-28 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

> So let's retarget this to 3.8 as it's too close to 3.7 feature freeze to get 
> seriously considered/merged.

I *think* I have a better idea than this for 3.8, but it's definitely 
PEP-sized. The unawaited coroutine tracking proposal here was more conceived as 
a small, unobtrusive thing that could be added to 3.7 and marked provisional, 
to hold us over until 3.8. (Just this week I've spent time helping two people 
who were having trouble with forgetting 'await's, and this feature would have 
given them better errors -- though one was also affected by bpo-32703.)  OTOH 
the issue is complicated enough that it's entirely possibly my "better idea" 
has missed some showstopper detail, in which case maybe this is the best 
solution after all. We'll have plenty to talk about at PyCon this year :-).

Also, looking at the issue log here there's a ton of missing context from all 
the discussions that happened elsewhere this year and eventually led to this 
particular proposal; I'll try to make a list of links and post it here for 
future reference and archaeologists.

--

___
Python tracker 

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



[issue23749] asyncio missing wrap_socket (starttls)

2018-01-28 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +5242
stage: resolved -> patch review

___
Python tracker 

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



[issue32251] Add asyncio.BufferedProtocol

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 07627e9a6a5f418354ff3dc99a0f36bc5b79dcd8 by Yury Selivanov in 
branch 'master':
bpo-32251: Fix docs (#5408)
https://github.com/python/cpython/commit/07627e9a6a5f418354ff3dc99a0f36bc5b79dcd8


--

___
Python tracker 

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



[issue30715] Test_winreg, test_dynamic_key hangs on my Win 10

2018-01-28 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

test_winreg now works, taking about 5 seconds.  It has been working recently 
but I dont' know when or why the problem disappeared.

--
resolution:  -> out of date
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



[issue32251] Add asyncio.BufferedProtocol

2018-01-28 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +5241

___
Python tracker 

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



Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Dan Stromberg
On Sun, Jan 28, 2018 at 8:24 PM, Dan Stromberg  wrote:
> If an NN can ... play go on a level that can beat the best human in the
> world

Correcting myself: I think Google's AlphaGo used more than one NN,
plus perhaps a little traditional reading algorithm.  So I probably
should have said "If NN's can ...".
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Dan Stromberg
On Sun, Jan 28, 2018 at 5:46 PM, Steven D'Aprano
 wrote:
> On Sun, 28 Jan 2018 17:13:05 -0800, Dan Stromberg wrote:
>> It feel like it'd be possible to train a neural network to translate
>> text in a screenshot to plain text though.
>
> That would be OCR, which has been around long before neural networks.
> Neither OCR nor neural networks can magically enhance low-res pixellated
> images and *accurately* turn them into text.

Yes, I'm familiar with OCR, but last I heard, it was still requiring
tuning with a specific font.

Is it really true that OCR appeared long before Neural Networks
(NN's)?  I first heard of NN's in the 80's, but OCR more like the
90's.  NN's have been around a long time, but it's only recently that
they've become highly useful because of the increase in computer
power, an explosion of digital data availability, and algorithm
improvements.

If an NN can translate from English to German well, and can tell a cat
from a dog, or play go on a level that can beat the best human in the
world, an NN might be able to do the job OCR was intended for given
adequate training data.  And we could probably write a little gobject
introspection app to generate copious training data.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Yury Selivanov

Change by Yury Selivanov :


--
components: +Interpreter Core -asyncio
nosy: +ncoghlan

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

> Yury's theory: maybe BEFORE_ASYNC_WITH's error-handling path is forgetting to 
> DECREF the object.

Nope, that doesn't seem to be it. This version prints "refcount: 2" twice, 
*and* prints a proper "was never awaited" warning:

-

import sys

async def open_file():
pass

async def main():
open_file_coro = open_file()
print("refcount:", sys.getrefcount(open_file_coro))

try:
async with open_file_coro:
pass
except:
pass

print("refcount:", sys.getrefcount(open_file_coro))

coro = main()
try:
coro.send(None)
except:
pass

--

___
Python tracker 

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



[issue32703] 'async with' somehow suppresses unawaited coroutine warnings

2018-01-28 Thread Nathaniel Smith

New submission from Nathaniel Smith :

Example (minimal version of https://github.com/python-trio/trio/issues/425):

-

async def open_file():
pass

async def main():
async with open_file():  # Should be 'async with await open_file()'
pass

coro = main()
coro.send(None)

-

Here we accidentally left out an 'await' on the call to 'open_file', so the 
'async with' tries to look up 'CoroutineType.__aexit__', which obviously 
doesn't exist, and the program crashes with an AttributeError("__aexit__"). Yet 
weirdly, this doesn't trigger a warning about 'open_file' being unawaited. It 
should!

Yury's theory: maybe BEFORE_ASYNC_WITH's error-handling path is forgetting to 
DECREF the object.

--
components: asyncio
messages: 311052
nosy: asvetlov, giampaolo.rodola, njs, yselivanov
priority: normal
severity: normal
status: open
title: 'async with' somehow suppresses unawaited coroutine warnings
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



[issue20104] expose posix_spawn(p)

2018-01-28 Thread Martin Panter

Martin Panter  added the comment:

Pablo’s code looked unfinished to me. As well as missing documentation, I 
suspect there may be memory leaks and poor error handling.

The two calls above the “fail:” label look like dead code. The “parse_envlist” 
result appears to be leaked.

I’m curious why you never call “posix_spawn_file_actions_destroy”. I saw on 
Open BSD  it reclaims 
memory, and it seems sensible to call it on other platforms as well.

No error checking on any of the “posix_spawn_file_actions_” methods.

If “posix_spawn” fails, the “pid” variable will be returned uninitialized.

--
nosy: +martin.panter, pablogsal

___
Python tracker 

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



[issue32688] weird comment out line of code

2018-01-28 Thread Brett Cannon

Brett Cannon  added the comment:

Thanks!

On Sun, Jan 28, 2018, 19:32 Xiang Zhang,  wrote:

>
> Xiang Zhang  added the comment:
>
> Done.
>
> --
> versions:  -Python 3.6
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue32702] Minor markup typo

2018-01-28 Thread KINEBUCHI Tomohiko

Change by KINEBUCHI Tomohiko :


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

___
Python tracker 

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



[issue28685] Optimizing list.sort() by performing safety checks in advance

2018-01-28 Thread ppperry

ppperry  added the comment:

... and I'm still trying to come up with even more pathological mutating cases

--

___
Python tracker 

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



[issue32702] Minor markup typo

2018-01-28 Thread KINEBUCHI Tomohiko

New submission from KINEBUCHI Tomohiko :

In the staticmethod document [1], code snippet should be a literal block, but 
actually be a block quote.
See the attached image file.

[1] https://docs.python.org/3.6/library/functions.html#staticmethod

--
assignee: docs@python
components: Documentation
files: Screen Shot 2018-01-29 at 12.37.37.png
messages: 311048
nosy: cocoatomo, docs@python
priority: normal
severity: normal
status: open
title: Minor markup typo
versions: Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47415/Screen Shot 2018-01-29 at 
12.37.37.png

___
Python tracker 

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



[issue32650] Debug support for native coroutines is broken

2018-01-28 Thread Yury Selivanov

Change by Yury Selivanov :


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

___
Python tracker 

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



[issue32650] Debug support for native coroutines is broken

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 9ee1bf9ab5af8233ed8ec5c53d12a29dc1bd9c9d by Yury Selivanov in 
branch 'master':
bpo-32650: Add an asyncgen pdb test (#5406)
https://github.com/python/cpython/commit/9ee1bf9ab5af8233ed8ec5c53d12a29dc1bd9c9d


--

___
Python tracker 

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



[issue28685] Optimizing list.sort() by performing safety checks in advance

2018-01-28 Thread Tim Peters

Tim Peters  added the comment:

Thank you for giving this worthy orphan a home, Raymond!

Victor, don't fret too much.  The code is really quite simple, and at worst 
affects only `sorted()` and `list.sort()`.  The vast bulk of review effort (of 
which it got enough) went into dreaming up pathological cases (like mutating 
list elements, and even list element comparison methods, _while_ a sort was in 
progress).

I confess I didn't press for more benchmarks, because I don't care about more 
here:  the code is so obviously a major speed win when it applies, it so 
obviously applies often, and the new worst-case overhead when it doesn't apply 
is so obviously minor compared to the cost of a sort (`len(list)-1` wasted 
C-level pointer equality compares).  The only real value of timing benchmarks 
to me here was as a gross sanity check, and enough of those were run to confirm 
that all the preceding were qualitatively on target.  It really doesn't matter 
at all, e.g., whether the best cases are 2 times faster or 10 times faster, or 
the truly pathologal worst cases 10% slower or 20% slower.  Regardless, it's as 
close to a pure win as just about anything can be.

Nevertheless ... if this brings a major player's server to its knees, blame 
Raymond ;-)

--

___
Python tracker 

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



[issue32688] weird comment out line of code

2018-01-28 Thread Xiang Zhang

Xiang Zhang  added the comment:

Done.

--
versions:  -Python 3.6

___
Python tracker 

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



[issue32688] weird comment out line of code

2018-01-28 Thread Xiang Zhang

Xiang Zhang  added the comment:


New changeset 997478eb797b31bd724135ca17781d1cf4b89cfa by Xiang Zhang in branch 
'master':
bpo-32688: Make why the line is commented out clear (GH-5405)
https://github.com/python/cpython/commit/997478eb797b31bd724135ca17781d1cf4b89cfa


--

___
Python tracker 

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



[issue32650] Debug support for native coroutines is broken

2018-01-28 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +5239

___
Python tracker 

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



[issue32699] pythonXY._pth : unclear how .pth files are handled

2018-01-28 Thread Steve Dower

Steve Dower  added the comment:

Hopefully that's enough of a clarification.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement
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



[issue28685] Optimizing list.sort() by performing safety checks in advance

2018-01-28 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset 1e34da49ef22004ca25c517b3f07c6d25f083ece by Raymond Hettinger 
(embg) in branch 'master':
bpo-28685: Optimize sorted() list.sort() with type-specialized comparisons 
(#582)
https://github.com/python/cpython/commit/1e34da49ef22004ca25c517b3f07c6d25f083ece


--

___
Python tracker 

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



[issue28685] Optimizing list.sort() by performing safety checks in advance

2018-01-28 Thread Raymond Hettinger

Change by Raymond Hettinger :


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



Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
The message type is bytes,  this may make different ?

 print(type(message))



On Sun, Jan 28, 2018 at 8:41 PM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:

> On Sun, 28 Jan 2018 20:31:39 -0500, Jason Qian via Python-list wrote:
>
> > Thanks a lot :)
> >
> > os.write(1, message)  works !
>
> I still do not believe that print(message) doesn't work. I can see no
> reason why you need to use os.write().
>
>
>
>
> --
> Steve
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Larry Martell
On Sun, Jan 28, 2018 at 10:04 AM, Steven D'Aprano
 wrote:
> I'm seeing this annoying practice more and more often. Even for trivial
> pieces of text, a few lines, people post screenshots instead of copying
> the code.
>
> Where has this meme come from? It seems to be one which inconveniences
> *everyone* involved:
>
> - for the sender, instead of a simple copy and paste, they have to take a
> screen shot, possibly trim the image to remove any bits of the screen
> they don't want to show, attach it to their email or upload it to an
> image hosting site;
>
> - for the receiver, you are reliant on a forum which doesn't strip
> attachments, or displays externally hosted images; the visually impaired
> are excluded from using a screen reader; and nobody can copy or edit the
> given text.
>
> It is as if people are deliberately inconveniencing themselves in order
> to inconvenience the people they are asking to help them.
>
> With the exception of one *exceedingly* overrated advantage, namely the
> ability to annotate the image with coloured lines and circles and
> squiggles or other graphics (which most people don't bother to do), this
> seems to me to be 100% counter-productive for everyone involved. Why has
> it spread and why do people keep doing it?
>
> I don't want to be the old man yelling "Get Of My Lawn!" to the cool
> kids, but is this just another sign of the downward spiral of programming
> talent? Convince me that there is *some* justification for this practice.
> Even a tiny one.
>
> (The day a programmer posts a WAV file of themselves reading their code
> out aloud, is the day I turn my modem off and leave the internet forever.)

I work remotely and have for over 20 years. At first I communicated
with my colleagues via phone and email. Then it was skype for a while
but then it went back to email. Then IRC had a moment, then it was
slack for a while, then back to email. Now everyone seems to be
switching to google hangouts, both chat and video. Recently I have
seen that some people are sending screen shots of their code and/or
error messages instead of copy/pasting.  It's mostly with the younger
ones, and I do not care for it at all, but I did not want to be the
old fogy, so I did not say anything.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32688] weird comment out line of code

2018-01-28 Thread Xiang Zhang

Change by Xiang Zhang :


--
pull_requests: +5238

___
Python tracker 

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



Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Dan Stromberg
On Sun, Jan 28, 2018 at 6:04 PM, Steven D'Aprano
 wrote:
> On Sun, 28 Jan 2018 17:49:44 -0800, Dan Stromberg wrote:
> So what was the clue that it was bytes that you saw that (nearly)
> everyone else missed? Especially me.

Can I get away with saying "it was just a good guess"?

I've been using byte strings a bunch in one of my projects. That didn't hurt.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 17:49:44 -0800, Dan Stromberg wrote:

> On Sun, Jan 28, 2018 at 5:35 PM, Steven D'Aprano
>  wrote:
>> On Sun, 28 Jan 2018 17:04:56 -0800, Dan Stromberg wrote:
>>> How about:
>> os.write(1, message)
>>
>> What do you think that will do that print() doesn't do?
> 
 message = b'*does not exist\r\n\tat com.*' 
 os.write(1, message)
> *does not exist
> at com.*26

 print(message)
> b'*does not exist\r\n\tat com.*'


What was the clue that made you think that Jason was using bytes? In his 
posts, he always said it was a string, and when he printed the repr() of 
the message, it was a string, not bytes. If it were bytes, we would have 
seen this:

py> message = b'*does not exist\r\n\tat com.*'
py> print(repr(message))
b'*does not exist\r\n\tat com.*'


That is NOT the output that Jason showed. His output was:

py> string_message = '*does not exist\r\n\tat com.*'
py> print(repr(string_message))
'*does not exist\r\n\tat com.*'


Ah wait no it wasn't even that. The output he showed had no quotation 
marks. I didn't pick up on that: what he sent us as supposed output was 
actually impossible. He has been editing the output.

So what was the clue that it was bytes that you saw that (nearly) 
everyone else missed? Especially me.


-- 
Steve

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


Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 19:51:06 -0500, Jason Qian via Python-list wrote:

> print(repr(message))  out :
> 
> *does not exist\r\n\tat com.*

For the record, I'd just like to say that this is not the output of 
Jason's call to print(). It has been edited to remove the 

b' '

delimiters which would have solved the problem: he isn't printing a 
string at all, he is printing bytes.

Jason, you have wasted our time by editing your output to hide what it 
actually shows. Don't do that again. When we ask to see the output of 
something, we need to see the ACTUAL output, not an edited version.


-- 
Steve

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


[issue20104] expose posix_spawn(p)

2018-01-28 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

remaining work before closing this:
  Doc/library/os.rst needs to describe os.posix_spawn

--
priority: low -> normal

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-01-28 Thread Gregory P. Smith

Gregory P. Smith  added the comment:


New changeset 6c6ddf97c402709713d668d0ed53836a7749ba99 by Gregory P. Smith 
(Pablo Galindo) in branch 'master':
bpo-20104: Expose `posix_spawn` in the os module (GH-5109)
https://github.com/python/cpython/commit/6c6ddf97c402709713d668d0ed53836a7749ba99


--

___
Python tracker 

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



Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 17:13:05 -0800, Dan Stromberg wrote:

> I'm afraid the perspective may be:
> Text == primitive
> GUI == modern
> 
> It feel like it'd be possible to train a neural network to translate
> text in a screenshot to plain text though.

That would be OCR, which has been around long before neural networks. 
Neither OCR nor neural networks can magically enhance low-res pixellated 
images and *accurately* turn them into text.

https://en.wikipedia.org/wiki/Optical_character_recognition


-- 
Steve

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


Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Dan Stromberg
On Sun, Jan 28, 2018 at 5:35 PM, Steven D'Aprano
 wrote:
> On Sun, 28 Jan 2018 17:04:56 -0800, Dan Stromberg wrote:
>> How about:
> os.write(1, message)
>
> What do you think that will do that print() doesn't do?

>>> message = b'*does not exist\r\n\tat com.*'
>>> os.write(1, message)
*does not exist
at com.*26
>>> print(message)
b'*does not exist\r\n\tat com.*'
>>>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 20:31:39 -0500, Jason Qian via Python-list wrote:

> Thanks a lot :)
> 
> os.write(1, message)  works !

I still do not believe that print(message) doesn't work. I can see no 
reason why you need to use os.write().




-- 
Steve

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


Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 17:04:56 -0800, Dan Stromberg wrote:

> How about:
 os.write(1, message)


What do you think that will do that print() doesn't do?



-- 
Steve

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


Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Steven D'Aprano
Jason, your Python output and the C output are not the same.

Also, it looks like your email client is adding formatting codes to the 
email, or something. Please look at your post here:

https://mail.python.org/pipermail/python-list/2018-January/730384.html

Do you notice the extra asterisks added? I think they are added by your 
email program. Please do not use any formatting, they make the output 
confusing and make it difficult to understand what you are doing.

In Python, the output of print(repr(message)) looks like this:

does not exist\r\n\tat com.

(removing the asterisks at the start and end, which I believe are 
formatting added by to your email). That is, spelling it out character by 
character:

DE OH EE ES space EN OH TE space EE EX I ES TE backslash
AR backslash EN backslash TE AY TE space CE OH EM dot

That is what I expected. So if you print(message) without the repr, you 
should get exactly this:

does not exist
at com.



Here is the input and output of my Python session:

py> s = 'does not exist\r\n\tat com.'
py> print(s)
does not exist
at com.



That looks like exactly what you are expecting. If you are getting 
something different, please COPY AND PASTE as PLAIN TEXT (no formatting, 
no bold, no italics) the exact output from your Python session. And tell 
us what IDE you are using, or which interpreter. Are you using IDLE or 
PyCharm or Spyder or something else?

I repeat: do not add bold, or italics, do not use formatting of any kind. 
If you don't know how to turn the formatting off in your email program, 
you will need to find out.


You also print the individual characters of message from C:

for ch in message:
  printf("%d %c",ch, chr(ch))

and that outputs something completely different: the messages are not the 
same in your C code and your Python code.

Your Python code message is:

does not exist\r\n\tat com.


but your C code message appears to be:

not exist\r\n\tat com

(missing word "does" and final dot).

I do not understand why you are showing us C code. This is a Python 
forum, and you are having trouble printing from Python -- C is irrelevant.

I think you should just call print(message). If that doesn't do what you 
want, you need to show us what it actually does.



-- 
Steve

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


Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
Thanks Peter,

  replace print with os.write  fixed the problem.



On Sun, Jan 28, 2018 at 3:57 AM, Peter Otten <__pete...@web.de> wrote:

> Jason Qian via Python-list wrote:
>
> > HI
> >
> >I have a string that contains \r\n\t
> >
> >[Ljava.lang.Object; does not exist*\r\n\t*at
> >[com.livecluster.core.tasklet
> >
> >
> >I would like to  print it as :
> >
> > [Ljava.lang.Object; does not exist
> >  tat com.livecluster.core.tasklet
> >
> >   How can I do this in python print ?
>
> Assuming the string contains the escape sequences rather than an actual
> TAB, CR or NL you can apply codecs.decode():
>
> >>> s = r"[Ljava.lang.Object; does not exist\r\n\tat
> com.livecluster.core.tasklet"
> >>> print(s)
> [Ljava.lang.Object; does not exist\r\n\tat com.livecluster.core.tasklet
> >>> import codecs
> >>> print(codecs.decode(s, "unicode-escape"))
> [Ljava.lang.Object; does not exist
> at com.livecluster.core.tasklet
>
> Note that this will decode all escape sequences that may occur in a string
> literal
> in Python, e. g.
>
> >>> codecs.decode(r"\x09 \u03c0 \N{soft ice cream}", "unicode-escape")
> '\t π '
>
> and will complain when the string is not a valid Python string literal:
>
> >>> codecs.decode(r"\x", "unicode-escape")
> Traceback (most recent call last):
>   File "", line 1, in 
> UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position
> 0-1: truncated \xXX escape
>
> If you need more control you can build your own conversion routine:
>
> import re
>
> lookup = {
> "r": "\r",
> "n": "\n",
> "t": "\t",
> }
>
> def substitute(match):
> group = match.group(1)
> return lookup.get(group, group)
>
> def decode(s):
> return re.sub(r"\\(.)", substitute, s)
>
> s = decode("alpha\\n \\xomega")
> print(s)
> print(repr(s))
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue28685] Optimizing list.sort() by performing safety checks in advance

2018-01-28 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
Thanks a lot :)

os.write(1, message)  works !

On Sun, Jan 28, 2018 at 8:04 PM, Dan Stromberg  wrote:

> How about:
> >>> os.write(1, message)
>
> On Sun, Jan 28, 2018 at 4:51 PM, Jason Qian via Python-list
>  wrote:
> > print(repr(message))  out :
> >
> > *does not exist\r\n\tat com.*
> >
> >
> > for ch in message:
> >   printf("%d %c",ch, chr(ch))
> >
> >
> > %d %c 110 n
> > %d %c 111 o
> > %d %c 116 t
> > %d %c 32
> > %d %c 101 e
> > %d %c 120 x
> > %d %c 105 i
> > %d %c 115 s
> > %d %c 116 t
> >
> > *%d %c 13%d %c 10*
> > *%d %c 9*
> > %d %c 97 a
> > %d %c 116 t
> > %d %c 32
> > %d %c 99 c
> > %d %c 111 o
> > %d %c 109 m
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32650] Debug support for native coroutines is broken

2018-01-28 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset c7ab581db216aeeb1c2aa7af2f2198d2b7516383 by Yury Selivanov (Pablo 
Galindo) in branch 'master':
bpo-32650 Add support for async generators and more test for coroutines in pdb  
(#5403)
https://github.com/python/cpython/commit/c7ab581db216aeeb1c2aa7af2f2198d2b7516383


--

___
Python tracker 

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



Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Dan Sommers
On Mon, 29 Jan 2018 00:27:07 +, Steven D'Aprano wrote:

> On Mon, 29 Jan 2018 08:55:54 +1100, Tim Delaney wrote:
> 
>> I got back a Word document containing about 10 screenshots where they'd
>> apparently taken a screenshot, moved the horizontal scrollbar one
>> screen, taken another screenshot, etc.
> 
> You're lucky they didn't just take a single screen shot, thinking that 
> you can scroll past the edges to see what is off-screen.

No!  Not another pass by reference vs. pass by value thread!

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


Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Dan Stromberg
I'm afraid the perspective may be:
Text == primitive
GUI == modern

It feel like it'd be possible to train a neural network to translate
text in a screenshot to plain text though.

On Sun, Jan 28, 2018 at 7:04 AM, Steven D'Aprano
 wrote:
> I'm seeing this annoying practice more and more often. Even for trivial
> pieces of text, a few lines, people post screenshots instead of copying
> the code.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Tim Delaney
On 29 January 2018 at 11:27, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:

> On Mon, 29 Jan 2018 08:55:54 +1100, Tim Delaney wrote:
>
> > I got back a Word document containing about 10 screenshots where they'd
> > apparently taken a screenshot, moved the horizontal scrollbar one
> > screen, taken another screenshot, etc.
>
> You're lucky they didn't just take a single screen shot, thinking that
> you can scroll past the edges to see what is off-screen.


I suspect that was the case on the original screenshot in Word document ...

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


Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Dan Stromberg
How about:
>>> os.write(1, message)

On Sun, Jan 28, 2018 at 4:51 PM, Jason Qian via Python-list
 wrote:
> print(repr(message))  out :
>
> *does not exist\r\n\tat com.*
>
>
> for ch in message:
>   printf("%d %c",ch, chr(ch))
>
>
> %d %c 110 n
> %d %c 111 o
> %d %c 116 t
> %d %c 32
> %d %c 101 e
> %d %c 120 x
> %d %c 105 i
> %d %c 115 s
> %d %c 116 t
>
> *%d %c 13%d %c 10*
> *%d %c 9*
> %d %c 97 a
> %d %c 116 t
> %d %c 32
> %d %c 99 c
> %d %c 111 o
> %d %c 109 m
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-28 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

https://github.com/python/typing/issues/512 and 
https://github.com/python/typing/issues/511 are first issue (they are closely 
related to each other). This is not directly related to PEP 560, but changes in 
typing because of it will allow to fix them in a simple manner.

The second one is Union simplification (was discussed in few PRs on typing 
tracker). This is not really a bug, but something we should decide on before 
3.7 final. It will be difficult to change it later. Again, with PEP 560 in 
place the corresponding refactoring for removal should be straightforward.

In addition, there is https://github.com/python/typing/issues/392, this is 
already almost fixed by the typing PR implementing PEP 560, but it doesn't work 
for dunder attributes (I think we should not relay only specific set of 
reserved names, rather than all dunders).

--

___
Python tracker 

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



Re: Please help on print string that contains 'tab' and 'newline'

2018-01-28 Thread Jason Qian via Python-list
print(repr(message))  out :

*does not exist\r\n\tat com.*


for ch in message:
  printf("%d %c",ch, chr(ch))


%d %c 110 n
%d %c 111 o
%d %c 116 t
%d %c 32
%d %c 101 e
%d %c 120 x
%d %c 105 i
%d %c 115 s
%d %c 116 t

*%d %c 13%d %c 10*
*%d %c 9*
%d %c 97 a
%d %c 116 t
%d %c 32
%d %c 99 c
%d %c 111 o
%d %c 109 m





On Sun, Jan 28, 2018 at 9:50 AM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:

> On Sat, 27 Jan 2018 21:23:02 -0500, Jason Qian via Python-list wrote:
>
> > there are 0D 0A 09
>
> If your string actually contains CARRIAGE RETURN (OD) NEWLINE (OA), and
> TAB (09) characters, then you don't need to do anything. Just call print,
> and they will be printed correctly.
>
> If that doesn't work, then your input string doesn't contain what you
> think it contains. Please call this:
>
> print(repr(the_string))
>
> and COPY AND PASTE the output here so we can see it.
>
>
>
> --
> Steve
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32650] Debug support for native coroutines is broken

2018-01-28 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
pull_requests: +5237

___
Python tracker 

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



Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Steven D'Aprano
On Mon, 29 Jan 2018 08:55:54 +1100, Tim Delaney wrote:

> I got back a Word document containing about 10 screenshots where they'd
> apparently taken a screenshot, moved the horizontal scrollbar one
> screen, taken another screenshot, etc.

You're lucky they didn't just take a single screen shot, thinking that 
you can scroll past the edges to see what is off-screen.


-- 
Steve

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


[issue32650] Debug support for native coroutines is broken

2018-01-28 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5236

___
Python tracker 

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



Re: Data-structure for multiway associativity in Python

2018-01-28 Thread Steven D'Aprano
On Sun, 28 Jan 2018 14:48:02 -0800, qrious wrote:

> First list = { 1, 2, 3}
> Second list = { 4, 5, 6}
> Third list = { 7, 8, 9}
> 
> If I pass 9 as the argument, the return value of the function would be 
> {7, 8}.



subsets = [{1, 2, 3}, {4, 5, 6}, {7, 8, 9}]

data = {}
for subset in subsets:
for key in subset:
data[key] = subset

# At this point, your master data looks like this:
# 
# {1: {1, 2, 3},  2: {1, 2, 3},  3: {1, 2, 3},
#  4: {4, 5, 6},  5: {4, 5, 6},  6: {4, 5, 6}, 
#  7: {7, 8, 9},  8: {7, 8, 9},  9: {7, 8, 9}}
#
# but don't worry, that's not three COPIES of each set, just three
# references to the same one: each reference costs only a single
# pointer.

# Find a set associated with a key
subset = data[9]  # this is a lightning-fast lookup

# Get the items in the set, excluding the key itself
result = subset - {9}
assert result == {7, 8}

# Add a new data point to that set:
subset.add(10)
data[10] = subset

# Delete a data point:
del subset[9]
del data[9]



If you had started with a concrete example from the start, this would not 
have seemed like such a mysterious and difficult problem. Describing it 
as "multiway associativity" doesn't really help: as far as I can see, 
it's not multiway at all, it is just a straightforward case of one way 
associativity between each key and a set of values that contains that key.

Concrete examples are *really* useful for clarifying the requirements.



-- 
Steve

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


[issue32650] Debug support for native coroutines is broken

2018-01-28 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 46877024423e98d1b872bf308dacacd583327207 by Andrew Svetlov (Pablo 
Galindo) in branch 'master':
bpo-32650: Add native coroutine support to bdb when stepping over line (GH-5400)
https://github.com/python/cpython/commit/46877024423e98d1b872bf308dacacd583327207


--

___
Python tracker 

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



[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-28 Thread Guido van Rossum

Guido van Rossum  added the comment:

Are there more specific descriptions of those bugs? Links to a tracker?
(Even if it's the typing tracker.)

--

___
Python tracker 

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



[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-28 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

I think all the critical things have been implemented/fixed. There are 
unfortunately no docs yet (my fault), also there are two bugs related to PEP 
560, but they are not new, they also exist in Python 3.6.

I am however marking this as high priority, since these two bugs prevent 
progress on other projects (pickling generic classes), so it would be good to 
fix them before beta-2.

--
priority: release blocker -> high

___
Python tracker 

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



[issue32701] Typo in quopri documentation

2018-01-28 Thread Julien Palard

Change by Julien Palard :


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

___
Python tracker 

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



[issue32701] Typo in quopri documentation

2018-01-28 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks! I like your proposed change.

Please create the PR.

--
nosy: +Mariatta

___
Python tracker 

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



[issue32700] spam?

2018-01-28 Thread R. David Murray

Change by R. David Murray :


--
stage:  -> resolved
status: open -> closed
title: The replys additional (Re.) is ok. -> spam?

___
Python tracker 

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



[issue32701] Typo in quopri documentation

2018-01-28 Thread Julien Palard

New submission from Julien Palard :

Spotted a typo in https://docs.python.org/3/library/quopri.html: "must be 
provideda"

But I also can't extract the meaning of the sentence:

> quotetabs, a flag which controls whether to encode embedded spaces and tabs 
> must be provideda and when true it encodes such embedded whitespace, and when 
> false it leaves them unencoded.

So here's the diff from 99597c4d12e358174275945d97e504c0318a3783:

+ *quotetabs*, a flag which controls whether to encode embedded spaces and tabs 
must be provideda and when true it encodes such embedded whitespace, and when 
false it leaves them unencoded.
- *quotetabs* is a flag which controls whether to encode embedded spaces and 
tabs; when true it encodes such embedded whitespace, and when false it leaves 
them unencoded.

So the "must be provided" has been added, I propose:

*quotetabs*, a non-optional flag which controls whether to encode embedded 
spaces and tabs; when true it encodes such embedded whitespace, and when false 
it leaves them unencoded.

--
assignee: docs@python
components: Documentation
messages: 311033
nosy: docs@python, mdk, orsenthil
priority: low
severity: normal
status: open
title: Typo in quopri documentation
versions: 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



[issue32699] pythonXY._pth : unclear how .pth files are handled

2018-01-28 Thread Steve Dower

Steve Dower  added the comment:


New changeset 15ea3a6a320623328530e5d8da5b83c75766180b by Steve Dower in branch 
'master':
bpo-32699: Improves doc for .pth files in presense of a ._pth file (#5399)
https://github.com/python/cpython/commit/15ea3a6a320623328530e5d8da5b83c75766180b


--

___
Python tracker 

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



[issue21060] Better error message for setup.py upload command without sdist/bdist

2018-01-28 Thread Éric Araujo

Éric Araujo  added the comment:

For improving the message, I am hesitating between adding to the existing 
message (hoping to help search engines find their way to improved docs):

«No dist file created in earlier command (e.g. setup.py sdist upload)» 

and rewriting it entirely:

«Must create and upload dist files in one command (e.g. setup.py sdist upload)»

--
assignee:  -> eric.araujo
stage: needs patch -> patch review
title: Better error message for setup.py upload command without sdist -> Better 
error message for setup.py upload command without sdist/bdist
versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue12944] Accept arbitrary files for distutils' upload command

2018-01-28 Thread Éric Araujo

Éric Araujo  added the comment:

A doc ticket already exists, moving this one back to a feature request and 
closing it.

--
resolution:  -> wont fix
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Better error message for setup.py upload command without sdist
title: Better error message for "setup.py upload" missing sdist/bdist -> Accept 
arbitrary files for distutils' upload command
type: behavior -> enhancement

___
Python tracker 

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



[issue12944] Better error message for "setup.py upload" missing sdist/bdist

2018-01-28 Thread Éric Araujo

Éric Araujo  added the comment:

I had a patch for this, but now think it would be an attractive nuisance, given 
that distutils does not always ensure proper HTTPS verification.

Not adding the ability to build sdists/wheels, check them and then upload them 
will help push people to twine, which doesn’t have all the .pypirc parsing bugs 
and is a good HTTPS citizen.

I will however commit a patch to clarify the message «no dist file created in 
earlier command».

--
nosy: +dstufft
title: Accept arbitrary files for distutils' upload command -> Better error 
message for "setup.py upload" missing sdist/bdist
type: enhancement -> behavior
versions: +Python 2.7, Python 3.6, Python 3.7 -Python 3.5

___
Python tracker 

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



[issue32304] Upload failed (400): Digests do not match on .tar.gz ending with x0d binary code

2018-01-28 Thread Éric Araujo

Change by Éric Araujo :


--
assignee:  -> eric.araujo
resolution:  -> fixed
stage: patch review -> backport needed

___
Python tracker 

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



Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Gregory Ewing

Steven D'Aprano wrote:
(The day a programmer posts a WAV file of themselves reading their code 
out aloud, is the day I turn my modem off and leave the internet forever.)


Shh! Don't give them ideas!

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


[issue32373] Add socket.getblocking() method

2018-01-28 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue32650] Debug support for native coroutines is broken

2018-01-28 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue32226] Implement PEP 560: Core support for typing module and generic types

2018-01-28 Thread STINNER Victor

Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



  1   2   3   >