Daniel Holth added the comment:
from docs.python.org:
platform.python_implementation()
Returns a string identifying the Python implementation. Possible return
values are: ‘CPython’, ‘IronPython’, ‘Jython’.
New in version 2.6.
... and it seems pypy identifies itself as '
New submission from Daniel Holth :
"How much do we care about special method lookup?" Python recently bypasses
__getattr__ entirely when looking up context managers.
http://mail.python.org/pipermail/python-dev/2009-May/089535.html
Could this be the reason that ZODB's transactio
Daniel Holth added the comment:
Python should explain AttributeError in the same way when it's raised by the
interpreter. The with: statement below should raise the second AttributeError,
not the first.
import transaction
with transaction: pass
>>> AttributeError: __exit__
Daniel Holth added the comment:
Thank you Benjamin for following up on this issue
--
___
Python tracker
<http://bugs.python.org/issue12022>
___
___
Python-bug
New submission from Daniel Holth :
It looks like this is the current API to set compression at the individual file
level when writing with ZipFile.open()
z.compression = zipfile.ZIP_STORED
data_writer = z.open(zip_info or filename, "w")
z.compression = saved
New submission from Daniel Holth :
The io documentation says:
IOBase is also a context manager and therefore supports the with statement. In
this example, file is closed after the with statement’s suite is finished—even
if an exception occurs:
with open('spam.txt',
Daniel Holth added the comment:
My mistake. It honors ZipInfo if passed.
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/i
Change by Daniel Holth :
--
nosy: +dholth
___
Python tracker
<https://bugs.python.org/issue36129>
___
___
Python-bugs-list mailing list
Unsubscribe:
Daniel Holth added the comment:
Thanks, I'm sorry I didn't save when I was having my strange problem.
The io module is still practically undocumented. It should have examples
subclasses for each class, perhaps a link to the PEP and a link to a Python
implementation of
Daniel Holth added the comment:
Possibly the best io module example I've found
https://github.com/python/cpython/blob/master/Lib/_compression.py
--
___
Python tracker
<https://bugs.python.org/is
New submission from Daniel Holth :
The prefix for bcrypt '$2a$' is supported on many systems and could be added to
crypt.py
Could the documentation mention the available rounds parameter for most of
these newer hashes? And that Unicode strings are automatically converted to
ut
Changes by Daniel Holth :
--
components: +Library (Lib)
versions: +Python 3.3
___
Python tracker
<http://bugs.python.org/issue14518>
___
___
Python-bugs-list m
New submission from Daniel Holth:
Please remove the note.
Note
A new documentation project, which will be merged into the Python documentation
soon, covers creating, installing and distributing Python packages:
The Hitchhiker's Guide to Packaging (creating and distributing P
New submission from Daniel Holth:
This patch lets the user get/set the byteswarningflag() to control whether
warnings are emitted at runtime (pursuant to the configuration of the warnings
module, of course).
The idea is that a user who is concerned with interacting with bytes correctly
would
Daniel Holth added the comment:
You would just enable this during your serialization code, and if
(perhaps someone is calling your library and passing it the wrong type)
they would be guarded against this common error.
On Sat, Jul 6, 2013, at 12:15 AM, R. David Murray wrote:
>
> R.
Daniel Holth added the comment:
On Thu, Jul 18, 2013, at 04:22 AM, Antoine Pitrou wrote:
>
> Antoine Pitrou added the comment:
>
> I don't know why your patch is putting this in the thread state,
> though...
If you have multiple threads one thread might want exceptions
Daniel Holth added the comment:
Python 3 is supposed to make it easier to do Unicode correctly. str(bytes) does
not. I felt strongly enough about that to write this patch.
With this feature my library can have control in a way that is much more
practical than ensuring a particular flag has
New submission from Daniel Holth:
http://hg.python.org/cpython/file/e7305517260b/Lib/zipfile.py#l460
I noticed this table taking up time on import. I'd guess that it pre-dates
zlib.crc32 which is imported at the top of the file. I also suspect that most
of the time this table isn't
Daniel Holth added the comment:
Someone who has a better understanding of zipfile may be able to get
zlib.crc32(bytes[ch], running_crc) to work correctly. This patch that passes
the zipfile tests generates the crctable only when _ZipDecrypter() is
instantiated.
--
Added file: http
Daniel Holth added the comment:
It takes 706 microseconds.
On my machine
%timeit import sys; del sys.modules['zipfile']; import zipfile "import
zipfile"
takes 2.51 ms without the patch and 1.7 ms with the patch.
On Sat, Jul 20, 2013, at 12:13 PM, Serhiy Storchak
Daniel Holth added the comment:
I tried it on a raspberry pi. zipfile takes 36 ms to import and 10 ms if it
does not generate the crctable.
--
___
Python tracker
<http://bugs.python.org/issue18
Daniel Holth added the comment:
fwiw pypy 2 supports HASH.name but the older 1.9 (still part of some Linux
distributions) did not.
--
nosy: +dholth
___
Python tracker
<http://bugs.python.org/issue18
Daniel Holth added the comment:
Implemented in https://bitbucket.org/dholth/cpython/changeset/c493a5179621
Advice on writing the unit test would be appreciated.
--
___
Python tracker
<http://bugs.python.org/issue11
Daniel Holth added the comment:
Fixed closure mistake in remote tip
--
hgrepos: +126
___
Python tracker
<http://bugs.python.org/issue11880>
___
___
Python-bug
Changes by Daniel Holth :
--
keywords: +patch
Added file: http://bugs.python.org/file25623/50a0da981b7e.diff
___
Python tracker
<http://bugs.python.org/issue11
Changes by Daniel Holth :
--
assignee: eric.araujo
components: Distutils2
nosy: alexis, dholth, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: support define_macros / undef_macros in setup.cfg
type: enhancement
versions: Python 3.3
New submission from Daniel Holth :
from build_ext.py:
# XXX not honouring 'define_macros' or 'undef_macros' -- the
# CCompiler API needs to change to accommodate this, and I
# want to do one thing at a time!
--
__
Daniel Holth added the comment:
branch updated with regression test (add an entry_points.txt to
test_command_install_data.py) and get_distinfo_file() can get any file inside
the .dist-info directory.
--
___
Python tracker
<http://bugs.python.
Daniel Holth added the comment:
Looks like it can go into [build_ext] but not per-extension
--
___
Python tracker
<http://bugs.python.org/issue14843>
___
___
Daniel Holth added the comment:
A tuple of (macro, '1') seems to do the trick
define_macros has to be space-separated, not comma-separated
--
hgrepos: +127
___
Python tracker
<http://bugs.python.o
Changes by Daniel Holth :
--
keywords: +patch
Added file: http://bugs.python.org/file25642/65c3af0d283b.diff
___
Python tracker
<http://bugs.python.org/issue14
Changes by Daniel Holth :
Removed file: http://bugs.python.org/file25642/65c3af0d283b.diff
___
Python tracker
<http://bugs.python.org/issue14843>
___
___
Python-bug
New submission from Daniel Holth :
Based on the supply, there is a tremendous demand for printers of nested lists
(as long as they are not too complicated). But how will I find and compare the
available options? Add a trove classifier
Topic :: Nested Lists
to ease the search burden
Changes by Daniel Holth :
--
resolution: -> postponed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue14921>
___
___
Python-bugs-
Daniel Holth added the comment:
Please mention Apple's OS X Python behavior in the PEP. The Python that comes
with OS X Lion doesn't seem to follow the PEP regarding ~/.local ; this
deserves a mention.
--
nosy: +dholth
___
Python trac
Daniel Holth added the comment:
Yes, but I had some trouble attaching a good patch to the issue tracker
itself.
On Thu, Jun 14, 2012, at 02:28 PM, David Barnett wrote:
>
> David Barnett added the comment:
>
> Is this ready and just waiting to be merged now?
>
> -
Daniel Holth added the comment:
I appreciate it. I had trouble using the patch system after that. I will see
whether I can generate a better one.
Daniel Holth
On Jul 3, 2012, at 12:49 AM, Éric Araujo wrote:
>
> Éric Araujo added the comment:
>
> Did a first review on Rietvel
Daniel Holth added the comment:
I must have missed the export_symbols keyword argument to Extension(), or it
was added.
--
resolution: -> invalid
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Daniel Holth added the comment:
While you are at it, can you edit the docs to put md5() at the bottom of the
page at the back of the list in a 2-point font and raise a
DeprecationWarning("This function is totally lame, and it is slower than SHA-3,
get with the program.") the first
New submission from Daniel Holth :
md5() has been obsolete since 1996. It has no place as the first item in
hashlib's list of "guaranteed to be available" hashes, and it doesn't work when
Python has been compiled to be FIPS-compliant.
The documentation should be
Daniel Holth added the comment:
Not to mention its continued popularity as a password hash, surpassed only by
double-rot13. You've convinced me, it is reasonable to continue to support,
nay, recommend md5 for the non-FIPS world. This hash function continues to have
raving fans, especial
Daniel Holth added the comment:
Taking a second look it is pretty good.
The only other thing that might be worth mentioning explicitly is that the
"always present" hashes don't actually use OpenSSL.
"Constructors for hash algorithms that are always present in this mod
Daniel Holth added the comment:
re-tweak treatment of md5 in hashlib docs (the SHA-2 family is currently
recommended by http://csrc.nist.gov/groups/ST/toolkit/secure_hashing.html)
--
Added file: http://bugs.python.org/file26648/hashlib.patch
Daniel Holth added the comment:
Sorry, I won't be able to get around to this any time soon. The patch to fix
this bug (in the CPython3 source code) is too intertwined with the other
distutils2 fixes. Anyone is welcome to fish for it in my bitbucket.
--
status: open -> lan
New submission from Daniel Holth:
compileall would benefit approximately linearly from additional CPU cores.
There should be an option.
The noisy output would have to change. Right now it prints "compiling" and then
"done" synchronously with doing the actual work.
Daniel Holth added the comment:
As an aside, why wouldn't I run my program with -bb?
One reason is that the following code won't work on Linux:
#!/usr/bin/env python -bb
Instead of passing -bb to Python, it will look for an executable called "python
-bb", and it's no
Daniel Holth added the comment:
I am withdrawing zipfile-no-crc32.patch. It did not work correctly.
zdlazy.patch should go in. It avoids creating the rarely-needed crc32 table
until the first time it is needed, saving some memory and the majority of time
needed to import the module
Daniel Holth added the comment:
I am not the copyright holder, I only maintain the pypi package for
python-ntlm. I might have 10 lines of my own code in the whole package.
If running on Windows it would be great to have out of the box "native
windows NTLM" which can be done someho
Daniel Holth added the comment:
Previous changeset was meant for #18515
--
nosy: +dholth
___
Python tracker
<http://bugs.python.org/issue18585>
___
___
Python-bug
Daniel Holth added the comment:
Fixed in http://hg.python.org/cpython/rev/536a2cf5f1d2
--
___
Python tracker
<http://bugs.python.org/issue18515>
___
___
Python-bug
Daniel Holth added the comment:
Thanks. I guess I know who to ask now.
It was just painful seeing so much import-time computation, pretty much
guaranteed to happen every time Python starts up, being wasted on a
feature that is rarely used. On the Raspberry Pi the majority of the
import time is
Daniel Holth added the comment:
Just mitigating the bug that -bb is not the default...
--
___
Python tracker
<http://bugs.python.org/issue18373>
___
___
Python-bug
Daniel Holth added the comment:
In bdist_wheel I've gone to some lengths to re-use the email module to parse
and generate "RFC822 inspired" documents. The output is not a valid e-mail but
it is useful.
It is awkward to use the email module this way.
We will sidestep the issue
Daniel Holth added the comment:
We do this.
https://bitbucket.org/dholth/wheel/src/tip/wheel/pkginfo.py?at=default
I appreciate the long-term goal. The policy system is really neat.
We are going to json largely because the next version of the metadata is more
nested. The decision had nothing
Changes by Daniel Holth :
Removed file: http://bugs.python.org/file30787/byteswarningflag.patch
___
Python tracker
<http://bugs.python.org/issue18373>
___
___
Python-bug
Daniel Holth added the comment:
Continuing discussion in the older bug
--
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Daniel Holth added the comment:
Better to continue discussion here.
Attached is my second, simpler version of the feature. A context manager is
included:
with string.StrBytesRaises():
str(b'bytes')
# raises an exception
In a normal program, you might just set the flag to True
Daniel Holth added the comment:
My reasoning was that str(bytes) would normally be called so rarely that
who cares.
On Fri, May 27, 2016, at 09:02 AM, STINNER Victor wrote:
>
> STINNER Victor added the comment:
>
> strbytes.patch of #27134: adding calls to
> PyThre
Daniel Holth added the comment:
Then you prefer the older three year old patch that adds to pystate.h ?
http://bugs.python.org/review/18373/#ps8545
I remember not being happy with how complicated it turned out, and
perhaps having problems with not wanting the "warn once" behavior? It
Daniel Holth added the comment:
What if we changed it so that Python code could only disable str_bytes()
process-wide, editing the original flag? Would that be fatal to debuggers and
the repl?
--
___
Python tracker
<http://bugs.python.
New submission from Daniel Holth:
The zipfile documentation says "There is no official file name encoding for ZIP
files." However ZIP and zipfile supports utf-8 filenames; this has been true
for a long time, at least since Python 2.7.
--
assignee: docs@python
components: Doc
Daniel Holth added the comment:
This is a simple documentation bug about the ZIP file format supporting utf-8
and 'no encoding' filenames depending on whether two bits are set in a flag
inside the archive member. Bug 10614 appears to be a different issue about
out-of-band encoding i
Daniel Holth added the comment:
The current documentation says "Note There is no official file name encoding
for ZIP files. If you have unicode file names, you must convert them to byte
strings in your desired encoding before passing them to write(). WinZip
interprets all file nam
Daniel Holth added the comment:
" ... zipfile will encode them to and from utf-8 internally, and the encoding
is marked in a standard flag inside the archive member."
--
___
Python tracker
<http://bugs.python.o
Daniel Holth added the comment:
The documentation should read
The ZIP file format supports Unicode filenames. If you have unicode filenames,
zipfile will encode them to and from utf-8 internally, but if you pass bytes
filenames to write() then they will be stored without a specified encoding
Daniel Holth added the comment:
https://hg.python.org/cpython/file/2.6/Lib/zipfile.py#l331
Python 2.6 zipfile supports utf8 properly. It has only improved since then.
--
___
Python tracker
<http://bugs.python.org/issue27
Daniel Holth added the comment:
This bit me also. Is there other documentation for how many arguments
MethodType() should take?
--
nosy: +dholth
___
Python tracker
<http://bugs.python.org/issue25
New submission from Daniel Holth:
When compiling my cryptacular extension
https://bitbucket.org/dholth/cryptacular I noticed -DPy_LIMITED_API
-DPY_SSIZE_T_CLEAN creates a binary that does not actually use the limited api.
This causes segfaults on Linux but does not appear to cause problems on
Daniel Holth added the comment:
Here it is.
https://mail.python.org/pipermail/python-3000/2008-November/015344.html
On Sat, Nov 22, 2008 at 06:29, Barry Warsaw wrote:
>
> On Nov 22, 2008, at 4:05 AM, Martin v. Löwis wrote:
>
>> I just noticed that the Python 3 C API
Daniel Holth added the comment:
Oh, I can avoid this problem by setting Py_LIMITED_API to 0x3030 or greater.
--
___
Python tracker
<http://bugs.python.org/issue27
New submission from Daniel Holth:
When I discovered str(b'bytes') in my Python 3 program was causing errors to be
serialized to disk, I was unhappy. It turns out there is a command line option
to turn it off, but the vulnerable serialization code is not going to be able
to set tha
Daniel Holth added the comment:
Superceded by http://bugs.python.org/issue27134 , a simpler solution providing
a with StrBytesRaises(): context manager.
--
___
Python tracker
<http://bugs.python.org/issue18
Daniel Holth added the comment:
Spelling
raise PackError("Cannot spacify entry point if the source has __main__.py")
--
___
Python tracker
<http://bugs.python.o
Daniel Holth added the comment:
Create and open executable file respecting the Unix user's umask:
os.fdopen(os.open(filename, os.O_CREAT|os.O_RDWR), "rw")
On Tue, Feb 24, 2015, at 02:34 PM, Paul Moore wrote:
>
> Paul Moore added the comment:
>
> Thanks, I'll f
Daniel Holth added the comment:
On Thu, Feb 26, 2015, at 09:41 AM, Paul Moore wrote:
>
> Paul Moore added the comment:
>
> Following on from that, the code to make an archive executable is
> currently
>
> os.chmod(new_archive, os.stat(new_archive).st_mode | stat.S_IEX
75 matches
Mail list logo