New submission from Ned Batchelder ned...@users.sourceforge.net:
Run this shell script against 3.2, and it will fail. Against 3.1, it succeeds.
I've been running tests on Ubuntu 10.10.
mkdir -p sub
cat sub/modzip.py END_PY
j = 1
END_PY
zip zipmod.zip sub/modzip.py
PYTHONPATH=zipmod.zip
Ned Batchelder ned...@users.sourceforge.net added the comment:
With help from ned_deily in #python-dev, we confirmed this is a dup of
http://bugs.python.org/issue10955, and is already fixed.
--
resolution: - duplicate
___
Python tracker rep
Ned Batchelder ned...@users.sourceforge.net added the comment:
Isn't this problem solved by the threading.settrace and threading.setprofile
functions?
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue231540
Ned Batchelder ned...@users.sourceforge.net added the comment:
This breaks virtualenv3 on Python 3.2, which simply test for the existence of
os.symlink, which then fails for lack of privileges. Perhaps an
os.can_symlink() method, returning a boolean? It can request privileges if you
like
New submission from Ned Batchelder ned...@users.sourceforge.net:
2.6.4 had been working fine for me. Today, though, it will not stay up. I run
the Django development server on Windows 7, and 2.6.4 is repeatedly crashing on
me:
This application has requested the Runtime to terminate
Ned Batchelder ned...@users.sourceforge.net added the comment:
I got it from python.org, the .msi Windows installer:
03/02/10 05:27:37p 14,890,496 \kit\python-2.6.4.msi
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Ned Batchelder ned...@users.sourceforge.net added the comment:
I tried rebooting my PC, but the problem persists.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8101
Ned Batchelder ned...@users.sourceforge.net added the comment:
Yup, you're both right!
I had a C extension (for coverage.py) built for 2.5 in the 2.6 path. Sorry for
the false alarm.
--
status: open - closed
___
Python tracker rep
New submission from Ned Batchelder [EMAIL PROTECTED]:
When tracing line execution with sys.settrace, a particular code
structure fails to report an executed line. The line is a continue
statement after an if condition in which the if condition is true every
time it is executed.
Attached
Ned Batchelder [EMAIL PROTECTED] added the comment:
I see that the cause of the problem is the peephole optimizer. That
doesn't mean this isn't a problem.
I am measuring the code coverage of a set of tests, and one of my lines
is being marked as not executed. This is not the fault
Ned Batchelder [EMAIL PROTECTED] added the comment:
I recognize that this is an unusual case, but it did come up in the real
world. I found this while measuring test coverage, and the continue
line was marked as not executed, when it was.
I don't understand when the peepholer is moved, so
Ned Batchelder [EMAIL PROTECTED] added the comment:
Raymond, do you have a cannon-less recommendation of how to kill this
particular mosquito?
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2506
Changes by Ned Batchelder [EMAIL PROTECTED]:
--
nosy: +nedbat
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2516
__
___
Python-bugs-list mailing list
Unsubscribe
Ned Batchelder [EMAIL PROTECTED] added the comment:
It's hard for me to agree with your assessment that for no practical
good would come from disabling the optimizer. Broadly speaking, there
are two types of code execution: the vast majority of the time, you
execute the code so that it can do
New submission from Ned Batchelder ned...@users.sourceforge.net:
Pyexpat.c calls the tracing function explicitly (not sure why). When it
intercepts an exception, it calls the function with PyTrace_EXCEPTION,
but then leaves the scope without calling PyTrace_RETURN. This is
incorrect
New submission from Ned Batchelder ned...@users.sourceforge.net:
If you set the environment variable DISTUTILS_DEBUG=1, distutils will
run with DEBUG, which will trace internal activity. But one of the
traces is incorrect, and leads to this stack trace:
Traceback (most recent call last
Ned Batchelder ned...@users.sourceforge.net added the comment:
Another one:
Traceback (most recent call last):
File setup.py, line 72, in module
**addl_args
File c:\python31\lib\distutils\core.py, line 149, in setup
dist.run_commands()
File c:\python31\lib\distutils\dist.py, line
Changes by Ned Batchelder ned...@users.sourceforge.net:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11846
___
___
Python-bugs
New submission from Ned Batchelder ned...@users.sourceforge.net:
The docs say:
The trace function is invoked (with event set to 'call') whenever a new
local scope is entered; it should return a reference to a local trace function
to be used that scope, or None if the scope shouldn’t
Changes by Ned Batchelder ned...@users.sourceforge.net:
--
assignee: - nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11992
___
___
Python
New submission from Ned Batchelder n...@nedbatchelder.com:
The docs for os.lseek don't make any mention of its return value. I believe
it's the new offset in the file, but I'm not sure if there are other subtleties
to be mentioned.
--
assignee: docs@python
components: Documentation
Changes by Ned Batchelder n...@nedbatchelder.com:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13548
___
___
Python-bugs-list
Changes by Ned Batchelder n...@nedbatchelder.com:
--
nosy: -nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14373
___
___
Python-bugs-list
New submission from Ned Batchelder:
If I register an atexit handler, and then call os.execv, the handler is not
invoked before my process changes over to the new program. Shouldn't it be?
My program is ending, so my atexit handlers should be invoked.
This is based on this coverage.py bug
Changes by Ned Batchelder n...@nedbatchelder.com:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16653
___
___
Python-bugs-list
New submission from Ned Batchelder:
Sorry if this is the wrong bug tracker for this issue.
Someone just asked in #python what they should do about the fact that Python
has no threads on the Mac. When asked why they thought that, they pointed to
this: http://www.python.org/doc/essays
Ned Batchelder added the comment:
Why is it important to remove subclassing object? Isn't it still good form to
mention object as a base class.
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17351
New submission from Ned Batchelder n...@nedbatchelder.com:
If I have a match object in hand, and ask for help on its methods, there is no
information:
m = re.match(a, a)
help(m.group)
Help on built-in function group:
group(...)
--
messages: 138937
nosy: nedbat
priority: normal
Ned Batchelder n...@nedbatchelder.com added the comment:
The tip of the coverage.py repo (https://bitbucket.org/ned/coveragepy) has a
new implementation of the encodings hack which seems to work well.
Of course, an option to run a module before anything else in the interpreter
would make
Ned Batchelder n...@nedbatchelder.com added the comment:
The difficulty that coverage faces is not measuring python programs started
from the command line like this, you can use coverage run myprog.py or
python -m coverage run myprog.py.
The difficulty is when there are subprocesses running
Changes by Ned Batchelder n...@nedbatchelder.com:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15256
___
___
Python-bugs-list
Ned Batchelder added the comment:
I'm -0.5 myself, though, for the reason that it complicates the startup
process a little bit more, without looking very compelling. It smells
disturbingly like LD_PRELOAD to me.
Antoine, do you have a suggestion for how to solve the coverage.py problem
Ned Batchelder added the comment:
Chris:
The real problem is that it isn't the test suite that spawns the processes,
the tests invoke product code, and the product code spawns Python. So
modifying the Python-spawning really means modifying the product code to do
something different under
Ned Batchelder added the comment:
Chris, I'm not sure how to answer your questions. The more powerful and
flexible, the better. There is no must here. I'm looking for a way to avoid
the hacks coverage.py has used in the past to measure coverage in subprocesses.
A language feature
Ned Batchelder added the comment:
I agree with Antoine: I don't see why this should be a feature of virtualenvs.
It's easy to use environment variables in a tightly-controlled way. We don't
worry that any of the other environment variables that affect Python execution
will somehow escape
New submission from Ned Batchelder:
The logging.exception method differs from .debug(), .info(), .warning(),
.error() and .critical() in that it does not accept an `extra` keyword
argument. There seems to be no reason for this.
The docs are misleading about this. They say, The arguments
New submission from Ned Batchelder n...@nedbatchelder.com:
The Other Resources section lists these resources:
Guido's Essays: out of date, the first is about 2.2, by the fifth, we're into
Python 1.5.
New-style Classes: this means new as of 2.2, and the linked page begins,
Unfortunately, new
Changes by Ned Batchelder n...@nedbatchelder.com:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14803
___
___
Python-bugs-list
New submission from Ned Batchelder:
The order of values on the stack is backwards for RAISE_VARARGS. The docs say:
Raises an exception. argc indicates the number of parameters to the raise
statement, ranging from 0 to 3. The handler will find the traceback as TOS2,
the parameter as TOS1
Changes by Ned Batchelder n...@nedbatchelder.com:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17546
___
___
Python-bugs-list
Ned Batchelder added the comment:
Since this is documented in the Python Language Reference, it doesn't make much
sense to have it describe one way for 3.3 and another for 3.4, does it? By
definition, doesn't that make this an implementation dependency? We should
update the docs to say
Ned Batchelder added the comment:
Changing the type of the locals() return isn't the right way to solve this
problem. Better docs is the way to do it. If someone is calling locals(),
they should read the docs. Examining the type of values is discouraged in
Python, we shouldn't expect
Ned Batchelder added the comment:
I would say it something like this:
The dictionary returned by locals() is an accurate snapshot of the local
namespace at the time it is called. After the call returns, changes to one may
or may not be reflected in the other. The dictionary may change
New submission from Ned Batchelder:
I just pulled down the tip of CPython, built it, and ran the tests, and got
this failure:
```
==
FAIL: test_compute_rollover_weekly_attime
(test.test_logging.TimedRotatingFileHandlerTest
Changes by Ned Batchelder n...@nedbatchelder.com:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17718
___
___
Python-bugs-list
New submission from Ned Batchelder:
Looking into this Stack Overflow question:
http://stackoverflow.com/questions/16115027/pythons-sys-settrace-wont-create-c-call-events
Reading the code in c_eval.c and friends, it looks like c_call events are
never passed to the trace function, only
Ned Batchelder added the comment:
Attached a patch which simply removes the code that invokes the trace function.
--
keywords: +patch
Added file: http://bugs.python.org/file29951/6539.patch
___
Python tracker rep...@bugs.python.org
http
New submission from Ned Batchelder:
I find the explanations in the Descriptor howto to be difficult to understand.
I took a stab at changing the first few sections to introduce the concepts in
an easier-to-grasp style.
Issue 12077 also covers a little bit of this.
--
assignee: docs
Changes by Ned Batchelder n...@nedbatchelder.com:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17898
___
___
Python-bugs-list
Changes by Ned Batchelder n...@nedbatchelder.com:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12077
___
___
Python-bugs-list
Ned Batchelder added the comment:
I worked with Ezio to make a new patch with the full edits.
I have other ideas for edits to the rest of the document, but we can discuss
those if you like these...
--
Added file: http://bugs.python.org/file30127/descriptor_howto_2.patch
Ned Batchelder added the comment:
Raymond, I'm glad you're on top of this. I would have thought the howto should
be the easy on-ramp, and deeper authoritative details should go in the
reference section.
--
___
Python tracker rep...@bugs.python.org
Ned Batchelder added the comment:
If you can't determine the number of CPUs, return a clear can't determine
value, such as 0 or -1. Returning 1 will hide information, and it's an easy
default for the caller to apply if they want to.
--
nosy: +nedbat
Ned Batchelder added the comment:
Seriously, return zero, and I can use it as: cpu_count = os.cpu_count() or 1
Why throw away information?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17914
Ned Batchelder added the comment:
A few small points:
Use `num is None` instead of `num == None`.
Use `isinstance(cpus, int)` rather than `type(cpus) is int`.
And this I think will throw an exception in Python 3: `cpus = 1 or cpus ==
None`, because you can't compare None to 1
Ned Batchelder added the comment:
@Yogesh: if cpus is None, then this will raise an exception in Python 3: `cpus
= 1 or cpus == None` Perhaps you don't have enough test cases yet.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Ned Batchelder added the comment:
Python's goal is not to emulate the suboptimal parts of other languages. We
have dynamic typing, and so can return None from the same function that returns
1. And we have compact expressions like `cpu_count() or 1`, so we don't have
to make unfortunate
Ned Batchelder added the comment:
Python 3 has no print statement, it has a print function, so you need:
print(Hello, world!)
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17982
Changes by Ned Batchelder n...@nedbatchelder.com:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18031
___
___
Python-bugs-list
Ned Batchelder added the comment:
I find the workarounds mentioned here to be baroque and confusing. The concept
of a default value to return in the case of an empty iterator is
straightforward. I'm +1 on adding this as well.
--
nosy: +nedbat
Ned Batchelder added the comment:
Please don't make this change. Data is used as a singular collective noun,
especially in software contexts. Data as a plural noun sounds archaic, or at
best, scientific.
--
nosy: +nedbat
___
Python tracker rep
New submission from Ned Batchelder:
When tokenizing with tokenize.generate_tokens, if the code ends with whitespace
(no newline), the tokenizer produces an ERRORTOKEN for each space.
Additionally, the regex that fails to find tokens in those spaces is linear in
the number of spaces, so
Ned Batchelder added the comment:
Here's a patch for 3.3.
I would like to also fix 2.7...
--
keywords: +patch
Added file: http://bugs.python.org/file27459/bug16152.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16152
Changes by Ned Batchelder n...@nedbatchelder.com:
Removed file: http://bugs.python.org/file27459/bug16152.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16152
Changes by Ned Batchelder n...@nedbatchelder.com:
Added file: http://bugs.python.org/file27466/bug16152_v33.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16152
Changes by Ned Batchelder n...@nedbatchelder.com:
Added file: http://bugs.python.org/file27467/bug16152_v27.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16152
Ned Batchelder added the comment:
Updated with new (better) patch, for v2.7 and v3.3. They are the same except
for the test.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16152
Ned Batchelder added the comment:
Jesús, done!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16152
___
___
Python-bugs-list mailing list
New submission from Ned Batchelder:
Examining the CPython sources, there are a number of places where
PyLong_FromLong is used without checking its return value. In places where it
is done correctly, PyErr_Occurred is often used to avoid having to check every
call.
Here are places where
Ned Batchelder added the comment:
I have no idea why pyexpat.c invokes the trace function in the first place.
Unless someone can explain why it does that when no other C extension does, my
inclination would be to make it stop calling the trace function at all, not to
fix how it calls
Ned Batchelder added the comment:
ITSM this could use more clarification. It is subtle and baffling. I'm
struggling to come up with sentences to make it clearer, though.
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http
Ned Batchelder added the comment:
I wrote about this here:
http://nedbatchelder.com/blog/201211/tricky_locals.html A reader suggested
this addition to the docs, which I like:
Multiple invocations within the scope update and return the same dictionary
instance. When a trace function
Ned Batchelder added the comment:
@Brian: Your code doesn't run in Python 2.7 as you've shown it, it produces an
IndentationError. If your code is actually different, and does run, try
running it with the -tt flag on Python, which will warn about inconsistent
indentation.
--
nosy
New submission from Ned Batchelder:
In 2.7, set comprehensions are compiled to code objects expecting an argument
named .0. This convention is also used for the unnamed arguments needed by
tuple arguments. inspect.getcallargs understands the tuple argument case, but
not the set
Ned Batchelder added the comment:
BTW: I don't hold any illusions that this bug is important enough to fix, but I
would be interested in hearing ideas about how I could work around it...
--
___
Python tracker rep...@bugs.python.org
http
Ned Batchelder added the comment:
There are other forms of numbers allowed by Python that are not allowed by
JSON: 001.1
Oddly, with all of the strictness in JSON, the exponent-marker e can be
upper- or lower-case: 1e1 and 1E1 are both valid JSON.
--
nosy: +nedbat
Ned Batchelder added the comment:
I'll add my voice to those asking for a way to put docstrings on namedtuples.
As it is, namedtuples get automatic docstrings that seem to me to be almost
worse than none. Sphinx produces this:
```
class Key
Key(scope, user_id, block_scope_id
New submission from Ned Batchelder:
When I make a namedtuple, I get automatic docstrings that use a lot of words to
say very little. Sphinx autodoc produces this:
```
class Key
Key(scope, user_id, block_scope_id, field_name)
__getnewargs__()
Return self as a plain tuple
Ned Batchelder added the comment:
This sentence seems to cover it: Each instance of the TestCase will only be
used to run a single test method, so a new fixture is created for each test.
from http://docs.python.org/2/library/unittest.html
The word fixture here is being used oddly, but that's
Ned Batchelder added the comment:
Although the OP was incorrect about 1 being guaranteed to be True, it is still
better documentation to use True rather than 1 for a boolean argument.
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http
Ned Batchelder added the comment:
Raymond, thanks for keeping us honest!
I am still hoping to convince people that this is a good idea. I think Guido's
+1 (https://mail.python.org/pipermail/python-dev/2012-December/123099.html)
should help in that regard.
Part of your reason for today's
Ned Batchelder added the comment:
Python-Ideas thread started:
https://mail.python.org/pipermail/python-ideas/2014-May/027893.html
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2506
Ned Batchelder added the comment:
I thought we were discussing this on Python-Ideas?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2506
New submission from Ned Batchelder:
From the #python IRC channel:
```
[07:55:29] tonysar hello.new to programming and python, i use mac
terminal but problem i have is , when i use help function of python to look up
something , i lose my prompt and i have no idea how to go back , what i
Ned Batchelder added the comment:
Thanks, this is a very complete explanation of the machinery behind the scenes.
I think we would do beginners a service if we made the behavior a bit less
obscure. Are there ways that we could (for example) have the prompt say END
(q to quit) instead
Ned Batchelder added the comment:
Serhiy, thanks for the configuration tip. But you seem to be missing my point,
which is that beginners need the default to be a little more friendly. I don't
want to make it bad for experienced users, of course. I doubt Unix users will
be confused
Ned Batchelder added the comment:
FWIW, every use of rmtree I have on Windows occasionally fails this way,
parallelism seems not to be a factor.
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22022
New submission from Ned Batchelder:
The Python 3.4 docstring for range is:
{{{
| range(stop) - range object
| range(start, stop[, step]) - range object
|
| Return a virtual sequence of numbers from start to stop by step.
}}}
In Python 2.7, it said:
{{{
range(stop) - list of integers
Ned Batchelder added the comment:
This bug just bit me. Changing # coding: utf8 to # coding: utf-8 works
around it.
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20844
Ned Batchelder added the comment:
(oops: with Python 3.4.1 on Windows)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20844
___
___
Python-bugs
Ned Batchelder added the comment:
(By the time I got to the source, the word virtual had been removed...)
Attached is a patch to make the help read:
| range(stop) - range object
| range(start, stop[, step]) - range object
|
| Return an object that produces a sequence of integers from
New submission from Ned Batchelder:
This doesn't work on Python 3.4 on a Mac with Yosemite and Chrome installed:
import webbrowser
webbrowser.get(chrome)
This patch makes it work:
```
*** /usr/local/pythonz/pythons/CPython-3.4.1/lib/python3.4/webbrowser.py
2014-09-21 16:37:46.0
Ned Batchelder added the comment:
BTW, the Stack Overflow answer: http://stackoverflow.com/a/4043007
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24632
Changes by Ned Batchelder <n...@nedbatchelder.com>:
--
nosy: +nedbat
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25486>
___
_
Ned Batchelder added the comment:
This is the situation I am in: coverage.py uses getargspec in a very simple way
in its tooling. I support 2.7 and 3.5, so I have to do this:
try:
getargspec = inspect.getfullargspec
except AttributeError:
getargspec
Ned Batchelder added the comment:
I'm confused: the discussion here is mostly about updating docs to note
deprecation. Then at the very end, is an off-hand remark about removing
getargspec.
The docs for getargspec currently read, "This function will be removed in
Python 3.6." Why
Ned Batchelder added the comment:
You are right that "develop" is from setuptools. The same messages appear with
"sdist":
$ python setup.py --quiet sdist
no previously-included directories found matching 'doc/_build'
no previously-included directories found ma
New submission from Ned Batchelder:
The MANIFEST.in file for coverage.py excludes directories line doc/_build. If
I run "python setup.py --quiet develop", I get output like this:
python3.5 setup.py --quiet develop
no previously-included directories found matching '
Ned Batchelder added the comment:
What version of coverage.py is this?
--
nosy: +nedbat
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Ned Batchelder added the comment:
I tried to install 3.5.1 32-bit into a fresh virtualbox image from
https://dev.windows.com/en-us/microsoft-edge/tools/vms/mac/ (IE 10 on Win 7),
and got this same error message. Python will not run, it only shows
1 - 100 of 310 matches
Mail list logo