[issue32242] loop in loop with with 'zip'ped object misbehaves in py3.6

2017-12-07 Thread Vishu Viswanathan
Vishu Viswanathan added the comment: Thanks for the fast response and clarification. Now I can run my code made for py2.7 also run in py3.6 I should search and read documentation before reporting. Thanks On Thu, Dec 7, 2017 at 8:03 PM, Steven D'Aprano

Anything similar to __END__ in perl

2017-12-07 Thread Peng Yu
Hi, perl has __END__ which ignore all the lines below it. Is there anything similar to __END__ in python? Thanks. -- Regards, Peng -- https://mail.python.org/mailman/listinfo/python-list

[issue30904] Python 3 logging HTTPHandler sends duplicate Host header

2017-12-07 Thread iMath
iMath added the comment: Yes, I met with the same bug, see the post for description and bug investigation https://stackoverflow.com/questions/43185804/using-httphandler-cause-django-server-side-shows-http-400-and-invalid-http-host/47434323#47434323 -- nosy:

[issue31942] Document that support of start and stop parameters in the Sequence's index() is optional

2017-12-07 Thread Nitish
Nitish added the comment: Any comments on the PR? -- ___ Python tracker ___

[issue28197] Add start and stop parameters to the range.index() ABC method

2017-12-07 Thread Nitish
Nitish added the comment: Any comments on the PR? -- nosy: +nitishch ___ Python tracker ___

[issue32251] Add asyncio.BufferedProtocol

2017-12-07 Thread Yury Selivanov
Yury Selivanov added the comment: I've made a PR that implements the change for selector_events.py. With the change: vanilla asyncio:120-135 Mb/s vanilla asyncio/get_buffer: 220-230 Mb/s uvloop: 320-330 Mb/s uvloop/get_buffer:

[issue32251] Add asyncio.BufferedProtocol

2017-12-07 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +4658 stage: -> patch review ___ Python tracker ___

[issue8722] Documentation for __getattr__

2017-12-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Cheryl, thank you for reviving this, as it is still needed. A slightly revised example better illustrates the claim in the doc revision about when __getattr__ is called. class Foo(object): def __init__(self): self.foo = 1

[issue32251] Add asyncio.BufferedProtocol

2017-12-07 Thread Yury Selivanov
New submission from Yury Selivanov : A couple emails from async-sig for the context: 1. https://mail.python.org/pipermail/async-sig/2017-October/000392.html 2. https://mail.python.org/pipermail/async-sig/2017-December/000423.html I propose to add another Protocol base

Re: why won't slicing lists raise IndexError?

2017-12-07 Thread Python
Hi Rick! On Wed, Dec 06, 2017 at 04:05:42PM -0800, Rick Johnson wrote: > Python wrote: > > [...] > > > THIS IS FALSE. CALLING A FUNCTION > > What *FUNCTION*? In this snippet (which again, we agreed was an incomplete academic example): if item: process(item) else:

[issue32251] Add asyncio.BufferedProtocol

2017-12-07 Thread Yury Selivanov
Change by Yury Selivanov : -- assignee: yselivanov components: asyncio nosy: asvetlov, gvanrossum, pitrou, yselivanov priority: normal severity: normal status: open title: Add asyncio.BufferedProtocol versions: Python 3.7 ___

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Ethan Furman
On 12/07/2017 10:28 AM, Ethan Furman wrote: The simple answer is No, and all the answers agree on that point. It does beg the question of what an identity function is, though. Thankfully, Paul answered that question with a good explanation*. Thanks, everyone, for the discussion. -- ~Ethan~

[issue8722] Documentation for __getattr__

2017-12-07 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +needs review -patch versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker

[issue8722] Documentation for __getattr__

2017-12-07 Thread Cheryl Sabella
Change by Cheryl Sabella : -- pull_requests: +4657 stage: needs patch -> patch review ___ Python tracker ___

Re: Please tell me how to execute python file in Ubuntu by double clicking on file. (Posting On Python-List Prohibited)

2017-12-07 Thread Python
On Thu, Dec 07, 2017 at 01:29:11PM +1100, Steve D'Aprano wrote: > On Thu, 7 Dec 2017 08:22 am, Python wrote: > >> > Linux doesn’t do “OS file associations”. > >> > >> Then how does my Linux box know that when I double-click on a text file, it > >> launches kwrite rather than (say) the Gimp or

