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

2016-02-22 Thread Chris Angelico
On Tue, Feb 23, 2016 at 6:22 AM, Jon Ribbens wrote: >> Maybe, if everyone's cooperating. I'm not sure how they fare in the >> face of malice though. > > Suppose you had code like this: > > filename = binascii.hexlify(os.urandom(16)).decode("ascii") > > Do we really

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

2016-02-22 Thread Marko Rauhamaa
Paul Rubin : >>> http://www.2uo.de/myths-about-urandom/ >> Did you post the link because you agreed with the Web pamphlet? > > I don't know what web pamphlet you mean, The only one linked above. Cryptography is tricky business, indeed. I know enough about it not to

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

2016-02-22 Thread Paul Rubin
Chris Angelico writes: >> I was under the impression that the point of UUIDs is that you can be >> *so* confident that there won't be a collision that for all practical >> purposes it's indistinguishable from being certain. > Maybe, if everyone's cooperating. I'm not sure how

[issue26377] Tkinter dialogs will not close if root window not packed.

2016-02-22 Thread Sam Yeager
Sam Yeager added the comment: Updated script with the adding 'parent-Rootwin' to messagebox() arguments. The issue persists. Following advice in #26376: Ran script on Terminal. The issue disappears, and everything works normally. Running through IDLE, the issue returns. --

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

2016-02-22 Thread Jon Ribbens
On 2016-02-22, Chris Angelico wrote: > On Tue, Feb 23, 2016 at 5:39 AM, Jon Ribbens > wrote: >> On 2016-02-22, Chris Angelico wrote: >>> On Tue, Feb 23, 2016 at 5:17 AM, Jon Ribbens >>> wrote:

[issue26376] Tkinter root window won't close if packed.

2016-02-22 Thread Sam Yeager
Sam Yeager added the comment: Ran script on Terminal. The issue disappears, and everything works normally. Running through IDLE, the issue returns. Sorry, Terry. -- ___ Python tracker

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

2016-02-22 Thread Marko Rauhamaa
Jon Ribbens : > Suppose you had code like this: > > filename = binascii.hexlify(os.urandom(16)).decode("ascii") > > Do we really think that is insecure or that there are any practical > attacks against it? It would be basically the same as saying that > urandom()

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

2016-02-22 Thread Random832
On Mon, Feb 22, 2016, at 14:32, Marko Rauhamaa wrote: > urandom() is not quite random and so should not be considered > cryptographically airtight. > > Under Linux, /dev/random is the way to go when strong security is > needed. Note that /dev/random is a scarce resource on ordinary systems.

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

2016-02-22 Thread Marko Rauhamaa
Random832 : > On Mon, Feb 22, 2016, at 14:32, Marko Rauhamaa wrote: >> urandom() is not quite random and so should not be considered >> cryptographically airtight. >> >> Under Linux, /dev/random is the way to go when strong security is >> needed. Note that /dev/random is

[issue26403] Catch FileNotFoundError in socketserver.DatagramRequestHandler

2016-02-22 Thread desbma
Changes by desbma : -- title: Don't call sendto in socketserver.DatagramRequestHandler if there is nothing to send -> Catch FileNotFoundError in socketserver.DatagramRequestHandler ___ Python tracker

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

2016-02-22 Thread Chris Angelico
On Tue, Feb 23, 2016 at 5:39 AM, Jon Ribbens wrote: > On 2016-02-22, Chris Angelico wrote: >> On Tue, Feb 23, 2016 at 5:17 AM, Jon Ribbens >> wrote: >>> Weell, I have a lot of sympathy for that point, but on the

[issue26403] Don't call sendto in socketserver.DatagramRequestHandler if there is nothing to send

2016-02-22 Thread desbma
desbma added the comment: OK, so first part of this issue (sendto called even if no data has been written) is indeed a duplicate of https://bugs.python.org/issue1767511 sorry for that. For the second part of the issue (the exception not silenced), I have attached a new patch. --

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

2016-02-22 Thread Marko Rauhamaa
Jon Ribbens : > I was under the impression that the point of UUIDs is that you can be > *so* confident that there won't be a collision that for all practical > purposes it's indistinguishable from being certain. Yes, if you generate a random 128-bit number, it will

Re: 0x80070570-The file or directory is corrupted and unreadable

