[issue23718] strptime() can produce invalid date with negative year day

2016-02-15 Thread Tamás Bence Gedai
Tamás Bence Gedai added the comment: Actually there are already test cases, but they test for the wrong behaviour. The very same example is tested there, but the test gives the expected result, so tm_yday = -3. My implementation returns 362, which looks more reasonable. So currently with my

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy
Mathieu Dupuy added the comment: (OK, I said a stupidity: datetime's strptime handle microseconds. But time's one doesn't) -- ___ Python tracker ___

[issue20169] random module doc page has broken links

2016-02-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +georg.brandl priority: low -> normal versions: +Python 3.6 -Python 3.4 ___ Python tracker

Re: repr( open('/etc/motd', 'rt').read() )

2016-02-15 Thread Steven D'Aprano
On Tuesday 16 February 2016 00:05, Veek. M wrote: > When I do at the interpreter prompt, > repr( open('/etc/motd', 'rt').read() ) Opening and reading MOTD is a needless distraction from your actual question. This demonstrates the issue most simply: # at the interactive interpreter py> s =

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Ben Finney
Cameron Simpson writes: > I've been watching this for a few days, and am struggling to > understand your use case. Yes, you're not alone. This surprises me, which is why I'm persisting. > Can you elaborate with a concrete example and its purpose which would > work with a

[issue26362] Approved API for creating a temporary file path

2016-02-15 Thread Ben Finney
Ben Finney added the comment: An example:: import io import tempfile names = tempfile._get_candidate_names() def test_frobnicates_configured_spungfile(): """ ‘foo’ should frobnicate the configured spungfile. """ fake_file_path =

Re: asyncio - run coroutine in the background

2016-02-15 Thread Chris Angelico
On Mon, Feb 15, 2016 at 6:39 PM, Paul Rubin wrote: > "Frank Millman" writes: >> The benefit of my class is that it enables me to take the coroutine >> and run it in another thread, without having to re-engineer the whole >> thing. > > Threads in

Project Xnod is created

2016-02-15 Thread wij
I am happy to announce that project Xnod is created. https://sourceforge.net/projects/systemnode/ Xnod tries to develop a more uniform language or scaffolding, or kind of program deployment to reduce efforts for nearly every programming tasks. Xnod is currently based on Xarg, and has to be a

[issue26309] socketserver.BaseServer._handle_request_noblock() doesn't shutdown request if verify_request is False

2016-02-15 Thread Martin Panter
Martin Panter added the comment: Yes this patch looks pretty good, thanks -- title: socketserver.BaseServer._handle_request_noblock() don't shutdwon request if verify_request is False -> socketserver.BaseServer._handle_request_noblock() doesn't shutdown request if verify_request is

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy
Mathieu Dupuy added the comment: simpler version using a simpler, stricter regex -- Added file: http://bugs.python.org/file41934/simplerfromisoformat.patch ___ Python tracker

Re: [STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

2016-02-15 Thread John Ladasky
On Monday, February 15, 2016 at 6:02:24 PM UTC-8, Rick Johnson wrote: > On Friday, February 12, 2016 at 1:51:35 AM UTC-6, John Ladasky wrote: > > Reguarding a migration from Python2 to Pyhton3, John said: > > I had to wait until my favorite packages were ported > > (numpy, scipy, matplotlib,

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Ben Finney
"Mario R. Osorio" writes: > I would create a RAM disk > (http://www.cyberciti.biz/faq/howto-create-linux-ram-disk-filesystem/), > generate all the path/files I want with any, or my own algorithm, run > the tests, unmount it, destroy it, be happy ... Whats wrong with >

[issue26362] Approved API for creating a temporary file path

2016-02-15 Thread Ben Finney
Ben Finney added the comment: It has been pointed out that `tempfile.mktemp` does in fact access the filesystem, to query whether the entry exists. So this request would be best met by exposing a simple “get a new return value from the `tempfile._RandomNameSequence` instance” function.

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Mario R. Osorio
I would create a RAM disk (http://www.cyberciti.biz/faq/howto-create-linux-ram-disk-filesystem/), generate all the path/files I want with any, or my own algorithm, run the tests, unmount it, destroy it, be happy ... Whats wrong with that?? AFAIK, RAM disks do not get logged, and even if they

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy
Mathieu Dupuy added the comment: Oh my god you're right. Thanks there is the re.ASCII flag. 2016-02-16 15:07 GMT+10:30 Martin Panter : > > Martin Panter added the comment: > > The regular expression r"\d" matches any digit in Unicode I think, not > just ASCII digits

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Martin Panter
Martin Panter added the comment: The regular expression r"\d" matches any digit in Unicode I think, not just ASCII digits 0-9. Perhaps we should limit it to ASCII digits. Or is it intended to allow non-ASCII digits like in "२०१६-०२-१६ ०१:२१:१४"? --

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy
Mathieu Dupuy added the comment: The real question is : should we accept whatever iso8601 format is common to be found on the internet, or just be able to consume back the string issued by isoformat. From that results the answers to the questions you're asking: don't accept single digits,

[issue20169] random module doc page has broken links

2016-02-15 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___

Re: Changing sound volume

2016-02-15 Thread Rick Johnson
On Monday, February 15, 2016 at 4:58:04 AM UTC-6, izik43 wrote: > i had had to play some wav files and the volume was very > poor. i used "audacity" and used amplify effect to change > the basic amplitude. Yes, you can achieve a more powerful punch that way, but it's not the same as what the OP

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Martin Panter
Martin Panter added the comment: It looks to me like you copied a lot of code, doc strings, tests, etc from and . I wouldn’t call it trivial. There is a BSD

[issue22062] Fix pathlib.Path.(r)glob doc glitches.

2016-02-15 Thread Mike Short
Changes by Mike Short : Added file: http://bugs.python.org/file41933/pathlib.py.patch ___ Python tracker ___

[issue22062] Fix pathlib.Path.(r)glob doc glitches.

2016-02-15 Thread Mike Short
Changes by Mike Short : -- keywords: +patch Added file: http://bugs.python.org/file41932/pathlib.patch ___ Python tracker ___

Re: [STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

2016-02-15 Thread Chris Angelico
On Tue, Feb 16, 2016 at 1:02 PM, Rick Johnson wrote: >> But once that happened, I moved from Py2 to Py3 years ago >> with scarcely a bump, bruise, or scratch. > > So you have no Python2.x code remaining in your repos? Are > you telling us that you moved *EVERYTHING*

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Rick Johnson
On Sunday, February 14, 2016 at 10:55:11 PM UTC-6, Steven D'Aprano wrote: > If you want to guarantee that these faux pathnames can't > leak out of your test suite and touch the file system, > prepend an ASCII NUL to them. That will make it an illegal > path on all file systems that I'm aware of.

[issue26368] grammatical error in asyncio stream documentation

2016-02-15 Thread Ned Deily
Ned Deily added the comment: Thanks for the report, Ryan! -- nosy: +ned.deily resolution: -> fixed stage: -> resolved status: open -> closed title: grammatical error in documentation -> grammatical error in asyncio stream documentation versions: -Python 3.4

[issue26368] grammatical error in documentation

2016-02-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8ee91cb2e2a4 by Ned Deily in branch '3.5': Issue #26368: fix typo in asynchio stream doc, reported by Ryan Stuart. https://hg.python.org/cpython/rev/8ee91cb2e2a4 New changeset 12502327d2c0 by Ned Deily in branch 'default': Issue #26368: fix typo in

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Nobody
On Mon, 15 Feb 2016 15:28:27 +1100, Ben Finney wrote: > The behaviour is already implemented in the standard library. What I'm > looking for is a way to use it (not re-implement it) that is public API > and isn't scolded by the library documentation. So, basically you want (essentially) the

Re: [STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

2016-02-15 Thread Rick Johnson
On Friday, February 12, 2016 at 1:51:35 AM UTC-6, John Ladasky wrote: Reguarding a migration from Python2 to Pyhton3, John said: > I had to wait until my favorite packages were ported > (numpy, scipy, matplotlib, pandas). WxPython is not ported either, much to my chagrin. > But once that

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Ben Finney
Roel Schroeven writes: > Use uuid.uuid1()? That has potential. A little counter-intuitive, for use in documentation about testing filesystem paths; but not frightening or dubious to the conscientious reader. I'll see whether that meets this use case, thank you. The bug

[issue26368] grammatical error in documentation

2016-02-15 Thread Ryan Stuart
New submission from Ryan Stuart: The note for 18.5.5.1. Stream functions is missing a word. It should read "Note The top-level functions in this module are meant **as** convenience wrappers only; there’s really nothing special there, and if they don’t do exactly what you want, feel free to

[issue26367] importlib.__import__ does not fail for invalid relative import

2016-02-15 Thread Manuel Jacob
New submission from Manuel Jacob: Python 3.6.0a0 (default:6c6f7dff597b, Feb 16 2016, 01:24:51) [GCC 5.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import importlib >>> importlib.__import__('array', globals(), locals(), level=1) >>>

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Thomas 'PointedEars' Lahn
Gregory Ewing wrote: > Ben Finney wrote: >> One valid filesystem path each time it's accessed. That is, behaviour >> equivalent to ‘tempfile.mktemp’. >> >> My question is because the standard library clearly has this useful >> functionality implemented, but simultaneously warns strongly against

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Cameron Simpson
On 15Feb2016 12:19, Ben Finney wrote: Dan Sommers writes: On Mon, 15 Feb 2016 11:08:52 +1100, Ben Finney wrote: > I am unconcerned with whether there is a real filesystem entry of > that name; the goal entails having no filesystem activity

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy
Mathieu Dupuy added the comment: > I suggest to parse directly the string with C code, since the format looks > quite simple (numbers and a few separators). But some of them are optional. And I would really like to mimic the same implementation logic in C. Now I think the python version is

[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-02-15 Thread Mathieu Dupuy
Mathieu Dupuy added the comment: I was looking at this issue, and actually the problem is on a different level. The function the patch takes place is "send_errror". As its name suggests, it's only used to send error (I checked in the code : it's only used to send 4XX/5XX reply). I'm sure none

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Roel Schroeven
Ben Finney schreef op 2016-02-14 22:46: How should a program generate a unique filesystem path and *not* create the filesystem entry? > ... What standard library function should I be using to generate ‘tempfile.mktemp’-like unique paths, and *not* ever create a real file by that path? Use

[issue20169] random module doc page has broken links

2016-02-15 Thread Ori Avtalion
Changes by Ori Avtalion : -- nosy: +salty-horse ___ Python tracker ___ ___

[issue26354] re.I does not work as expected

2016-02-15 Thread Magesh Kumar
Magesh Kumar added the comment: Thanks Matthew. :-) -- ___ Python tracker ___ ___ Python-bugs-list mailing

Re: Syntax error (The Python Book) Linux User and Developer Bookazine

2016-02-15 Thread Larry Hudson via Python-list
On 02/15/2016 07:06 AM, Joel Goldstick wrote: [snip a lot...] Learn Python the Hard Way is pretty good some people say. Its online. Also Diving into Python is online written by the now offline Mark Pilgrim. I have a couple of "Hard Way" books and personally, I don't like his style of

[issue26359] CPython build options for out-of-the box performance

2016-02-15 Thread SilentGhost
Changes by SilentGhost : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list

[issue26354] re.I does not work as expected

2016-02-15 Thread Matthew Barnett
Matthew Barnett added the comment: The 3rd argument is the count (the maximum number of replacements, although 0 means no limit, not no replacements). You're passing in the flag re.I instead. re.I happens to have the numeric value 2, so you're telling it to do no more than 2 replacements.

[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-15 Thread Martin Panter
Martin Panter added the comment: If you changed existing versionadded notices to versionchanged in similar cases, how would the size of the patch compare? This problem was also recently brought up at . My

[issue26224] Add "version added" for documentation of asyncio.timeout for documentation of python 3.4, 3.5, 3.6

2016-02-15 Thread Martin Panter
Changes by Martin Panter : -- stage: -> patch review ___ Python tracker ___ ___

[issue14597] Cannot unload dll in ctypes until script exits

2016-02-15 Thread Mark Mikofski
Mark Mikofski added the comment: I think I have this issue even after interpreter exits. My setup.py creates a .dll then later loads the dll for testing using ctypes. Subsequent runs of setup.py that would force rebuilding the .dll attempt to delete the old dll first if it exists, but I get

Re: repr( open('/etc/motd', 'rt').read() )

2016-02-15 Thread Terry Reedy
On 2/15/2016 8:05 AM, Veek. M wrote: When I do at the interpreter prompt, repr( open('/etc/motd', 'rt').read() ) i get # 1 #: When posting questions here or at Stackoverflow or elsewhere, it is a really good idea to develop and post a 'minimal, complete, verifiable example' that

[issue26354] re.I does not work as expected

2016-02-15 Thread Magesh Kumar
Magesh Kumar added the comment: Corrected Message : If we compare the first example () and the example, I am using re.I as the third element. But for the example, still I am able to get the substitution happening correctly. Could you pls, let me know the reason of change in behaviour.

[issue26354] re.I does not work as expected

2016-02-15 Thread Magesh Kumar
Magesh Kumar added the comment: :-) Thanks a lot Matthew for the inputs. If we compare the first example () and the example, I am using re.I as the third element. But for the example, still I am not to get the substitution happening correctly. Could you pls, let me know the reason of

[issue26354] re.I does not work as expected

2016-02-15 Thread Matthew Barnett
Matthew Barnett added the comment: The pattern '\', which is the same as '', matches the string '', and that is replaced with ''. -- ___ Python tracker

[issue26354] re.I does not work as expected

2016-02-15 Thread Magesh Kumar
Magesh Kumar added the comment: Thanks for the inputs, It would be of great help, if someone could help me in explaining the below output : >>> a 'ype="str">falseDefaultMulticastClient>> b = re.sub('\', '', a, re.I)

[issue26357] asyncio.wait loses coroutine return value

2016-02-15 Thread Yury Selivanov
Yury Selivanov added the comment: TBH I never ever needed to do membership tests on (done, failed) result of asyncio.wait. If you need to do such tests - just wrap your coroutines into tasks manually. I honestly don't understand what's the problem and why we need to change anything in

[issue21145] Add the @cached_property decorator

2016-02-15 Thread STINNER Victor
STINNER Victor added the comment: "Most implementations these days support TTL because they require it." I used this pattern a lot in my old Hachoir project, but I never needed the TTL thing. In my case, data come from the disk and are never invalidated. Example with the description property:

[issue26357] asyncio.wait loses coroutine return value

2016-02-15 Thread André Caron
André Caron added the comment: Hi Guido, Thanks for the quick reply :-) AFAICT, there seem to be three possible directions regarding this issue -- for both wait() and as_completed(): 1) remove the need for ensure_future(): make the membership test succeed and allow multiple await

[issue21145] Add the @cached_property decorator

2016-02-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm sure many people don't need a TTL on a cached property. Please stop arguing about that. -- ___ Python tracker ___

[issue21145] Add the @cached_property decorator

2016-02-15 Thread Omer Katz
Omer Katz added the comment: In that case, most of the users won't use the standard library @cached_property anyway since they require it. On Mon, Feb 15, 2016, 19:51 Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > > The TTL idea is completely outlandish

[issue21145] Add the @cached_property decorator

2016-02-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: The TTL idea is completely outlandish in a general-purpose library. Let's keep things simple and not try to build a kitchen-sink decorator. -- ___ Python tracker

[issue21145] Add the @cached_property decorator

2016-02-15 Thread Omer Katz
Omer Katz added the comment: Most implementations these days support TTL because they require it. The whole point is to remove the need to reimplement such basic functionality over and over. ‫בתאריך יום ב׳, 15 בפבר׳ 2016 ב-18:33 מאת ‪STINNER Victor‬‏ <‪ rep...@bugs.python.org‬‏>:‬ > > STINNER

Re: What is heating the memory here? hashlib?

2016-02-15 Thread Paulo da Silva
Às 08:12 de 15-02-2016, Johannes Bauer escreveu: > On 15.02.2016 03:21, Paulo da Silva wrote: > >> So far I tried the program twice and it ran perfectly. > > I think you measured your RAM consumption wrong. > > Linux uses all free RAM as HDD cache. That's what is used in "buffers". > That is,

[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-15 Thread Georg Brandl
Georg Brandl added the comment: The devguide should be updated, yes. And probably someone should look at the remaining versionadded's... -- ___ Python tracker

[ANN] bzr 2.7.0 released

2016-02-15 Thread Richard Wilbur
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Bazaar team and community, I'm happy to announce availability of a new release of the bzr adaptive version control system. Bazaar is a Canonical project and part of the GNU project to

[issue21145] Add the @cached_property decorator

2016-02-15 Thread STINNER Victor
STINNER Victor added the comment: I like the idea of an helper to build a property on-demand, but I dislike the TTL idea, it seems too specific. If you need TTL, implement your own decorator, or use a regular property and implement your own logic there. --

Re: Unable to insert data into MongoDB.

2016-02-15 Thread Peter Otten
Arjun Srivatsa wrote: > Hi Peter. > > Thank you for the reply. > > This is the read_server code: > > import socket > from pymongo import MongoClient > #import datetime > import sys > > # Connection to server (PLC) on port 27017 > host = "10.52.124.135" > port = 27017 > > s =

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread STINNER Victor
STINNER Victor added the comment: > No regex available at all in CPython? It's not really convenient to use the re module in C. > Otherwise, yeah, if I have to, I can do it with strptime. I suggest to parse directly the string with C code, since the format looks quite simple (numbers and a

[issue26309] socketserver.BaseServer._handle_request_noblock() don't shutdwon request if verify_request is False

2016-02-15 Thread Aviv Palivoda
Aviv Palivoda added the comment: I changed the test to just check that shutdown_request is called. Hope this is more clear then the previous test. -- Added file: http://bugs.python.org/file41930/socketserver-shutdown-if-verify-false4.patch ___

[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-15 Thread Ezio Melotti
Ezio Melotti added the comment: I agree with Georg. I also went to double-check what the devguide says, and at https://docs.python.org/devguide/documenting.html#paragraph-level-markup it shows an example of versionadded for a parameter. If a versionchanged should be used instead, maybe the

[issue26364] pip uses colour in messages that does not work on white terminals

2016-02-15 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report, but this needs to be reported to the pip issue tracker: https://github.com/pypa/pip/issues For the record, I found a similar report at https://github.com/pypa/pip/issues/2449 -- nosy: +berker.peksag resolution: -> third party

[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-15 Thread Georg Brandl
Georg Brandl added the comment: Hi Tony, thanks for the patch, and for the will to contribute. I'm not sure this patch should be merged though; the original intention was to use "versionadded" where the API item is completely new. So "The parameter x was added" in a function is using

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Grant Edwards
On 2016-02-15, Ben Finney wrote: > Dan Sommers writes: > >> On Mon, 15 Feb 2016 11:08:52 +1100, Ben Finney wrote: >> >> > I am unconcerned with whether there is a real filesystem entry of >> > that name; the goal entails having no filesystem

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Grant Edwards
On 2016-02-14, Ben Finney wrote: > Howdy all, > > How should a program generate a unique filesystem path and *not* create > the filesystem entry? Short answer: you can't because it's the filesystem entry operation that is atomic and guarantees uniqueness. > [..] >

[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-15 Thread Tony R.
New submission from Tony R.: In the documentation, I noticed several uses of ``.. versionchanged::`` that described things which had been added. I love Python, and its documentation, and I wanted to contribute. So, I figured a low-risk contribution would be to change ``..

Re: Syntax error (The Python Book) Linux User and Developer Bookazine

2016-02-15 Thread Geoff Munn
On Monday, 15 February 2016 15:07:03 UTC, Joel Goldstick wrote: > On Mon, Feb 15, 2016 at 9:56 AM, Geoff Munn wrote: > > > On Sunday, 14 February 2016 13:39:52 UTC, Geoff Munn wrote: > > > Hi, > > > > > > Noob at the Python thing so here goes, > > > > > > I have copied a

Re: Unable to insert data into MongoDB.

2016-02-15 Thread Arjun Srivatsa
Okay, I added with open('yourfile','w') as f: f.write(data) to the read_server code in which the Actual data is stored in a file on my desktop. Then, it must be possible to read this file in the Write_db script to insert the data. On Monday, February 15, 2016 at 4:00:37 PM UTC+1, Arjun

Re: Syntax error (The Python Book) Linux User and Developer Bookazine

2016-02-15 Thread Joel Goldstick
On Mon, Feb 15, 2016 at 9:56 AM, Geoff Munn wrote: > On Sunday, 14 February 2016 13:39:52 UTC, Geoff Munn wrote: > > Hi, > > > > Noob at the Python thing so here goes, > > > > I have copied a program to demonstrate control structures in Python but > get a syntax error at

ANN: gcc-python-plugin 0.15

2016-02-15 Thread David Malcolm
gcc-python-plugin is a plugin for GCC 4.6 onwards which embeds the CPython interpreter within GCC, allowing you to write new compiler warnings in Python, generate code visualizations, etc. It ships with "gcc-with-cpychecker", which implements static analysis passes for GCC aimed at finding bugs

Re: Unable to insert data into MongoDB.

2016-02-15 Thread Arjun Srivatsa
Hi Peter. Thank you for the reply. This is the read_server code: import socket from pymongo import MongoClient #import datetime import sys # Connection to server (PLC) on port 27017 host = "10.52.124.135" port = 27017 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host,

Re: Syntax error (The Python Book) Linux User and Developer Bookazine

2016-02-15 Thread Geoff Munn
On Sunday, 14 February 2016 13:39:52 UTC, Geoff Munn wrote: > Hi, > > Noob at the Python thing so here goes, > > I have copied a program to demonstrate control structures in Python but get a > syntax error at line 31, isint = False. I'm using Python 2.7.6 and Linux Mint > based around

Re: repr( open('/etc/motd', 'rt').read() )

2016-02-15 Thread Random832
On Mon, Feb 15, 2016, at 08:05, Veek. M wrote: > What is happening with # 1 # (repr)? > repr calls __repr__ which gives you bytes.. why does this result in \\n When you call a function that returns a string directly in the interpreter prompt (i.e. without print), it passes the result to repr,

Re: There has to be a better way to split this string!

2016-02-15 Thread Emile van Sebille
On 2/9/2016 10:50 PM, Cameron Simpson wrote: On 10Feb2016 07:34, srinivas devaki wrote: PS: trying to read mailing list when you are half woke, is a bad idea and trying reply to it is even bad idea. Regrettably, when one is half awake one is unable to realise

[issue21145] Add the @cached_property decorator

2016-02-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be. If somebody provide a patch. -- ___ Python tracker ___ ___

[issue26365] ntpath.py Error in Windows

2016-02-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The first argument of os.path.join() (as well as all other) in Python 2.7 must be str or unicode. You pass a tuple. -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed

[issue26365] ntpath.py Error in Windows

2016-02-15 Thread Ben Kummer
New submission from Ben Kummer: ntpath.py throws an error in Python2.7.11 Windows Code snippet: product_dir ="/zope/eggs43" my_tuple= os.path.split(product_dir)[:-1] roduct_prefix = os.path.join(my_tuple ) The same code works in python 2.7.11 under Linux Traceback:

repr( open('/etc/motd', 'rt').read() )

2016-02-15 Thread Veek. M
When I do at the interpreter prompt, repr( open('/etc/motd', 'rt').read() ) i get # 1 #: "'\\nThe programs included with the Debian GNU/Linux system are free software;\\nthe exact distribution terms for each program are described in the\\nindividual files in

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy
Mathieu Dupuy added the comment: > Hum, you should use the same rounding method than datetime.datetime.fromtimestamp(): ROUND_HALF_UP, as round(). In practice, you can for example pass a floating point number as microseconds to datetime.datetime constructor. Unfortunately, you're mistaking with

Re: Unable to insert data into MongoDB.

2016-02-15 Thread Peter Otten
Arjun Srivatsa wrote: > I changed the port number from 27017 to 5 in the code segment: Instead of throwing arbitrary changes at your script in the hope that one works I recommend that you write two independent scripts, from scratch: (1) write_to_db.py: Write made-up data into the MongoDB

[issue21145] Add the @cached_property decorator

2016-02-15 Thread Omer Katz
Omer Katz added the comment: Can we make this happen for 3.6? -- versions: +Python 3.6 -Python 3.5 ___ Python tracker ___

Re: asyncio - run coroutine in the background

2016-02-15 Thread Marko Rauhamaa
Paul Rubin : > Threads in Python don't get you parallelism either, of course. Ah, of course. Processes it is, then. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Changing sound volume

2016-02-15 Thread izik43
i had had to play some wav files and the volume was very poor. i used "audacity" and used amplify effect to change the basic amplitude. -- https://mail.python.org/mailman/listinfo/python-list

[issue26364] pip uses colour in messages that does not work on white terminals

2016-02-15 Thread Barry Scott
New submission from Barry Scott: pip3 (3.5 on Mac OS X) is outputting a message in yellow that I can barely see on a white background terminal. "You are using pip version 7.1.2, however version 8.0.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command." I

Re: Unable to insert data into MongoDB.

2016-02-15 Thread Arjun Srivatsa
I changed the port number from 27017 to 5 in the code segment: IP = "127.0.0.1" PORT = 27017 BUFFER_SIZE = 1024 client = MongoClient('127.0.0.1', 27017) And my output on Python shell is: hello world! Connection address: ('127.0.0.1', 16951) Connection address:

[issue26363] __builtins__ propagation is misleading described in exec and eval documentation

2016-02-15 Thread Julien
Changes by Julien : -- nosy: +sizeof ___ Python tracker ___ ___ Python-bugs-list mailing

[issue26363] __builtins__ propagation is misleading described in exec and eval documentation

2016-02-15 Thread Xavier Combelle
New submission from Xavier Combelle: According to my experiment in code, the current behavior of python3.5 is different that the document says. If I understand well the purpose of this behavior is to propagate the __builtins__ global constant if globals has not one. In

[issue26039] More flexibility in zipfile interface

2016-02-15 Thread Thomas Kluyver
Thomas Kluyver added the comment: Hi Serhiy, any more comments on the zf.open() patch? -- ___ Python tracker ___

[issue26363] builtins propagation is misleading described in exec and eval documentation

2016-02-15 Thread Xavier Combelle
Changes by Xavier Combelle : -- assignee: docs@python components: Documentation nosy: docs@python, xcombelle priority: normal severity: normal status: open title: builtins propagation is misleading described in exec and eval documentation

Re: ftplib throws: IndexError: tuple index out of range

2016-02-15 Thread Peter Otten
Antoon Pardon wrote: >> PS: How did you produce the overview over the local variables? That looks >> nice. > I started from this recipe: > http://code.activestate.com/recipes/52215-get-more-information-from-tracebacks/ > made it more to my liking and turned it into a module. So that instead of >

Re: ftplib throws: IndexError: tuple index out of range

2016-02-15 Thread Peter Otten
Antoon Pardon wrote: >> It looks like the actual error is socket.timeout which is probably raised >> from somewhere inside the stdlib without args. > > I think I know what is going on. I have my own timeout mechanism at work > here, that works with signals and alarm. When the SIGALRM fires I

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread STINNER Victor
STINNER Victor added the comment: > How does it parse this date: > 2016-02-15T11:59:46.16588638674+09:00 Mathieu Dupuy added the comment: > discarding the microseconds digits after the 6th. Hum, you should use the same rounding method than datetime.datetime.fromtimestamp(): ROUND_HALF_UP, as

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2016-02-15 Thread Michel Desmoulin
Michel Desmoulin added the comment: We fixed our bug days ago, but I would have expected [*gen] to have triggered an exception before it even got to gather(). The real code was something like: >>> l = (ensure_awaitable(callable_obj) for callable_obj in callable_list) >>> gather(*l)

Re: fetchall is taking much longer time while getting data from Sybase module in Python

2016-02-15 Thread Peter Otten
reetesh nigam wrote: > Hi All, > > I am retrieving data from Sybase database using Sybase module of Python. > My query is not taking time however fecthall is taking longer time. > > Below is the test script : > > def run_query(db,query): ## Run query and resturn record result > t1 =

Re: How to properly override the default factory of defaultdict?

2016-02-15 Thread Gregory Ewing
Herman wrote: I want to pass in the key to the default_factory of defaultdict and I found that defaultdict somehow can intercept my call to dict.__getitem__(self, key), What's happening here is that defaultdict doesn't actually override __getitem__ at all. Instead, it overrides __missing__,

EuroPython 2016: Sending out the first gravitational waves

2016-02-15 Thread M.-A. Lemburg
We are pleased to announce the launch of our all new EuroPython 2016 website. Over the last few weeks, we have been busy talking to sponsors and getting the website prepared for the launch. You may have heard about the recent direct observation of gravitational waves by the LIGO (Laser

Re: asyncio - run coroutine in the background

2016-02-15 Thread Frank Millman
"Paul Rubin" wrote in message news:87h9ha8lt0@jester.gateway.pace.com... "Frank Millman" writes: > The benefit of my class is that it enables me to take the coroutine > and run it in another thread, without having to re-engineer the whole > thing. Threads in Python

  1   2   >