Craig Younkins added the comment:
> cgi.escape is for HTML attribute escaping only.
It is not safe for HTML attribute escaping because it does not encode single
quotes.
> "More suitable" for HTML would be the correct interpretation rather make the
> "input safe&qu
Craig McQueen added the comment:
So it looks as though this isn't going in to Python 2.7.
How about 3.x?
--
nosy: +cmcqueen1975
___
Python tracker
<http://bugs.python.org/issu
New submission from Craig McQueen :
The type codes for array.array are platform-dependent.
The type codes are similar to those for the struct module. It would be helpful
for array.array to adopt the struct module's "=" format specifier prefix, to
specify "
Craig McQueen added the comment:
A follow-on re the cx_Freeze issue: I looked at the source code, and found it
doesn't seem to be doing any thread creation. But I found that in the
initscripts/Console.py, there are the following lines:
if sys.version_info[:2] >= (2, 5):
New submission from Craig McQueen :
Working in Japan, I find it very helpful to be able to read full Unicode
arguments in Python 2.x under Windows 2000/XP. So I am using the following:
http://stackoverflow.com/questions/846850/how-to-read-unicode-characters-from-command-line-arguments-in
Craig McQueen added the comment:
My program currently uses ASCII options, so I can change the Unicode string
parameter to byte string. The optparse module still seems to match the option
against the incoming Unicode argv, I guess by implicit string conversion
Craig McQueen added the comment:
To further explain, I had code e.g.:
parser.add_option(u'-s', u'--seqfile', dest='seq_file_name', help=u'Write
sequence file output to FILE', metavar=u'FILE')
I had to remove the unicode designator for
New submission from Craig McQueen :
I stumbled across "Template Strings" of PEP 292 by accident recently. I'd never
heard of it before.
I'm familiar with the "string interpolation" aka "String Formatting
Operations", and I know to find that in th
New submission from Craig McQueen :
I have just been trying to figure out how string interpolation works for "%s",
when Unicode strings are involved. It seems it's a bit complicated, but the
Python documentation doesn't really describe it. It just says %s "converts any
Craig McQueen added the comment:
Another thing I discovered, for Example 1:
4. If test_object.__str__() returns a Unicode object (for some reason), and
test_object.__unicode__() does not exist, then the Unicode value from the
__str__() call is used as-is (no conversion to string, no encoding
Craig McQueen added the comment:
The documentation implies that memoryview always accesses bytes:
* "len(view) returns the total number of bytes in the memoryview, view."
* "Taking a single index will return a single byte."
But, the following example shows this is misle
Craig McQueen added the comment:
My previous comment was referring to Python 3.x, by the way. Python 2.7 has not
implemented the buffer protocol for `array`.
--
___
Python tracker
<http://bugs.python.org/issue7
Craig McQueen added the comment:
I've seen the changes Mr Pitrou made, both for the 2.x and 3.x docs. That's a
good improvement--thanks very much.
--
___
Python tracker
<http://bugs.python.
Changes by Craig McQueen :
--
nosy: +cmcqueen1975
___
Python tracker
<http://bugs.python.org/issue7639>
___
___
Python-bugs-list mailing list
Unsubscribe:
Craig McQueen added the comment:
http://code.activestate.com/recipes/577016-path-entire-split-commonprefix/
--
nosy: +cmcqueen1975
___
Python tracker
<http://bugs.python.org/issue4
Craig Holmquist added the comment:
Can you point me toward any documentation on the additional tags you want to
support? Searching for IO_REPARSE_TAG_IIS_CACHE mostly seems to yield header
files that define it (and nothing at all on MSDN), and the non-Microsoft tags
just yield a few results
Craig Holmquist added the comment:
FWIW, the only name-surrogate tags in the user-mode SDK headers (specifically
winnt.h) are IO_REPARSE_TAG_MOUNT_POINT and IO_REPARSE_TAG_SYMLINK, as of at
least the Windows 8.1 SDK.
--
___
Python tracker
<h
Craig Holmquist added the comment:
Here's a new patch: now, _Py_attribute_data_to_stat and Py_DeleteFileW will
just use the IsReparseTagNameSurrogate macro to determine if the file is a
link, so os.walk etc. will know not to follow them. os.readlink, however, will
only work with junc
Changes by Craig Holmquist :
--
keywords: +patch
Added file: http://bugs.python.org/file46290/issue29248.patch
___
Python tracker
<http://bugs.python.org/issue29
Craig Holmquist added the comment:
New patch with spaces instead of tabs
--
Added file: http://bugs.python.org/file46291/issue23407-4.patch
___
Python tracker
<http://bugs.python.org/issue23
Craig Holmquist added the comment:
New patch with test.
I'm not sure if C:\Users\All Users and C:\ProgramData exist with those names on
non-English installations of Windows. I set the test to skip if they aren't
found.
--
nosy: +craigh
Added file: http://bugs.python.org
New submission from Craig McDaniel:
Running "setup.py bdist_rpm" throws an exception on some libraries (e.g. -
simplejson) since 2.7.4 due to introduction of get_python_version():
Traceback (most recent call last):
File "setup.py", line 103, in
run_setup(True)
File
Craig McDaniel added the comment:
Closing; duplicate of 18045
--
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
New submission from Craig Holmquist:
os.walk follows Windows junctions even if followlinks is False:
>>> import os
>>> appdata = os.environ['LOCALAPPDATA']
>>> for root, dirs, files in os.walk(appdata, followlinks=False):
... print(root)
C:\Users\Tes
New submission from Craig Holmquist:
Running the attached test script:
$ time python test.py enum
real0m6.546s
user0m6.530s
sys 0m0.007s
$ time python test.py int
real0m0.384s
user0m0.377s
sys 0m0.000s
I encountered this with a script that yielded a sequence of
Craig Holmquist added the comment:
I may not have been clear before. What I mean is, code like this:
for obj in get_objects():
if obj.category == Cat.cat1:
#do something
elif obj.category == Cat.cat2:
#do something else
elif obj.category == Cat.cat3 or obj.category
Craig Holmquist added the comment:
It seems like performance is drastically improved by doing this:
class Category(Enum):
tiny = 1
medium = 2
large = 3
tiny = Category.tiny
medium = Category.medium
In other words, resolving Category.tiny and Category.medium is what's slow.
Changes by Craig Northway :
--
keywords: +patch
Added file: http://bugs.python.org/file39877/urllib.patch
___
Python tracker
<http://bugs.python.org/issue24
New submission from Craig Northway:
Patch containing additional tests for urllib module to increase code coverage
for url parsing.
Current coverage:
Lib/urllib/parse 51320261%
Updated coverage:
Lib/urllib/parse 51313973%
--
components
Changes by Craig Northway :
--
versions: +Python 3.6
___
Python tracker
<http://bugs.python.org/issue24579>
___
___
Python-bugs-list mailing list
Unsubscribe:
Craig Northway added the comment:
Whoops, looks like there is definitely some redundancy. I didn't notice those
tests at the time I wrote these (PyCon AU last year) and while I have been
grappling with getting permission to make the contributions it looks like it's
been worked on a
New submission from Craig Holmquist:
If the authenticator object passed to the IMAP authenticate method tries to
abort the handshake by returning None, TypeError is raised instead of sending
the * line to the server.
>>> import imaplib
>>> imap = imaplib.IMAP4_S
Craig Holmquist added the comment:
New patch is attached.
--
Added file: http://bugs.python.org/file38749/imap_auth2.patch
___
Python tracker
<http://bugs.python.org/issue23
Craig Holmquist added the comment:
Okay, I attached another patch. The new version of the test returns success if
the client's response is anything other than the abort line (*\r\n).
It fails with the current version of imaplib, fails if I change
_Authenticator.process to output a
Craig Holmquist added the comment:
The attached patch changes _Py_attribute_data_to_stat to set S_IFLNK for both
symlinks and junctions, and changes win_readlink to return the target path for
junctions (IO_REPARSE_TAG_MOUNT_POINT) as well as symlinks.
I'm not sure what to do as far as a
Craig Holmquist added the comment:
Actually, it looks like there is already a way to create junctions and a test
for them in test_os. However, it includes this line:
# Junctions are not recognized as links.
self.assertFalse(os.path.islink(self.junction))
That suggests the old
Craig Holmquist added the comment:
Updated patch with changes to Win32JunctionTests.
--
Added file: http://bugs.python.org/file44824/issue23407-2.patch
___
Python tracker
<http://bugs.python.org/issue23
Brandon Craig Rhodes added the comment:
In case Google brings anyone else to this bug: this error typically indicates
that a `threading.py` which is not actually the Standard Library's `threading`
module has somehow wound up on an earlier path in `sys.path` and is therefore
shadowin
New submission from Brandon Craig Rhodes :
The tarfile module should have a simple command line that allows it to be
executed with "-m" — even if its only ability was to take a filename and
extract it to the current directory, it could be a lifesaver on Windows
machines where Pytho
Brandon Craig Rhodes added the comment:
Éric, I think your points are good ones. (And, as I return to this patch after
three months, I should thank the PSF for sponsoring the CPython sprint here at
PyOhio, and creating this opportunity for me to continue trying to land this
patch!) I am
Brandon Craig Rhodes added the comment:
Éric, I think your suggestions are all good ones, and I have incorporated them
into the file. (But do note that the departures we are now making from Ned's
own copy of the tracer code — removing the commented-out debugging statement,
and the
Brandon Craig Rhodes added the comment:
Ezio and Sandro, thank you very much for your attention to this issue, and for
helping me split it into manageable chunks! To answer the question about why
"coverage" does not show as high a total as it ought: it's because coverage
nor
Brandon Craig Rhodes added the comment:
Brett, yes, you are welcome to close this issue — Ned quite handily convinced
me that coverage code belongs in the "coverage" distribution, not languishing
about in the CPython source tree. That solution also quite beautifully solves
the
New submission from Craig de Stigter :
Steps to reproduce:
# create a large (>4gb) file
f = open('foo.txt', 'wb')
text = 'a' * 1024**2
for i in xrange(5 * 1024):
f.write(text)
f.close()
# now zip the file
import zipfile
z = zipfile.ZipFile('foo.zi
New submission from Brandon Craig Rhodes :
The only way to safely build shell command lines from inside of Python — which
is necessary when sending commands across SSH, since that behaves like
os.system() rather than like subprocess.call() — is to use the wonderful
pipes.call() method to turn
Craig de Stigter added the comment:
Yes, the bug still exists in Python 3.1.2. However, struct.pack() no longer
silently ignores overflow, so I get this error instead:
>>> z.write('foo.txt')
Traceback (most recent call last):
File "", line 1, in
File &
Craig de Stigter added the comment:
Hi, sorry no I haven't had time to add a real test for this
--
___
Python tracker
<http://bugs.python.org/issue9720>
___
___
Nick Craig-Wood added the comment:
Raymond Hettinger (rhettinger) wrote:
> Ben, I don't think there is any value is opening more issues like
> pprint-doesn't-handle-object-x (named tuples, defautdicts, deques,
> generators, etc).
>
> As it is currently designed, pp
Nick Craig-Wood added the comment:
Terry J. Reedy (terry.reedy) wrote:
> > IMHO pprint should be able to make a decent job of all the built in types
>
> Agreed, already true as far as I know, and irrelevant. This issue is not
> about built-in types in the builtins module, as
New submission from Brandon Craig Rhodes :
When running the Python regression tests in "coverage", the initial outer level
of interpreted code in several standard library modules shows as not having
been covered by the tests, because they were imported during the Python boot
proces
Brandon Craig Rhodes added the comment:
Here is a module that solves this problem if the tests are run with the
"fullcoverage" directory at the front of the PYTHONPATH, like this:
PYTHONPATH=Tools/fullcoverage ./python -m coverage run --pylib
Lib/test/regrtest.py
New submission from Brandon Craig Rhodes :
The attached patch will bring Lib/copy.py to 100% test coverage.
A bug in "coverage" results in its only reporting 99% at the moment; see
coverage issue #122 on bitbucket:
https://bitbucket.org/ned/coveragepy/issue/122/for-else-always-repor
Brandon Craig Rhodes added the comment:
Benjamin, I would like some way to know when our tests achieve 100% coverage
because otherwise I will keep coming back to this module to add more tests and
have to re-discover code that is not CPython relevant. But for now I have
removed the pragmas
Changes by Brandon Craig Rhodes :
Removed file: http://bugs.python.org/file21245/test_copy2.patch
___
Python tracker
<http://bugs.python.org/issue502085>
___
___
Pytho
Brandon Craig Rhodes added the comment:
Benjamin, thanks for the pointers! The attached patch now uses assertIs() and
assertIsNot(), and calls self.fail() instead of using the exception from
"support".
In the future I would like some way to determine when test coverage is fully
ac
Brandon Craig Rhodes added the comment:
Éric, the Makefile in Python trunk seems to include Objects/complexobject.o in
the build unilaterally without any way to turn it off. What is leading you to
believe that Python 3 can conditionally turn the "complex" type off during a
build?
Brandon Craig Rhodes added the comment:
Antoine, neither this issue, nor either version of my patch, was intended to
assert that 100% test coverage indicates that a test of tests are complete. If
you will point out where in the text this is implied, I will correct it. Thanks
Brandon Craig Rhodes added the comment:
Éric, after checking line 112 of the two patches and then of the new file, I
figured out that you meant line 112 of the old file — and, yes, that test can
go away too since in python3 "complex" always exists and "unicode" neve
Brandon Craig Rhodes added the comment:
Nick Coghlan writes:
> Nick Coghlan added the comment:
>
> Regarding "__reduce__", other readers will have the same question Éric
> did, so that point should definitely go in a comment after the
> "__reduce_ex__" che
Brandon Craig Rhodes added the comment:
Nick Coghlan writes:
> Regarding "__reduce__", other readers will have the same question Éric
> did, so that point should definitely go in a comment after the
> "__reduce_ex__" check.
I just sat down to review this issu
Brandon Craig Rhodes added the comment:
But if we allow for ellipsis, then would we not also have to start allowing
characters like ≥ and ≤ in Python? And the problem with any of these
(admittedly very attractive) substitutions is that they seem to abandon the
principle of there being One
New submission from Brandon Craig Rhodes :
If you try doing "msg.as_string()" to a MIMEMultipart message that has not been
given a boundary, then it dies with this exception:
Traceback (most recent call last):
File "mime_gen_alt.py", line 40, in
print(msg.as_str
Brandon Craig Rhodes added the comment:
Here is a patch that fixes the problem. The problem probably only occurs if the
MIMEMultipart is actually given several MIME parts to use in its interior.
--
keywords: +patch
Added file: http://bugs.python.org/file20391/email-boundary.diff
New submission from Brandon Craig Rhodes :
Normally, unittest cleanly reports an exception in a setUpClass method. But if
I place the attached test in a directory by itself and then run "python -m
unittest discover -b" from inside of the same directory, then instead of being
New submission from Nick Craig-Wood :
I just spend a while tracking down a bug in my code which turned out to be an
unexpected behaviour of hasattr.
Running this
class Test(object):
def __init__(self):
self.__private = "Hello"
def test(self):
print(self
New submission from Brandon Craig Rhodes :
On this page, the Style Guide for people who want to try contributing to the
Python documentation:
docs.python.org/documenting/style.html
there is a broken link to the Apple Style Guide. The 2008 edition now seems
gone and people are now apparently
New submission from Nick Craig-Wood :
I noticed this the other day when debugging a program that neither set()
nor defaultdict() pprint() properly
Same under 3.1 and 2.5 (Not tried 2.6/2.7 but I assume it is the same)
>>> pprint(set(range(100)))
set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1
Brandon Craig Rhodes added the comment:
Adding an entirely separate API for introspection strikes me as
counter-productive — instead of merely having to maintain the logging API that
you already maintain, you will additionally now have an entirely separate and
second API that also has to be
Brandon Craig Rhodes added the comment:
Kristján, your patch is a wonderful idea—I am about to commit production code
that will have to create tens of thousands of temporary files during operation,
one file each time SSL is started up on a socket, which could be avoided if
something like this
Brandon Craig Rhodes added the comment:
Kristján, you are certainly correct that a single-argument that can be either a
filename or a cert is inappropriate; we should not be peeking inside of strings
to guess what they contain.
And I think you also have a good point about Pythonic-ness when
Nick Craig-Wood added the comment:
I couldn't actually get this patch to apply to the py3k branch :-(
$ patch -p0 --dry-run < issue_5131.patch
patching file Misc/NEWS
Hunk #1 FAILED at 2598.
1 out of 1 hunk FAILED -- saving rejects to file Misc/NEWS.rej
patching file Misc/ACKS
Nick Craig-Wood added the comment:
Oops, my bad, I assumed the patch would by for py3k!
I applied it to trunk and tested it. It works very well - thank you for
fixing that :-)
--
___
Python tracker
<http://bugs.python.org/issue5
New submission from Brandon Craig Rhodes :
The "multiprocessing" module uses a bare fork() to create child processes under
Linux, so the children get a copy of the entire state of the parent process.
But under Windows, child processes are freshly spun-up Python interpreters with
n
Brandon Craig Rhodes added the comment:
Jesse, it's great to learn it's on your wish list too!
Should I design the patch so that (a) there is some global in the module that
needs tweaking to choose the child creation technique, or (b) that an argument
to the Process() constructo
New submission from Nick Craig-Wood :
sqlite3.Warning isnt a subclass of exceptions.Warning
This causes this problem when trying to filter warnings
>>> import sqlite3 as DB
>>> from warnings import filterwarnings
>>> filterwarnings("always", category=DB
Nick Craig-Wood added the comment:
I've attached a patch to fix the issue along with a revised test.
--
___
Python tracker
<http://bugs.python.org/i
Nick Craig-Wood added the comment:
I re-worked the patch for python 3.x (py3k branch) - the other was for 2.x
(trunk)
Basically the same patch and fixes the issue according to my testing
--
Added file: http://bugs.python.org/file18386/sqlite3-warning-fix-py3k.patch
Nick Craig-Wood added the comment:
I think the fact that sqlite may not be using the warnings properly is
independent of this problem. Warnings should be filterable, but if sqlite
isn't notifying them properly - that would be a different bug.
BTW I came across this problem when tryi
Nick Craig-Wood added the comment:
Reading PEP 0249 I can see Gerhard is correct, this patch would violate the PEP.
I think that the PEP is slightly flawed in that users are encouraged to raise
exceptions called "Warning". IMHO a Warning is never an exceptional condition
and
New submission from Brandon Craig Rhodes:
A friend (@theomn on Twitter) was just working off of PEP-333 when I mentioned
to him that PEP-, and he had never heard of it, and he expressed the wish
that PEPs would have a banner or something at the top if there is a more recent
version of
Brandon Craig Rhodes added the comment:
(Corrected "not" to "note" in the title and went with "enhancement")
--
title: PEP should not if it has been superseded -> PEP should note if it has
been superseded
type: -> enhancement
__
Brandon Craig Rhodes added the comment:
The original inspiration:
https://twitter.com/theomn/status/309468740611891200
--
___
Python tracker
<http://bugs.python.org/issue17
Brandon Craig Rhodes added the comment:
Larry Hastings writes:
> Huh. tar *can* infer it from the data itself. On the other hand, it
> chooses explicitly not to. I guess "tar" knows explicit is better
> than implicit too ;-)
I am told that the refusal of "tar&qu
New submission from Nick Craig-Wood:
Here is a patch to remove some unused code in `symtable.c`
In Python3 `from x import *` was banned from use in functions completely.
This is detected by `symtable_visit_alias`
if (st->st_cur->ste_type != ModuleBlock) {
int linen
101 - 184 of 184 matches
Mail list logo