2016-02-22 Thread felipe . gomez . rojas
El martes, 22 de diciembre de 2015, 13:46:01 (UTC-3), eryk sun escribió: > On Tue, Dec 22, 2015 at 8:02 AM, muizz hasan wrote: > > Hi there! I've been recently trying to install Python for Windows 10 > > and I've been encountering some issues. Every time i try to install >

[issue1767511] SocketServer.DatagramRequestHandler with empty response

2016-02-22 Thread desbma
Changes by desbma : -- nosy: +desbma ___ Python tracker ___ ___ Python-bugs-list

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

2016-02-22 Thread Paul Rubin
Marko Rauhamaa writes: >> http://www.2uo.de/myths-about-urandom/ > Did you post the link because you agreed with the Web pamphlet? I don't know what web pamphlet you mean, but the right thing to use now is getrandom(2). The random/urandom interface was poorly designed and

Re: PyPDF2 merge / out of memory

2016-02-22 Thread cpoline95
Le dimanche 21 février 2016 11:42:33 UTC+1, cpol...@gmail.com a écrit : > Hello, > > There is an issue with PyPDF2 and merging file > https://github.com/mstamy2/PyPDF2/issues/189 > > Does anybody know an alternate library to merge PDF and produce optimized pdf > file ? > > Thanks a lot > >

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-22 Thread Steven D'Aprano
On Mon, 22 Feb 2016 08:52 am, Jussi Piitulainen wrote: > BartC writes: >> IIRC, the first programming exercise I ever did (in 1976 using Algol >> 60) involved reading 3 numbers from the teletype and working out if >> those could form sides of a triangle. > > That was a lousy user interface even

[issue26261] NamedTemporaryFile documentation is vague about the `name` attribute

2016-02-22 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

Re: can try expect have if else.

2016-02-22 Thread Steven D'Aprano
On Mon, 22 Feb 2016 03:12 am, Ganesh Pal wrote: > Hi Team, > > Iam on python 2.6 , need input on the below piece of code. > > > EXIT_STATUS_ERROR=1 > > def create_dataset(): > """ > """ > logging.info("Dataset create.Started !!!") > try: > if

[issue26268] Update python.org installers to use OpenSSL 1.0.2f

2016-02-22 Thread Zachary Ware
Zachary Ware added the comment: OpenSSL seems to have FUBARed their release process, such that the include/ directory no longer includes anything. As such I had to update prepare_ssl.py to handle creating include directories for 32 and 64 bit. This is somewhat wasteful since the only thing

[issue26392] socketserver.BaseServer.close_server should stop serve_forever

2016-02-22 Thread Martin Panter
Martin Panter added the comment: I suggest to reject this. Checking a flag before using a shared file descriptor is a recipe for a race condition, and in this case, unspecified behaviour: (applies to select and poll). --

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-22 Thread Jussi Piitulainen
Steven D'Aprano writes: > On Mon, 22 Feb 2016 08:52 am, Jussi Piitulainen wrote: > >> BartC writes: > >>> IIRC, the first programming exercise I ever did (in 1976 using Algol >>> 60) involved reading 3 numbers from the teletype and working out if >>> those could form sides of a triangle. >> >>

[issue26268] Update python.org installers to use OpenSSL 1.0.2f

2016-02-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3be29e684ccf by Zachary Ware in branch '2.7': Issue #26268: Update Windows builds to use OpenSSL 1.0.2f https://hg.python.org/cpython/rev/3be29e684ccf New changeset e1187d3204e9 by Zachary Ware in branch '3.5': Issue #26268: Update the

[issue26404] socketserver context manager

2016-02-22 Thread Martin Panter
Martin Panter added the comment: I would support this change, as long as we aren’t supporting using server_close() to stop the server loop at the same time. It might be worth updating other example code that uses server_close(), in particular in the xmlrpc.server documentation. --

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-22 Thread Steven D'Aprano
On Mon, 22 Feb 2016 12:16 am, BartC wrote: [...] >> No need for anyone to re-invent the >> wheel! ;-) > > I keep seeing this in the thread. Python has all this capability, yet it > still requires a lot of fiddly code to be added to get anywhere near as > simple as this: > >read f, a, b, c

avoid for loop calling Generator function

