Changes by Tim Golden :
--
nosy: +tim.golden
___
Python tracker
<http://bugs.python.org/issue5673>
___
___
Python-bugs-list mailing list
Unsubscribe:
Tim Golden added the comment:
There are at least two ways to do non-blocking file IO on Windows:
Overlapped I/O
I/O Completion ports
Don't know what's best here, but happy to see what might be achieved
if it was thought worth pursuing.
--
nosy: +
Tim Peters added the comment:
I also don't see a good reason to keep this open now - adds complication for no
quantifiable payoff.
--
___
Python tracker
<http://bugs.python.org/is
Tim Graham added the comment:
Hi, this causes a regression in Django and I'm not sure if Django or cpython is
at fault. For a simple model that uses super() rather than super(Model self) in
save():
from django.db import models
class Model(models.Model):
def save(self, *args, **k
Tim Graham added the comment:
Thanks Nick. Your suggestion does fix the issue for Django:
https://github.com/django/django/pull/7653.
--
___
Python tracker
<http://bugs.python.org/issue23
New submission from Tim Peters:
They already are.
>>> (-2)**0
1
You're probably doing this instead:
>>> -2**0
-1
Exponentiation has higher precedence than unary minus, so that last example
groups as -(2**0), and -1 is correct.
--
nosy: +tim.peters
resoluti
Tim Smith added the comment:
I spoke prematurely; I recently rediscovered that the persistence of
__PYVENV_LAUNCHER__ poisons the sys.executable of virtualenv interpreters
launched as a subprocess of another Python interpreter:
$ virtualenv -p python3 test
$ test/bin/python3 -c 'impor
Tim Smith added the comment:
Since __PYVENV_LAUNCHER__ is consulted in site.py, it seems likely that the
latest it can be deleted is in site.py. The attached patch does that.
--
Added file: http://bugs.python.org/file46004/delete-venev-launcher.diff
Tim Golden added the comment:
Do you have any Python environment variables set?
If you're not sure, try at a command prompt:
SET PY
--
___
Python tracker
<http://bugs.python.org/is
Tim Peters added the comment:
I can't judge a use case for a thread gimmick in the absence of wholly
specified examples. There are too many possible subtleties. Indeed, if I'd do
anything with Event.clear() it would be to remove it - I've seen too much code
that suffers s
Tim Golden added the comment:
Although I don't remember seeing a crash out as quick as this, common
causes for this kind of thing are to do with environment variables
pointing to still-existing or part-existing installations. Can you try:
set PY
from a command prompt, please, to see i
Tim Golden added the comment:
Since the webmaster@ address tends to bear the brunt of these, can I
make sure I understand the situation?
* The only installers affected are those for x86/32-bit Windows 3.5.3
* By default [I just checked] the launcher checkbox is not checked
* If it *is
Tim Smith added the comment:
As a Homebrew maintainer I'm happy to consider improving Homebrew's
configuration if someone can point me to an extant package that uses this
mechanism.
--
nosy: +tdsmith
___
Python tracker
<http://bu
Tim Peters added the comment:
Didn't anyone here follow the discussion about the `secrets` module? PHP was
crucified by security wonks for its horridly naive ways of initializing its
PRNGs:
https://media.blackhat.com/bh-us-12/Briefings/Argyros/BH_US_12_Argyros_PRNG_WP.pdf
Please don
Tim Peters added the comment:
Donald, it does matter. The code you found must be using some older version of
Python, because the Python 3 version of randint() uses _randbelow(), which is
an accept/reject method that consumes an _unpredictable_ number of 32-bit
Twister outputs. That utterly
Tim Peters added the comment:
Donald, your script appears to recreate the state from some hundreds of
consecutive outputs of getrandbits(64). Well, sure - but what of it? That
just requires inverting the MT's tempering permutation. You may as well note
that the state can be recreated
Tim Peters added the comment:
> Searching github pulls up a number of results of people
> calling it, but I haven't looked through them to see
> how/why they're calling it.
Sorry, I don't know what "it" refers to. Surely not to a program exposing the
output o
Tim Peters added the comment:
Ah! Yes, .getrandbits(N) outputs remain vulnerable to equation-solving in
Python 3, for any value of N. I haven't seen any code where that matters (may
be "a security hole"), but would bet some _could_ be found.
There's no claim of absolut
Tim Peters added the comment:
Raymond, while I'm in general agreement with you, note that urandom() doesn't
deliver "random" bytes to begin with. A CSPRNG is still a PRNG.
For example, if the underlying urandom() generator is ChaCha20, _it_ has "only"
512 bits
Tim Peters added the comment:
It was a primary purpose of `secrets` to be a place where security best
practices could be implemented, and changed over time, with no concern about
backward compatibility for people who don't use it.
So if `secrets` needs to supply a class with all the me
Tim Peters added the comment:
Christian, you should really be the first to vote to close this. The title of
this bug report is about whether it would be good to reduce the _number_ of
bytes Random initialization consumes from os.urandom(), not whether to stop
using os.urandom() entirely
Tim Peters added the comment:
I think it's clear Guido would say "#1". The thrust of all his comments to
date is that it was a mistake to change the semantics of os.urandom() on Linux
(and one other platform? don't really care), and that in 3.6+ only `secrets`
should _try
Tim Golden added the comment:
Re-opening at user's request on Paul Moore's advice. He's already nosy so can
comment here if needed.
It would be good to get independent verification. I'll try to install the rc
for 2.7.12 to see if I can reproduce.
--
resolution: t
Tim Golden added the comment:
James, which installer did you use (just so I can try to reproduce as
closely as possible)?
--
___
Python tracker
<http://bugs.python.org/issue27
Tim Golden added the comment:
Thanks, Paul. Adding Benjamin as 2.7 release manager. This looks like a release
blocker to me.
--
nosy: +benjamin.peterson
___
Python tracker
<http://bugs.python.org/issue27
Tim Golden added the comment:
I did wonder about that. It's good that we can reproduce the issue
without pip, but it's probably going to be messy to debug! I've got VS
2008 on this machine but no time at the moment to build & debug.
Don't know if Zach or Steve might be
Tim Golden added the comment:
I can reproduce with the download build but not with a freshly-built executable
--
___
Python tracker
<http://bugs.python.org/issue27
Tim Golden added the comment:
The crash is actually happening in Modules/_ssl.c:_get_peer_alt_names.
> _ssl.pyd!_get_peer_alt_names(x509_st * certificate) Line 810 + 0x2
bytes C
_ssl.pyd!_decode_certificate(x509_st * certificate) Line 1187 + 0x8
bytes C
_ssl.
Tim Golden added the comment:
Built 64-bit 2.7 but can't reproduce on tip, 2.7.12rc1 or 2.7.11 tags.
--
___
Python tracker
<http://bugs.python.org/is
Tim Peters added the comment:
Note that the very popular TI graphics calculators have had a distinct nth-root
function at least since the TI-83. It's a minor convenience there.
I'm +0 on adding it to Python's math module, which means not enough to do any
work ;-)
Note that if
Tim Graham added the comment:
I'll echo what Peter said and say that this breaks 5 tests in Django's test
suite which are checking error messages. If it stays, perhaps it could be added
to the release notes instead of just NEWS.
--
nosy: +
Tim Golden added the comment:
As it happens, all the code I use which calls CoInitialise[Ex] does so
with STA. But do I understand correctly that, if you implement this,
there's no way for me to select MTA? If so I would consider that a major
dra
Tim Peters added the comment:
Python's floats are emphatically not doing symbolic arithmetic - they use the
platform's binary floating point facilities, which can only represent a subset
of rationals exactly. All other values are approximated.
In particular, this shows the exact va
Tim Peters added the comment:
Note that the same is true in Python 2.
I don't want to document it, though. In `math.floor(44/4.4)`, the
subexpression `44/4.4` by itself wholly rules out that "[as if] with infinite
precision [throughout the larger expression]" may be in play.
Changes by Tim Graham :
--
nosy: +Tim.Graham
___
Python tracker
<http://bugs.python.org/issue27498>
___
___
Python-bugs-list mailing list
Unsubscribe:
Tim Peters added the comment:
Note: this started on stackoverflow:
https://stackoverflow.com/questions/38356584/python-multiprocessing-threading-code-exits-early
I may be missing something obvious, but the only explanation I could think of
for the behavior seen on Ubuntu is that the threads
Changes by Tim Peters :
--
components: +Library (Lib)
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue27508>
___
___
Python-bugs-list mai
Tim Peters added the comment:
Curious: under Python 2.7.11 on Windows, the threads also terminate early
(they run "forever" - as intended - under 3.5.2).
--
___
Python tracker
<http://bugs.python.o
Tim Peters added the comment:
Ah - good catch! I'm closing this as a duplicate of bug18966. The real
mystery now is why the threads _don't_ terminate early under Windows 3.5.2 -
heh.
--
resolution: -> duplicate
status: open -> closed
superseder: -> Threads wit
Tim Peters added the comment:
This came up again today as bug 27508. In the absence of "fixing it", we
should add docs to multiprocessing explaining the high-level consequences of
skipping "normal" exit processing (BTW, I'm unclear on why it's skipped).
I
Tim Peters added the comment:
Devin, a primary point of `threading.py` is to provide a sane alternative to
the cross-platform thread mess. None of these reports are about making it
easier for threads to go away "by magic" when the process ends. It's the
contrary: the
Tim Peters added the comment:
About ""No parents, no children", that's fine so far as it goes. But Python
isn't C, a threading.Thread is not a POSIX thread, and threading.py _does_ have
a concept of "the main thread". There's no conceptual problem _
Tim Peters added the comment:
About: "The notion of categorically refusing to let a process end perhaps
overreaches in certain situations." threading.py addressed that all along: if
the programmer _wants_ the process to exit without waiting for a particular
threading.Thread, t
Tim Peters added the comment:
FYI, I'm seeing the same kind of odd truncation Steve sees - but it goes away
if I refresh the page.
--
___
Python tracker
<http://bugs.python.org/is
Tim Peters added the comment:
If you don't show us the regular expression, it's going to be darned hard to
guess what it is ;-)
--
nosy: +tim.peters
___
Python tracker
<http://bugs.python.o
Tim Peters added the comment:
Well, some backslash escapes are processed in the "replacement" argument to
`.sub()`. If your replacement text contains a substring of the form
\g
not immediately followed by
<
that will raise the exception you're seeing. The pars
Changes by Tim Peters :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue27586>
___
___
Python-bugs-list
Tim Peters added the comment:
Hmm. I'd test that tau is exactly equal to 2*pi. All Python platforms (past,
present, and plausible future ones) have binary C doubles, so the only
difference between pi and 2*pi _should_ be in the exponent (multiplication by 2
is exact). Else we screw
New submission from Tim Graham:
Python 2.7:
>>> from email.header import Header
>>> Header(' ').encode()
''
Python 3.2+ (I didn't check older versions of Python 3):
>>> Header(' ').encode()
Traceback (most recent call last):
Tim Peters added the comment:
For those insisting that tau is somehow unnatural, just consider that the
volume of a sphere with radius r is 2*tau/3*r**3 - the formula using pi instead
is just plain impossible to remember ;-)
--
___
Python tracker
Tim Peters added the comment:
Serhiy's objection is a little subtler than that. The Python expression
`math.log(math.e)` in fact yields exactly 1.0, so IF it were the case that x**y
were implemented as
math.exp(math.log(x) * y)
THEN math.e**500 would be computed as math.exp(math.log(m
Tim Peters added the comment:
Note that "iterable" covers a world of things that may not support indexing
(let alone slicing). For example, it may be a generator, or a file open for
reading.
--
nosy: +tim.peters
___
Python trac
Changes by Tim Peters :
--
resolution: -> rejected
stage: -> resolved
___
Python tracker
<http://bugs.python.org/issue27751>
___
___
Python-bugs-list
Tim Peters added the comment:
A meta-note: one iteration of Newton's method generally, roughly speaking,
doubles the number of "good bits" in the initial approximation.
For floating n'th root, it would an astonishingly bad libm pow() that didn't
get more than half
Tim Peters added the comment:
Thanks, Mark! I had worked out the `floor_nroot` algorithm many years ago, but
missed the connection to the AM-GM inequality. As a result, instead of being
easy, proving correctness was a pain that stretched over pages. Delighted to
see how obvious it _can_ be
Tim Peters added the comment:
Noting that `floor_nroot` can be sped a lot by giving it a better starting
guess. In the context of `nroot`, the latter _could_ pass `int(x**(1/n))` as
an excellent starting guess. In the absence of any help, this version figures
that out on its own; an
Tim Peters added the comment:
Looks to me like this is what the docs are talking about when they say:
"""
As mentioned above, if a child process has put items on a queue (and it has not
used JoinableQueue.cancel_join_thread), then that process will not terminate
until all buff
Tim Peters added the comment:
Note that `Pool` grew `starmap()` and `starmap_async()` methods in Python 3.3
to (mostly) address this.
The signature difference from the old builtin `map()` remains regrettable.
Note that the `Pool` version differs from the `concurrent.futures` version of
`map
Tim Peters added the comment:
I don't care about correct rounding here, but it is, e.g., a bit embarrassing
that
>>> 64**(1/3)
3.9996
Which you may or may not see on your box, depending on your platform pow(), but
which you "should" see: 1/3 is no
Tim Peters added the comment:
Serhiy, I don't know what you're thinking there, and the code doesn't make much
sense to me. For example, consider n=2. Then m == n, so you accept the
initial `g = x**(1.0/n)` guess. But, as I said, there are cases where that
doesn't
Tim Peters added the comment:
Adding one more version of the last code, faster by cutting the number of extra
digits used, and by playing "the usual" low-level CPython speed tricks.
I don't claim it's always correctly rounded - although I haven't found a
specific c
Tim Peters added the comment:
Victor, happy to add comments, but only if there's sufficient interest in
actually using this. In the context of this issue report, it's really only
important that Mark understands it, and he already does ;-)
For example, it starts with float `**` beca
Tim Peters added the comment:
That's clever, Serhiy! Where did it come from? It's not Newton's method, but
it also appears to enjoy quadratic convergence.
As to speed, why are you asking? You should be able to time it, yes? On my
box, it's about 6 times slower than th
Tim Peters added the comment:
Steven, you certainly _can_ ;-) check first whether `r**n == x`, but can you
prove `r` is the best possible result when it's true? Offhand, I can't. I
question it because it rarely seems to _be_ true (in well less than 1% of the
random-ish test cas
Tim Peters added the comment:
As I said, the last code I posted is "fast enough" - I can't imagine a real
application can't live with being able to do "only" tens of thousands of roots
per second. A geometric mean is typically an output summary statistic,
Tim Peters added the comment:
Let's spell one of these out, to better understand why sticking to native
precision is inadequate. Here's one way to write the Newton step in "guess +
relatively_small_correction" form:
def plain(x, n):
g = x**(1.0/n)
ret
Tim Golden added the comment:
+1 This is essentially the answer to the naive user's question:
"Why would anyone *not* use daemon threads given that they're less
hassle to manage?"
--
nosy: +tim.golden
___
Python tracker
<
Tim Peters added the comment:
This is how it's supposed to work: Python's re matches at the leftmost
position possible, and _then_ matches the longest possible substring at that
position. When a regexp _can_ match 0 characters, it will match starting at
index 0. So, e.g.,
>
Tim Golden added the comment:
netrick: can you confirm that the same thing occurs when you explicitly
run your code via the pyw command. ie when you do this:
pyw myprog.pyw
Also, what happens when you run:
py myprog.pyw
ie when you use the Console launcher to launch the .pyw
Tim Golden added the comment:
I can't reproduce this running Python 3.3 on Win7. I'll try WinXP later.
I'll also add Mark Hammond & Vinay as they implemented the PEP397 loader.
--
___
Python tracker
<http://bugs
Changes by Tim Golden :
--
nosy: +mhammond, vinay.sajip
___
Python tracker
<http://bugs.python.org/issue17290>
___
___
Python-bugs-list mailing list
Unsubscribe:
Tim Golden added the comment:
Things may be a little more complicated, because one of two distinct
mechanisms may be invoked to determine what to run when double-clicking:
an Explorer-based mechanism, and a non-Explorer one.
AFAICT, the former falls back to the latter.
To check the latter, the
Tim Golden added the comment:
I can't reproduce this on XP either. I've tried various combinations of
.py / .pyw, command line, double-click, etc. and I've not had a single
problem.
Let's hope someone else can suggest something
--
__
Tim Golden added the comment:
IIRC Nick Coghlan had put a bit of work into this a few months ago as an
external module with a view to seeing if it got traction before putting
anything into the stdlib. Might be worth pinging him, or looking to see
what he'd done. Can't remember the k
Tim Golden added the comment:
OK, sorry for the noise then; I had the idea that it was doing something
with iterators/generators.
--
___
Python tracker
<http://bugs.python.org/issue11
Tim Golden added the comment:
Dave, you seem to misunderstand what's happening here: the os.chdir
function doesn't have access to the characters which are typed in
the script or in the interpreter. It receives a Python string object.
The parser etc. which constructs the string object
Tim Peters added the comment:
As I just clarified on the members list, the "Zen" is about the design of
Python-the-language. It's hard to imagine that a programming language _could_
be barbaric or rude, Perl notwithstanding ;-)
--
___
Tim Golden added the comment:
That's because IDLE uses a completely different input loop from the
console interpreter.
I'll try to get to this but I'm chock-a-block with other work at the
moment. If anyone else wants to dig, please do so. if the worst came to
the worst we co
Tim Golden added the comment:
+1
Richard - are you in a position to commit / push?
--
___
Python tracker
<http://bugs.python.org/issue17619>
___
___
Python-bug
Tim Golden added the comment:
Attached is a q&d script to produce the list of extension -> mimetype maps for
a version of the mimetypes module.
--
Added file: http://bugs.python.org/file29900/mt.py
___
Python tracker
<http://bugs.
Tim Golden added the comment:
Three outputs produced by mt.py: tip as-is; tip without registry; tip
with new approach to registry. The results for 2.7 are near-enough
identical. Likewise the results for an elevated prompt.
--
Added file: http://bugs.python.org/file29901/mt-tip.txt
Added
Tim Golden added the comment:
There seems to be a consensus that the current behaviour is undesirable,
indeed "broken" for any meaningful use.
The critical argument against the current Registry approach is that it
returns unexpected (or outright incorrect) mimetypes for ver
Tim Golden added the comment:
Essentially: no. The permissions system in Windows is very different
from that of Unix. The CRT attempts to mimic it, but for things like
read-onlyness, it does so by setting the (old-style DOS) attributes.
These are only just meaningful for files, and are
New submission from Tim Peters:
Each time thru, CWR searches for the rightmost position not containing the
maximum index. But this is wholly determined by what happened the last time
thru - search isn't really needed. Here's Python code:
def cwr2(iterable, r):
pool = tupl
Tim Peters added the comment:
Oops! Last part should read
"since the indices vector is non-decreasing, if indices[j] was n-2 then
indices[j-1] is also at most n-2"
That is, the instances of "r-2" in the original s
Tim Peters added the comment:
There's another savings to be had when an index becomes the maximum: in that
case, all the indices to its right are already at the maximum, so no need to
overwrite them. This isn't as big a savings as skipping the search, but still
buys about 10% m
Tim Peters added the comment:
Wildcard matching can easily be done in worst-case linear time, but not with
regexps. doctest.py's internal _ellipsis_match() shows one way to do it
(doctest can use "..." as a wildcard marker).
--
New submission from Tim Rawlinson:
In Python 3.3 decoding of headers to unicode is supposed to be automatic but
fails in several cases, including one shown as successful in the documentation:
>>> msg = message_from_string('Subject: =?utf-8?q?=C3=89ric?=\n\n',
policy=
Tim Smith added the comment:
I'm attaching an updated patch; it passes tests for me locally with a framework
build.
--
Added file: http://bugs.python.org/file36885/dont-realpath-venv-dirname.diff-1
___
Python tracker
<http://bugs.py
Tim Smith added the comment:
Er, because the test has been modified by taking Vinay's suggestion to test
that the directories are physically identical instead of doing a string
comparison.
--
___
Python tracker
<http://bugs.python.org/is
Tim Smith added the comment:
We would like to refer to python3 as /usr/local/opt/python3/bin/python3, where
/usr/local/opt/python3 is a symlink to ../Cellar/python3/3.4.2, and
/usr/local/Cellar/python3/3.4.2/bin/python3 is a symlink to
/usr/local/Cellar/python3/3.4.2/Frameworks
Tim Golden added the comment:
I very much doubt that this is a Python issue as such.
Other things being equal, I would expect Harddisk\DR1 to be a CD-ROM or
some other removable disk. Using something like winobj.exe from
sysinternals should show what it expects to be on a given machine. It
New submission from Tim Graham:
I noticed some failing Django tests on Python 3.2.6 the other day. The
regression is caused by this change:
https://github.com/python/cpython/commit/572d9c59a1441c6f8ffb9308824c804856020e31
Behavior before that commit (and on other version of Python even after
Tim Graham added the comment:
I wasn't sure if it was expected behavior or not. I'm attaching a file with the
list of failing tests on Django's master.
Perhaps more useful is a reference to the problematic usage in Django:
https://github.com/dja
Tim Graham added the comment:
Thank-you Georg; I believe I was able to fix some of the failures by patching
Django as you suggested.
However, I think I found another issue due to #16611 (support for
httponly/secure cookies) not being backported to Python 3.2. The issue is that
any cookies
New submission from Tim Graham:
Expected:
>>> import pickle
>>> from http.cookies import SimpleCookie
>>> pickle.loads(pickle.dumps(SimpleCookie('hi=there'),2))
# Actual
Patch is based on the suggestion from Georg Brandl in #22758 (I added the
&quo
Tim Graham added the comment:
By the way, this is my first patch for Python and I submitted a CLA 2 days ago.
--
___
Python tracker
<http://bugs.python.org/issue22
Tim Graham added the comment:
FYI, I created #22775 and submitted a patch for the issue that SimpleCookie
doesn't pickle properly with HIGHEST_PROTOCOL.
--
___
Python tracker
<http://bugs.python.org/is
Tim Graham added the comment:
Updated patch to test pickling of all protocols.
--
Added file: http://bugs.python.org/file37100/cookie-pickling-all-protocols.diff
___
Python tracker
<http://bugs.python.org/issue22
Tim Graham added the comment:
Updated patch per comments.
--
Added file:
http://bugs.python.org/file37114/cookie-pickling-all-protocols-2.diff
___
Python tracker
<http://bugs.python.org/issue22
2001 - 2100 of 2346 matches
Mail list logo