Re: Please tell me how to execute python file in Ubuntu by double clicking on file. (Posting On Python-List Prohibited)

2017-12-07 Thread Rick Johnson
On Wednesday, December 6, 2017 at 8:29:23 PM UTC-6, Steve D'Aprano wrote: [...] > If the term "OS file associations" is ever so slightly > inaccurate (it's not the actual OS kernel that does the > associating, but the desktop environment), well, we can > probably say the same thing about Mac

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Ben Finney
Nathan Ernst writes: > There is a built-in identity function in Python. The function is called > 'id'. It should be clear from the rest of the thread. But, to be explicit: That's not what is meant by “identity function”, and the Python ‘id’ function is not an identity

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Ben Finney
Ethan Furman writes: > My contention is that an identity function is a do-nothing function > that simply returns what it was given: > > --> identity(1) > 1 > > --> identity('spam') > 'spam' These seem good to me. One argument given, the same result returned. > -->

[issue32246] test_regrtest alters the execution environment on Android

2017-12-07 Thread STINNER Victor
STINNER Victor added the comment: > The fact that the TEMP directory is not clean already happens when running > buildbottest natively with the standard Python Makefile (no one has noticed > it yet I guess) and the directory contains a core file. The root issue is

[issue32246] test_regrtest alters the execution environment on Android

2017-12-07 Thread STINNER Victor
STINNER Victor added the comment: > The command 'adb logcat' reports a crash ("Fatal signal 11 (SIGSEGV)") during > the execution of the command. This sounds familiar :-) test_crashed() does crash on SIGGEV on purpose. It tests how regrtest behaves when a worker

[issue32193] Convert asyncio to async/await

2017-12-07 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___

[issue32250] Add loop.current_task() and loop.all_tasks() methods

2017-12-07 Thread Andrew Svetlov
New submission from Andrew Svetlov : Existing `Task.current_task()` and `Task.all_tasks()` class methods are not overridable by custom event loop implementation. The proposal is adding new optional loop methods and using them by existing task methods. --

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2017-12-07 Thread Mark Shannon
Mark Shannon added the comment: Thanks, that example shows the essence of the problem. I understand you perfectly now. -- ___ Python tracker

[issue32249] Document handler.cancelled()

2017-12-07 Thread Andrew Svetlov
New submission from Andrew Svetlov : Method was added by https://bugs.python.org/issue31943 -- components: asyncio messages: 307825 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Document handler.cancelled() versions: Python

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Paul Moore
On 7 December 2017 at 20:35, Chris Angelico wrote: > Because it's impossible to return multiple values. IMO the "identity > function" is defined only in terms of one single argument, so all of > this is meaningless. Indeed, this is the key point. The Python language only allows

[issue32193] Convert asyncio to async/await

2017-12-07 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +4656 stage: -> patch review ___ Python tracker ___

Re: SystemError: error return without exception set

2017-12-07 Thread Lawrence D’Oliveiro
On Friday, December 8, 2017 at 5:15:35 AM UTC+13, Natalie Leung wrote: > I have emailed the provider but their technical support staff has stated > that they have exhausted of all ideas. If they can’t supply you with a product fit for purpose, time to send it back for a refund. --

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Lele Gaifax
Chris Angelico writes: > On Fri, Dec 8, 2017 at 6:29 AM, Lele Gaifax wrote: >> Chris Angelico writes: >> >>> On Fri, Dec 8, 2017 at 5:53 AM, Peter Otten <__pete...@web.de> wrote: Hm, what does -- and what should --

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Chris Angelico
On Fri, Dec 8, 2017 at 8:30 AM, Lele Gaifax wrote: > Chris Angelico writes: > >> On Fri, Dec 8, 2017 at 6:29 AM, Lele Gaifax wrote: >>> Chris Angelico writes: >>> On Fri, Dec 8, 2017 at 5:53 AM, Peter Otten

[issue32248] Port importlib_resources (module and ABC) to Python 3.7