2016-02-22 Thread Arshpreet Singh
Hi, I am converting PDF into text file, I am using following code. from pypdf2 import PdfFileReader def read_pdf(pdfFileName): pdf = PdfFileReader(pdfFileName) yield from (pg.extractText() for pg in pdf.pages) for i in read_pdf('book.pdf'): print(i) I want to avoid for

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-02-22 Thread Antti Haapala
Antti Haapala added the comment: I believe `urlparse` should throw a `TypeError` if not isinstance(url, (str, bytes)) -- ___ Python tracker ___

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-22 Thread Chris Angelico
On Mon, Feb 22, 2016 at 11:51 PM, BartC wrote: > Yes, I mentioned that point. In the OP's language, the variables can be > declared as a particular type; in Python they could perhaps be 'declared' by > first assigning with 0, 0.0 or "" for example. But that would need reference >

Re: avoid for loop calling Generator function

2016-02-22 Thread Peter Otten
Arshpreet Singh wrote: > Hi, I am converting PDF into text file, I am using following code. > > from pypdf2 import PdfFileReader > > def read_pdf(pdfFileName): > > pdf = PdfFileReader(pdfFileName) > > yield from (pg.extractText() for pg in pdf.pages) > > for i in

[issue26408] pep-8 requires few corrections

2016-02-22 Thread thefourtheye
New submission from thefourtheye: 1. It doesn't have the Reference 4 used anywhere in the doc. 2. The `if` condition is not properly ended in the Programming Recommendation section. 3. Apart from that few grammatical changes are necessary I believe. -- assignee: docs@python

[issue26409] Support latest Tcl/Tk on future versions of Mac installer

2016-02-22 Thread Aivar Annamaa
New submission from Aivar Annamaa: Currently Mac installer can create only Tk 8.5 compatible Tkinter, even if Tcl/Tk 8.6 is installed. Unofficial distributions doesn't seem to have problems with Tk 8.6 on Mac. I think official installer should be upgraded as well. Best option for users would

[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-22 Thread Catalin Gabriel Manciu
Catalin Gabriel Manciu added the comment: I've just posted the results to an OpenStack Swift benchmark run using the patch from my proposition, issue #26382. Victor's patch, applied to CPython 2.7, adds an extra 1% compared to mine (which improved throughput by 1%), effectively doubling the

[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-22 Thread Catalin Gabriel Manciu
Catalin Gabriel Manciu added the comment: Hi all, Please find below the results from a complete GUPB run on a patched CPython 3.6. In average, an improvement of about 2.1% can be observed. I'm also attaching an implementation of the patch for CPython 2.7 and its benchmark results. On GUPB

[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-22 Thread STINNER Victor
STINNER Victor added the comment: > Compared to my proposition in issue #26382, this patch yields slightly better > results for CPython 3.6, gaining an average of +0.36% on GUPB, and similar results for CPython 2.7. IMHO this change is too young to be backported to Python 2.7. I wrote it for

[issue26408] pep-8 requires a few corrections

2016-02-22 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- assignee: docs@python -> barry ___ Python tracker ___ ___

[issue26408] pep-8 requires a few corrections

2016-02-22 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Thanks! I like some of the changes, and may tweak a few others. Thanks for the contribution. -- ___ Python tracker

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-22 Thread Random832
On Mon, Feb 22, 2016, at 05:46, Steven D'Aprano wrote: > Jussi, I think you have an inflated expectation of what was available in > 1976. Command line? What's that? Programs ran in batch mode, > and 'interactive' meant that you could easily slip out one punched card, > replace it with a different

EuroPython 2016: Early bird ticket sales

2016-02-22 Thread M.-A. Lemburg
After the Call for Proposals for EuroPython 2016 last week, we are now calling out to everyone interested in signing up as EuroPython attendee early. You will be able to benefit from reduced ticket prices for a short period of time. Our early bird ticket sales are limited to 300 tickets. Regular

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-22 Thread BartC
On 22/02/2016 11:16, Steven D'Aprano wrote: On Mon, 22 Feb 2016 12:16 am, BartC wrote: [...] No need for anyone to re-invent the wheel! ;-) I keep seeing this in the thread. Python has all this capability, yet it still requires a lot of fiddly code to be added to get anywhere near as simple

[issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux

2016-02-22 Thread Tamás Bence Gedai
Tamás Bence Gedai added the comment: Updated the patch to remove the code duplication, now it stores the values that are calculated in the setUpClass method. It was a good and simple idea, I should have come up with it... :) I'm pretty sure I got the errors during configuration because of the

Re: Setting up/authenticating Google API?

2016-02-22 Thread Arshpreet Singh
On Sunday, 21 February 2016 21:21:54 UTC+5:30, Skip Montanaro wrote: > This isn't strictly a Python question, however... Once I get myself > authenticated, I intend to use the Python Google API to pump archived > mail messages from a few defunct mailing lists into Google Groups. I > thought it

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-22 Thread BartC
On 22/02/2016 08:50, Jussi Piitulainen wrote: BartC writes: Reading stuff from an interactive console or terminal, is such an important part of the history of computing, still being used now, that you'd think a language would provide simple, ready-to-use methods ways to do it. I think it

[issue26407] csv.writer.writerows masks exceptions from __iter__

2016-02-22 Thread Ilja Everilä
New submission from Ilja Everilä: When passing a class implementing the dunder __iter__ that raises to csv.writer.writerows it hides the original exception and raises a TypeError instead. In the raised TypeError the __context__ and __cause__ both are None. For example: >>> class X: ... def

[issue26408] pep-8 requires a few corrections

2016-02-22 Thread thefourtheye
Changes by thefourtheye : -- title: pep-8 requires few corrections -> pep-8 requires a few corrections ___ Python tracker

[issue26382] List object memory allocator

2016-02-22 Thread Catalin Gabriel Manciu
Catalin Gabriel Manciu added the comment: Our Haswell-EP OpenStack Swift setup shows a 1% improvement in throughput rate using CPython 2.7 (5715a6d9ff12) with this patch. -- ___ Python tracker

[issue26408] pep-8 requires a few corrections

2016-02-22 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue26408] pep-8 requires a few corrections

2016-02-22 Thread Georg Brandl
Georg Brandl added the comment: I can't really comment on the grammar changes, but the rest looks good to me. This is not very smooth, in both versions: -Consistency within one module or function is most important. +Consistency within one module or function is the most important thing. -But

[issue26408] pep-8 requires a few corrections

2016-02-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 43d612fc6b12 by Barry Warsaw in branch 'default': Gramatical and other improvements given by thefourtheye. https://hg.python.org/peps/rev/43d612fc6b12 -- nosy: +python-dev resolution: -> fixed stage: -> resolved status: open -> closed

[issue26408] pep-8 requires a few corrections

2016-02-22 Thread Georg Brandl
Georg Brandl added the comment: -Consistency within one module or function is most important. +Consistency within one module or function is the most important. You left out "thing" from the patch; is that intended? -- ___ Python tracker

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

2016-02-22 Thread Cameron Simpson
On 22Feb2016 10:11, Ethan Furman wrote: On 02/14/2016 04:08 PM, Ben Finney wrote: I am unconcerned with whether there is a real filesystem entry of that name; the goal entails having no filesystem activity for this. I want a valid unique filesystem path, without touching

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

2016-02-22 Thread Ben Finney
Ethan Furman writes: > On 02/14/2016 04:08 PM, Ben Finney wrote: > > > I am unconcerned with whether there is a real filesystem entry of that > > name; the goal entails having no filesystem activity for this. I want a > > valid unique filesystem path, without touching the

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

2016-02-22 Thread Ethan Furman
On 02/22/2016 02:25 PM, Cameron Simpson wrote: On 22Feb2016 10:11, Ethan Furman wrote: On 02/14/2016 04:08 PM, Ben Finney wrote: I am unconcerned with whether there is a real filesystem entry of that name; the goal entails having no filesystem activity for this. I want a

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

2016-02-22 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: If no one is planning to propose specific new markup for more fine-grained version annotations, this issue can be closed. -- ___ Python tracker

[issue26415] Out of memory, trying to parse a 35MB dict

2016-02-22 Thread A. Skrobov
New submission from A. Skrobov: I have a one-line module that assigns a tuple->int dictionary: holo_table = {(0, 0, 0, 0, 0, 0, 1, 41, 61, 66, 89): 9, (0, 0, 0, 70, 88, 98, 103, 131, 147, 119, 93): 4, [35MB skipped], (932, 643, 499, 286, 326, 338, 279, 200, 280, 262, 115): 5} When I try to

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-22 Thread Gregory Ewing
BartC wrote: Our system must have been more advanced then, or designed for training. We used a time-sharing 'dec-system 10' and it was usually accessed via interactive terminals, either teletypes or the odd VDU. According to Wikipedia the first interactive version of Dartmouth BASIC appeared

Re: How the heck does async/await work in Python 3.5

2016-02-22 Thread Sven R. Kunze
On 20.02.2016 07:53, Christian Gollwitzer wrote: If you have difficulties wit hthe overall concept, and if you are open to discussions in another language, take a look at this video: https://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-39-await-co-routines MS has added coroutine

[issue26414] os.defpath too permissive

2016-02-22 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker ___ ___

[issue26396] Create json.JSONType

2016-02-22 Thread Anish Shah
Changes by Anish Shah : -- nosy: +anish.shah ___ Python tracker ___ ___

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-02-22 Thread Anish Shah
Changes by Anish Shah : -- nosy: +anish.shah ___ Python tracker ___ ___

[issue26281] Clear sys.path_importer_cache from importlib.invalidate_caches()

2016-02-22 Thread Anish Shah
Anish Shah added the comment: Hi Brett, I'm looking for some issues to solve. Is this issue confirmed? Can I work on this? -- ___ Python tracker ___

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-22 Thread BartC
On 22/02/2016 10:46, Steven D'Aprano wrote: On Mon, 22 Feb 2016 08:52 am, Jussi Piitulainen wrote: BartC writes: IIRC, the first programming exercise I ever did (in 1976 using Algol 60) involved reading 3 numbers from the teletype and working out if those could form sides of a triangle.

[issue26408] pep-8 requires a few corrections

2016-02-22 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Feb 22, 2016, at 02:20 PM, Georg Brandl wrote: >Georg Brandl added the comment: > >-Consistency within one module or function is most important. >+Consistency within one module or function is the most important. > >You left out "thing" from the patch; is

[issue26412] Segmentation Fault: 11

2016-02-22 Thread Payden Comer
New submission from Payden Comer: A "Segmentation Fault:11" crash occurs on OS X El Captain when using `return pysodium.sodium.crypto_box_beforenm(clientpub, serverprivatekey)`, with args as None, serverprivatekey, rather than a traceback dissallowing a NoneType Argument. Crash Log attached.

[issue26410] "incompatible pointer type" while compiling Python3.5.1

2016-02-22 Thread Devyn Johnson
New submission from Devyn Johnson: When compiling Python3.5.1 on Ubuntu 15.10 (64-bit), I see three "incompatible pointer type" warnings (copy-pasted below). I understand that they can be ignored. However, from my experience with programming (in C STD-2011), "weird bugs" and other odd

Re: avoid for loop calling Generator function

2016-02-22 Thread Chris Angelico
On Tue, Feb 23, 2016 at 2:38 AM, Arshpreet Singh wrote: >> next(filter(print, read_pdf("book.pdf")), None) > > Why we are w=using filter here? It's a beautiful hack. It'll filter according to the "print" predicate, which always returns None, and will thus filter everything

Re: avoid for loop calling Generator function

2016-02-22 Thread Ian Kelly
On Mon, Feb 22, 2016 at 8:38 AM, Arshpreet Singh wrote: > On Monday, 22 February 2016 19:05:24 UTC+5:30, Peter Otten wrote: >> or the slightly less convoluted >> >> sys.stdout.writelines(map("{}\n".format, read_pdf("book.pdf"))) > > Actually I am using this function in Android

[issue26411] Suggestion concerning compile-time warnings

2016-02-22 Thread Devyn Johnson
New submission from Devyn Johnson: I understand that compile-time warnings can typically be ignored. However, from my experience with programming (C STD-2011, for instance), "weird bugs", non-easily-replicable bugs, and odd behaviors disappear when warnings like this are fixed. I also

[issue25080] The example-code for making XML-RPC requests through proxy, fail!

2016-02-22 Thread Berker Peksag
Berker Peksag added the comment: This has been fixed in cf842a8ccb77. Thank you for reporting this, Kostis! -- nosy: +berker.peksag resolution: -> out of date stage: needs patch -> resolved status: open -> closed versions: -Python 3.4 ___ Python

[issue26395] asyncio does not support yielding from recvfrom (socket/udp)

2016-02-22 Thread Simon Bernier St-Pierre
Changes by Simon Bernier St-Pierre : -- status: open -> closed ___ Python tracker ___

[issue26410] "incompatible pointer type" while compiling Python3.5.1

2016-02-22 Thread STINNER Victor
STINNER Victor added the comment: This issue is a duplicate of the issue #26161, waybe we can backport the changeset ff68ffcc6244 to the Python 3.5 branch. -- nosy: +haypo ___ Python tracker

[issue26416] Deprecate the regex_v8, telco, and spectral_norm benchmarks

2016-02-22 Thread Brett Cannon
Changes by Brett Cannon : -- keywords: +easy ___ Python tracker ___ ___ Python-bugs-list

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

2016-02-22 Thread Oscar Benjamin
On 22 Feb 2016 22:50, "Ben Finney" wrote: > > Ethan Furman writes: > > > On 02/14/2016 04:08 PM, 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-22 Thread Jon Ribbens
On 2016-02-22, Steven D'Aprano wrote: > On Tue, 23 Feb 2016 05:48 am, Marko Rauhamaa wrote: >> Jon Ribbens : >>> I was under the impression that the point of UUIDs is that you can be >>> *so* confident that there won't be a collision that for all

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

2016-02-22 Thread Jon Ribbens
On 2016-02-23, Steven D'Aprano wrote: > On Tue, 23 Feb 2016 06:22 am, Jon Ribbens wrote: >> Suppose you had code like this: >> >> filename = binascii.hexlify(os.urandom(16)).decode("ascii") >> >> Do we really think that is insecure or that there are any practical >> attacks

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

2016-02-22 Thread Chris Angelico
On Tue, Feb 23, 2016 at 11:26 AM, Jon Ribbens wrote: > On 2016-02-23, Chris Angelico wrote: >> On Tue, Feb 23, 2016 at 11:08 AM, Jon Ribbens >> wrote: If you generate 2**128 + 1 such numbers, you are *guaranteed*

[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-02-22 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch, Jakub. I don't use mmap module much so I don't have an opinion about the feature, but it sounds reasonable. I left some review comments on Rietveld: http://bugs.python.org/review/26335/ -- components: +Extension Modules -IO,

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

2016-02-22 Thread Steven D'Aprano
On Tue, 23 Feb 2016 06:32 am, Marko Rauhamaa wrote: > Jon Ribbens : > >> Suppose you had code like this: >> >> filename = binascii.hexlify(os.urandom(16)).decode("ascii") >> >> Do we really think that is insecure or that there are any practical >> attacks against

Re: How the heck does async/await work in Python 3.5

2016-02-22 Thread Ian Kelly
On Mon, Feb 22, 2016 at 3:16 PM, Sven R. Kunze wrote: > Is something like shown in 12:50 ( cout << tcp_reader(1000).get() ) possible > with asyncio? (tcp_reader would be async def) loop = asyncio.get_event_loop() print(loop.run_until_complete(tcp_reader(1000))) --

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

2016-02-22 Thread Paul Rubin
Marko Rauhamaa writes: http://www.2uo.de/myths-about-urandom/ >> I don't know what web pamphlet you mean, > The only one linked above. Oh, I wouldn't have called that a pamphlet. I could quibble with the writing style but the points in the article are basically correct.

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

2016-02-22 Thread Steven D'Aprano
On Tue, 23 Feb 2016 05:48 am, Marko Rauhamaa wrote: > Jon Ribbens : > >> I was under the impression that the point of UUIDs is that you can be >> *so* confident that there won't be a collision that for all practical >> purposes it's indistinguishable from being

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

2016-02-22 Thread Steven D'Aprano
On Tue, 23 Feb 2016 06:22 am, Jon Ribbens wrote: > Suppose you had code like this: > > filename = binascii.hexlify(os.urandom(16)).decode("ascii") > > Do we really think that is insecure or that there are any practical > attacks against it? It would be basically the same as saying that >

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

2016-02-22 Thread Ben Finney
Oscar Benjamin writes: > What does unpredictable mean in this context? Maybe I'm reading too > much into that... I think you may be, yes. The request in this thread requires making direct use of the “generate a new valid temporary fielsystem path” functionality

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

2016-02-22 Thread Jon Ribbens
On 2016-02-23, Chris Angelico wrote: > On Tue, Feb 23, 2016 at 11:26 AM, Jon Ribbens > wrote: >> On 2016-02-23, Chris Angelico wrote: >>> On Tue, Feb 23, 2016 at 11:08 AM, Jon Ribbens >>> wrote: >

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

2016-02-22 Thread Chris Angelico
On Tue, Feb 23, 2016 at 11:44 AM, Jon Ribbens wrote: > On 2016-02-23, Chris Angelico wrote: >> On Tue, Feb 23, 2016 at 11:26 AM, Jon Ribbens >> wrote: >>> On 2016-02-23, Chris Angelico wrote: On

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

2016-02-22 Thread Jon Ribbens
On 2016-02-23, Ben Finney wrote: > Oscar Benjamin writes: >> What does unpredictable mean in this context? Maybe I'm reading too >> much into that... > > I think you may be, yes. The request in this thread requires making > direct use of

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

2016-02-22 Thread Steven D'Aprano
On Tue, 23 Feb 2016 06:22 am, Paul Rubin wrote: > Chris Angelico writes: >>> I was under the impression that the point of UUIDs is that you can be >>> *so* confident that there won't be a collision that for all practical >>> purposes it's indistinguishable from being certain.

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

2016-02-22 Thread Chris Angelico
On Tue, Feb 23, 2016 at 11:08 AM, Jon Ribbens wrote: > On 2016-02-22, Steven D'Aprano wrote: >> On Tue, 23 Feb 2016 05:48 am, Marko Rauhamaa wrote: >>> Jon Ribbens : I was under the impression that the point of

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

2016-02-22 Thread Steven D'Aprano
On Tue, 23 Feb 2016 05:17 am, Jon Ribbens wrote: > On 2016-02-22, Ethan Furman wrote: >> On 02/14/2016 04:08 PM, Ben Finney wrote: >>> I am unconcerned with whether there is a real filesystem entry of that >>> name; the goal entails having no filesystem activity for this. I

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

2016-02-22 Thread Jon Ribbens
On 2016-02-23, Chris Angelico wrote: > On Tue, Feb 23, 2016 at 11:08 AM, Jon Ribbens > wrote: >>> If you generate 2**128 + 1 such numbers, you are *guaranteed* to >> >> ... have expired due to the heat death of the universe. > > Maybe... but by the

[issue26413] python 3.5.1 uses wrong registry in system-wide installation

2016-02-22 Thread Mike
New submission from Mike: The installer for python 3.5.1 (observed with the x64-86 executable installer, assumed to happen with all installers) allows users to install python either just for themselves or do a system-wide installation (provided they have sufficient privileges). However, when

[issue26388] Disabling changing sys.argv[0] with runpy.run_module(...alter_sys=True)

2016-02-22 Thread Mike Kaplinskiy
Mike Kaplinskiy added the comment: Looks like by signed CLA just made it through, so that should be settled. For the other bugs, it seems that overloading run_module & run_path seems to be getting a bit cumbersome, so it might make sense to have some sort of Runner object that has things like

[issue26413] python 3.5.1 uses wrong registry in system-wide installation

2016-02-22 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Windows AllUsers installation places uninstaller in user profile ___ Python tracker

[issue26414] os.defpath too permissive

2016-02-22 Thread John Beck
New submission from John Beck: A bug has been filed against Solaris' internal version of Python, which is largely the same (including in this case) as the base version we get from python.org. The bug is that os.defpath starts with ':' and thus any Python script run with a null PATH environment

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

2016-02-22 Thread Cameron Simpson
On 22Feb2016 12:34, Alan Bawden wrote: Cameron Simpson writes: On 16Feb2016 19:24, Alan Bawden wrote: So in the FIFO case, I might write something like the following: def make_temp_fifo(mode=0o600): while True:

[issue26416] Deprecate the regex_v8, telco, and spectral_norm benchmarks

2016-02-22 Thread Brett Cannon
New submission from Brett Cannon: In the thread at https://mail.python.org/pipermail/speed/2016-February/000272.html it came up that the regex_v8, telco, and spectral_norm benchmarks are all very inconsistent. That means they should be deprecated. -- components: Benchmarks messages:

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

2016-02-22 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: For anyone following along only via the tracker, it's worth noting that proposals for new markup are welcome on the docs mailing list. More information is available at: https://mail.python.org/mailman/listinfo/docs --

[issue26417] Default IDLE 2.7.11 configuration files are out-of-sync on OS X framework installs

2016-02-22 Thread Ned Deily
New submission from Ned Deily: On OS X framework installs, the Mac-specific sub-makefiles do some important tailoring of IDLE/s config-extensions.def and config-main.def files, among other things changing Tk some Tk events for more appropriate keyboard bindings (e.g. "

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

2016-02-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fred, thanks for chiming in. Let's do close this one. -- nosy: +rhettinger resolution: -> not a bug status: open -> closed ___ Python tracker

[issue26323] Add assert_called() and assert_called_once() methods for mock objects

2016-02-22 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> michael.foord ___ Python tracker ___

  1   2   >