2017-12-07 Thread Barry A. Warsaw
New submission from Barry A. Warsaw : We intend to port importlib_resources to Python 3.7 as importlib.resources, with a provisional API. There's also a ResourceReader ABC to include, along with documentation and tests. Nosying Brett and assigning to myself, but if Brett

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Ethan Furman
On 12/07/2017 12:24 PM, Peter Otten wrote: identity((a, b, c)) calls identity() with one argument whereas identity(a, b, c) calls identity() with three arguments. That's certainly an effect; you just undo it with your test for len(args) == 1. That means that your identity() function throws

[issue32247] shutil-copytree: Create dst folder only if it doesn't exist

2017-12-07 Thread Radostin
New submission from Radostin : shutil.copytree method always tries to create the destination directory which raises the error message "OSError: [Errno 17] File exists". This issue has been discussed here:

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Chris Angelico
On Fri, Dec 8, 2017 at 7:25 AM, Ned Batchelder wrote: > On 12/7/17 2:41 PM, Ethan Furman wrote: >> >> On 12/07/2017 11:23 AM, Ned Batchelder wrote: >>> >>> On 12/7/17 1:28 PM, Ethan Furman wrote: >> >> --> identity('spam', 'eggs', 7) ('spam', 'eggs', 7) >>> >>>

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Ned Batchelder
On 12/7/17 2:41 PM, Ethan Furman wrote: On 12/07/2017 11:23 AM, Ned Batchelder wrote: On 12/7/17 1:28 PM, Ethan Furman wrote: --> identity('spam', 'eggs', 7) ('spam', 'eggs', 7) I don't see why this last case should hold.  Why does the function take more than one argument?  And if it

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Peter Otten
Ethan Furman wrote: > On 12/07/2017 10:53 AM, Peter Otten wrote: >> Ethan Furman wrote: >> >>> The simple answer is No, and all the answers agree on that point. >>> >>> It does beg the question of what an identity function is, though. >>> >>> My contention is that an identity function is a

[issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server

2017-12-07 Thread STINNER Victor
STINNER Victor added the comment: The bug has been fixed in Python 2.7, 3.6 and the master branch. Thank you Nir Soffer for the bug report and the fix! -- versions: -Python 3.5, Python 3.8 ___ Python tracker

[issue32186] io.FileIO hang all threads if fstat blocks on inaccessible NFS server

2017-12-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset 830daae1c82ed33deef0086b7b6323e5be0b0cc8 by Victor Stinner (Nir Soffer) in branch '2.7': [2.7] bpo-32186: Release the GIL during fstat and lseek calls (#4651)

[issue32206] Run modules with pdb

2017-12-07 Thread Mario Corchero
Change by Mario Corchero : -- keywords: +patch pull_requests: +4654 stage: -> patch review ___ Python tracker ___

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Nathan Ernst
There is a built-in identity function in Python. The function is called 'id'. See https://docs.python.org/3/library/functions.html#id Note that this will not behave the same across different Python runtimes. e.g. CPython, IronPython or Jython all implement this differently. An example: Python

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Ethan Furman
On 12/07/2017 11:46 AM, Paul Moore wrote: On 7 December 2017 at 18:28, Ethan Furman wrote: The simple answer is No, and all the answers agree on that point. It does beg the question of what an identity function is, though. My contention is that an identity function is a

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Paul Moore
On 7 December 2017 at 18:28, Ethan Furman wrote: > The simple answer is No, and all the answers agree on that point. > > It does beg the question of what an identity function is, though. > > My contention is that an identity function is a do-nothing function that > simply

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Ethan Furman
On 12/07/2017 11:23 AM, Ned Batchelder wrote: On 12/7/17 1:28 PM, Ethan Furman wrote: --> identity('spam', 'eggs', 7) ('spam', 'eggs', 7) I don't see why this last case should hold. Why does the function take more than one argument? And if it does, then why doesn't it work like this?

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Chris Angelico
On Fri, Dec 8, 2017 at 6:29 AM, Lele Gaifax wrote: > Chris Angelico writes: > >> On Fri, Dec 8, 2017 at 5:53 AM, Peter Otten <__pete...@web.de> wrote: >>> >>> Hm, what does -- and what should -- >>> >>> identity(('spam', 'eggs', 7)) >>> >>> produce? >> >>

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Lele Gaifax
Chris Angelico writes: > On Fri, Dec 8, 2017 at 5:53 AM, Peter Otten <__pete...@web.de> wrote: >> >> Hm, what does -- and what should -- >> >> identity(('spam', 'eggs', 7)) >> >> produce? > > The same thing. And so should identity((('spam', 'eggs', 7))) and >

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Ned Batchelder
On 12/7/17 1:28 PM, Ethan Furman wrote: The simple answer is No, and all the answers agree on that point. It does beg the question of what an identity function is, though. My contention is that an identity function is a do-nothing function that simply returns what it was given: -->

Re: SystemError: error return without exception set

2017-12-07 Thread Lele Gaifax
Chris Angelico writes: > On Fri, Dec 8, 2017 at 5:28 AM, MRAB wrote: >> It's probably that the code is assuming that call somewhere to the Python >> API is returning a reference, but sometimes it isn't. >> >> _All_ such return values should be

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Ethan Furman
On 12/07/2017 10:53 AM, Peter Otten wrote: Ethan Furman wrote: The simple answer is No, and all the answers agree on that point. It does beg the question of what an identity function is, though. My contention is that an identity function is a do-nothing function that simply returns what it

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Chris Angelico
On Fri, Dec 8, 2017 at 5:53 AM, Peter Otten <__pete...@web.de> wrote: > Ethan Furman wrote: > >> The simple answer is No, and all the answers agree on that point. >> >> It does beg the question of what an identity function is, though. >> >> My contention is that an identity function is a

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Peter Otten
Ethan Furman wrote: > The simple answer is No, and all the answers agree on that point. > > It does beg the question of what an identity function is, though. > > My contention is that an identity function is a do-nothing function that > simply returns what it was given: > > --> identity(1) > 1

Re: Python installer hangs in Windows 7

2017-12-07 Thread rudplatt
On Monday, December 4, 2017 at 3:44:48 PM UTC-5, christian...@gmail.com wrote: > Same with me, except that I tried to install Python 3.6.3. Unchecking > "Install launcher for all users" helped, however. I'm having the same issue. I need Python to be available for all users. Has anyone found a

[issue32208] Improve semaphore documentation

2017-12-07 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset a04ca12e12b522850e7e9244c250754d3cd36f0a by Andrew Svetlov (Miss Islington (bot)) in branch '3.6': bpo-32208: update threading.Semaphore docs and add unit test (GH-4709) (#4750)

Re: Python script

2017-12-07 Thread breamoreboy
On Thursday, December 7, 2017 at 2:06:46 PM UTC, prvn...@gmail.com wrote: > Hi All, > I am new to python need help to write a script in python > my requirement is :- > write a python script to print sentence from a txt file to another txt file > > Regards, > Praveen Read this

Re: SystemError: error return without exception set

2017-12-07 Thread Chris Angelico
On Fri, Dec 8, 2017 at 5:28 AM, MRAB wrote: > On 2017-12-07 17:22, Chris Angelico wrote: >> >> On Fri, Dec 8, 2017 at 2:36 AM, Natalie Leung >> wrote: >>> >>> I am trying to use Python to communicate and send commands in MSC Marc. A >>> part

Re: SystemError: error return without exception set

2017-12-07 Thread MRAB
On 2017-12-07 17:22, Chris Angelico wrote: On Fri, Dec 8, 2017 at 2:36 AM, Natalie Leung wrote: I am trying to use Python to communicate and send commands in MSC Marc. A part of the code looks something like this: from py_mentat import* directory = '[specified the

Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Ethan Furman
The simple answer is No, and all the answers agree on that point. It does beg the question of what an identity function is, though. My contention is that an identity function is a do-nothing function that simply returns what it was given: --> identity(1) 1 --> identity('spam') 'spam' -->

[issue32208] Improve semaphore documentation

2017-12-07 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset a0374dd34aa25f0895195d388b5ceff43b121b00 by Andrew Svetlov (Garrett Berg) in branch 'master': bpo-32208: update threading.Semaphore docs and add unit test (#4709)

[issue32208] Improve semaphore documentation

2017-12-07 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4653 ___ Python tracker ___

Announcing importlib_resources 0.1

2017-12-07 Thread Barry Warsaw
Brett and I have been working on a little skunkworks project for a few weeks, and it’s now time to announce the first release. We’re calling it importlib_resources and its intent is to replace the “Basic Resource Access” APIs of pkg_resources with more efficient implementations based directly

Re: ANN: psutil 5.4.2 released

2017-12-07 Thread André Schneider
Unsubscribe Giampaolo Rodola' schrieb am Do., 7. Dez. 2017, 13:16: > Hello all, > I'm glad to announce the release of psutil 5.4.2: > https://github.com/giampaolo/psutil > > About > = > > psutil (process and system utilities) is a cross-platform library for > retrieving

[issue32237] test_xml_etree leaked [1, 1, 1] references, sum=3

2017-12-07 Thread Neil Schemenauer
Change by Neil Schemenauer : -- keywords: +patch pull_requests: +4652 stage: -> patch review ___ Python tracker ___

Re: SystemError: error return without exception set

2017-12-07 Thread Chris Angelico
On Fri, Dec 8, 2017 at 2:36 AM, Natalie Leung wrote: > I am trying to use Python to communicate and send commands in MSC Marc. A > part of the code looks something like this: > > from py_mentat import* > > directory = '[specified the file path to my model]' > marcModel

[issue30862] parent logger should also check the level

2017-12-07 Thread Vinay Sajip
Vinay Sajip added the comment: basicConfig() provides default behaviour for simple cases. If you don't like the defaults it provides, you can choose your own configuration code to do exactly what you want. -- ___ Python

[issue32199] uuid.getnode() should return the MAC address on Android

2017-12-07 Thread Xavier de Gaye
Xavier de Gaye added the comment: Thanks Serhiy and Barry for your comments and reviews :-) -- ___ Python tracker ___

[issue26414] os.defpath too permissive

2017-12-07 Thread Jakub Wilk
Jakub Wilk added the comment: Linux man page for execvp(3) says: > The default search path (used when the environment does not contain > the variable PATH) shows some variation across systems. It generally > includes /bin

Re: SystemError: error return without exception set

2017-12-07 Thread Thomas Nyberg
On 12/07/2017 05:15 PM, Natalie Leung wrote: > Hi Thomas, > > You are correct in that the software and its packages are close-sourced. I > have emailed the provider but their technical support staff has stated that > they have exhausted of all ideas. > > An interesting thing to note is that

[issue32199] uuid.getnode() should return the MAC address on Android

2017-12-07 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: LGTM, and thanks! -- ___ Python tracker ___ ___

Re: SystemError: error return without exception set

2017-12-07 Thread MRAB
On 2017-12-07 15:36, Natalie Leung wrote: I am trying to use Python to communicate and send commands in MSC Marc. A part of the code looks something like this: from py_mentat import* directory = '[specified the file path to my model]' marcModel = '[name of my model]' py_echo(0) openModel =

Re: SystemError: error return without exception set

2017-12-07 Thread Natalie Leung
On Thursday, December 7, 2017 at 11:00:37 AM UTC-5, Thomas Nyberg wrote: > On 12/07/2017 04:36 PM, Natalie Leung wrote: > > The code stops at "py_send(openModel)" with an error message that reads: > > Traceback (most recent call last): File "[my file path]", line 11, in > > py_send(openModel) >

[issue13420] newer() function in dep_util.py discard changes in the same second

2017-12-07 Thread Jakub Wilk
Jakub Wilk added the comment: I don't remember why I needed it. Sorry! -- ___ Python tracker ___

[issue32246] test_regrtest alters the execution environment on Android

2017-12-07 Thread Xavier de Gaye
Xavier de Gaye added the comment: > The command 'adb logcat' reports a crash ("Fatal signal 11 (SIGSEGV)") during > the execution of the command. This sounds familiar :-) See issue #32138 and #26934. -- ___ Python tracker

Re: SystemError: error return without exception set

2017-12-07 Thread Thomas Nyberg
On 12/07/2017 04:36 PM, Natalie Leung wrote: > The code stops at "py_send(openModel)" with an error message that reads: > Traceback (most recent call last): File "[my file path]", line 11, in > py_send(openModel) > SystemError: error return without exception set > > I tried running the code on

[issue32246] test_regrtest alters the execution environment on Android

2017-12-07 Thread Xavier de Gaye
New submission from Xavier de Gaye : Sorry, this is a bit involved :-( BTW all the tests except this one pass (ctypes is disabled on x86_64 and arm64) on Android API 24 for x86, x86_64, armv7 and arm64 :-) Description: --- There are two different cases: 1) When

Re: SystemError: error return without exception set

2017-12-07 Thread Larry Martell
On Thu, Dec 7, 2017 at 10:36 AM, Natalie Leung wrote: > I am trying to use Python to communicate and send commands in MSC Marc. A > part of the code looks something like this: > > from py_mentat import* > > directory = '[specified the file path to my model]' >

[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.

2017-12-07 Thread Petr Viktorin
Change by Petr Viktorin : -- nosy: +Dormouse759, encukou ___ Python tracker ___ ___

SystemError: error return without exception set

2017-12-07 Thread Natalie Leung
I am trying to use Python to communicate and send commands in MSC Marc. A part of the code looks something like this: from py_mentat import* directory = '[specified the file path to my model]' marcModel = '[name of my model]' py_echo(0) openModel = '*new_model yes *open_model "'+ directory +

[issue32245] OSError: raw write() returned invalid length on latest Win 10 Consoles

2017-12-07 Thread Simon Depiets
New submission from Simon Depiets : A couple of users have been having issues on console output since the Fall 2017 Creator Update on Windows 10 An OSError is triggered randomly when rewriting data on the console (typically with progress bars, for instance when you install

[issue32244] Multiprocessing: multiprocessing.connection.Listener.accept() should accept a timeout

2017-12-07 Thread Tom Cook
Tom Cook added the comment: The same goes for `Connection.recv()`, as in the sample code another case where the thread will never terminate is when a `Client` is connected to the socket but never sends any messages; in this case, the call to `recv()` will block forever.

Re: Python homework

2017-12-07 Thread Rhodri James
On 07/12/17 13:19, Mario R. Osorio wrote: On Tuesday, December 5, 2017 at 8:33:52 PM UTC-5, nick martinez wrote: I have a question on my homework. [snip] Just my 2 cents: Sigh. Please don't do people's homework for them. It doesn't teach them anything. Now Nick had got 90% of the

[issue32244] Multiprocessing: multiprocessing.connection.Listener.accept() should accept a timeout

2017-12-07 Thread Tom Cook
New submission from Tom Cook : If nothing connects to it, `multiprocessing.connection.Listener.accept()` will block forever with no good way to interrupt it. Supposing that a thread implements a loop like this: def run(self): l = Listener(socket_path,

[issue32243] Tests that set aggressive switch interval hang in Cygwin on a VM

2017-12-07 Thread Erik Bray
New submission from Erik Bray : This is basically the same as #26939, but rather than Android running in an emulator it is affecting Cygwin running in a slow VM (in this case it's on my university's OpenStack infrastructure--I don't know what hypervisor they're using

[issue32242] loop in loop with with 'zip'ped object misbehaves in py3.6

2017-12-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: I decided to run the code in 3.5 and 2.7, and now that I know what I'm looking for, I can see the results buried in the Anaconda notebook. This is not a bug, zip has been changed in Python 3 to return an iterator instead of a

[issue32242] loop in loop with with 'zip'ped object misbehaves in py3.6

2017-12-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In Python 2 zip() returns a list. In Python 3 it returns an iterator (like itertools.izip() in Python 2). This is an intentional change. For restoring the Python 2 behavior you should wrap the result of zip() into list(): z =

[issue32242] loop in loop with with 'zip'ped object misbehaves in py3.6

2017-12-07 Thread Ronald Oussoren
Ronald Oussoren added the comment: If the nested loop is the issue the Python 3 version behaves as expected. A difference between python2 and python3 is that the zip() builtin returns a list on python2 and an iterator on python3. This explains the difference in

[issue32242] loop in loop with with 'zip'ped object misbehaves in py3.6

2017-12-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm sorry, I have no idea how to read an Anaconda notebook file. In the browser it looks like some sort of nested dictionary. I can find the code: j = [1, 2, 3, 4] k = [5, 6, 7, 8] z = zip(j, k) for x, y in z: for m, n in z:

Re: Python script

2017-12-07 Thread Joel Goldstick
On Thu, Dec 7, 2017 at 9:06 AM, wrote: > Hi All, > I am new to python need help to write a script in python > my requirement is :- > write a python script to print sentence from a txt file to another txt file > > Regards, > Praveen > -- >

Re: Python script

2017-12-07 Thread Christian Gollwitzer
Am 07.12.17 um 15:06 schrieb prvn.m...@gmail.com: Hi All, I am new to python need help to write a script in python my requirement is :- write a python script to print sentence from a txt file to another txt file txt = open("another.txt", "w") print("sentence from txt file", file = txt)

[issue32242] loop in loop with with 'zip'ped object misbehaves in py3.6

2017-12-07 Thread Vishu Viswanathan
New submission from Vishu Viswanathan : The file shows the results by running in Py3.6 and 2.7 In my opinion Py2.7 results matches what I expected. In this bug or the zip function behaviour is changed with some purpose -- files: py3.6_vs_py2.7.ipynb messages:

Python script

2017-12-07 Thread prvn . mora
Hi All, I am new to python need help to write a script in python my requirement is :- write a python script to print sentence from a txt file to another txt file Regards, Praveen -- https://mail.python.org/mailman/listinfo/python-list

[issue32241] Add the const qualifier for char and wchar_t pointers to unmodifiable strings

2017-12-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4651 stage: -> patch review ___ Python tracker ___

[issue32241] Add the const qualifier for char and wchar_t pointers to unmodifiable strings

2017-12-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Py_SetProgramName() and Py_SetPythonHome() take a pointer to a string that shouldn't be changed for the duration of the program's execution. But the type of their arguments is "wchar_t *", therefore passing just a pointer to a

Re: Python homework

2017-12-07 Thread Mario R. Osorio
On Tuesday, December 5, 2017 at 8:33:52 PM UTC-5, nick martinez wrote: > I have a question on my homework. My homework is to write a program in which > the computer simulates the rolling of a die 50 > times and then prints > (i). the most frequent side of the die > (ii). the average die value

Re: Python homework

2017-12-07 Thread edmondo . giovannozzi
Il giorno mercoledì 6 dicembre 2017 02:33:52 UTC+1, nick martinez ha scritto: > I have a question on my homework. My homework is to write a program in which > the computer simulates the rolling of a die 50 > times and then prints > (i). the most frequent side of the die > (ii). the average die

[issue32199] uuid.getnode() should return the MAC address on Android

2017-12-07 Thread Xavier de Gaye
Change by Xavier de Gaye : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32199] uuid.getnode() should return the MAC address on Android

2017-12-07 Thread Xavier de Gaye
Xavier de Gaye added the comment: New changeset 03031fbc7d44106d652756462db34eae67de9568 by xdegaye (Miss Islington (bot)) in branch '3.6': bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link list' (GH-4696) (#4747)

[issue32235] [2.7 regression] test_xml_etree test_xml_etree_c failures with 2.7 and 3.6 branches 20171205

2017-12-07 Thread Matthias Klose
Matthias Klose added the comment: ok, I can confirm that the failures go away with an updated version. Then trying to find documentation about required external dependencies... None. While we have pointers to optimize the build, we don't have anything about requirements

[issue32235] test_xml_etree test_xml_etree_c failures with 2.7 and 3.6 branches 20171205

2017-12-07 Thread Matthias Klose
Change by Matthias Klose : -- title: [2.7 regression] test_xml_etree test_xml_etree_c failures with 2.7 and 3.6 branches 20171205 -> test_xml_etree test_xml_etree_c failures with 2.7 and 3.6 branches 20171205 ___ Python tracker

[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This change is inspired by reviewing one PR in which an input array of PyObject* was modified inplace. Even if it was correct in that particular case, it looked unsafe (actually that code was wrong for other causes). Adding

[issue32240] Add the const qualifier for PyObject* array arguments

2017-12-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't like "PyConstObjectArray" or any other name. I will just obfuscate the C code. "PyObject * const *args" should be clear for every C programmer, but if I see "PyConstObjectArray" I need to search the definition of it in

ANN: psutil 5.4.2 released

2017-12-07 Thread Giampaolo Rodola'
Hello all, I'm glad to announce the release of psutil 5.4.2: https://github.com/giampaolo/psutil About = psutil (process and system utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network) in Python. It is

[issue32199] uuid.getnode() should return the MAC address on Android

2017-12-07 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4650 ___ Python tracker ___

  1   2   >