New submission from David M. Beazley :
Documentation for the email package needs to be more clear about the
usage of strings and bytes. In particular:
1. All operations that parse email messages such as message_from_file()
or message_from_string() operate on *text*, not binary data. So
New submission from David M. Beazley :
The documentation describes classes such as
email.mime.MIMEText()
email.mime.MIMEMultipart()
email.mime.MIMEApplication()
etc...
However, it's confusing because none of these classes are actually found
in email.mime.
Suggest either using the full p
New submission from David M. Beazley :
The email.generator.Generator class does not work correctly message
objects created with binary data (MIMEImage, MIMEAudio, MIMEApplication,
etc.). For example:
>>> from email.mime.image import MIMEImage
>>> data = open("IMG.
New submission from David M. Beazley :
The whole point of base64 encoding is to safely encode binary data into
text characters. Thus, the base64.b64decode() function should equally
accept text strings or binary strings as input. For example, there is a
reasonable expectation that something
David M. Beazley added the comment:
Note: This problem applies to all of the other decoders/encoders in the
base64 too (b16, b32, etc.)
___
Python tracker
<http://bugs.python.org/issue4
New submission from David M. Beazley :
See Issue 4869 for a related bug.
Most of the functions in binascii are meant to go from binary data to
textual representations (hex digits, base64, binhex, etc.). There are
numerous problems:
1. Misleading error messages. For example
David M. Beazley added the comment:
Given the low-level nature of this module, I can understand the
motivation to make it all bytes.
However, I'm going to respectfully disagree with that and claim that
making binascii all bytes really goes against the whole spirit of what
Python 3.
New submission from David M. Beazley :
The hashlib documentation has incorrect examples showing the use of the
hexdigest() method:
>>> hashlib.sha224(b"Nobody inspects the spammish
repetition").hexdigest()
b'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
David M. Beazley added the comment:
The digest() method of hashes does produce bytes (correct). The
hexdigest() method produces a string, but it is also shown as producing
bytes in the examples.
___
Python tracker
<http://bugs.python.org/issue4
New submission from David M. Beazley :
A file-like object u returned by the urlopen() function in both Python
2.6/3.0 has a method info() that returns a 'HTTPMessage' object. For
example:
::: Python 2.6
>>> from urllib2 import urlopen
>>> u = urlopen("ht
David M. Beazley added the comment:
Verified that 2to3 does not fix this.
___
Python tracker
<http://bugs.python.org/issue4773>
___
___
Python-bugs-list mailing list
Unsub
New submission from David M. Beazley :
Documentation for the json module in Python 2.6 and Python 3.0 doesn't
have any description for load() or loads() even though both functions are
used in the examples.
--
assignee: georg.brandl
components: Documentation
messages: 78542
New submission from David M. Beazley :
The json module is described as having an interface similar to pickle:
json.dump()
json.dumps()
json.load()
json.loads()
I think it would be a WISE idea to add a huge warning message to the
documentation that these functions should *NOT
New submission from David M. Beazley :
The strict parameter to JSONDecoder() is undocumented and is confusing
because someone might assume it has something to do with the encoding
parameter or the general handling of parsing errors (which it doesn't).
As far as I can determine by readin
David M. Beazley added the comment:
One more followup. The quopri module (which is highly related to
base64 in that quopri and base64 are often used together within MIME)
does accept both unicode and byte strings when decoding. For example,
this works:
>>> quopri.decodestri
David M. Beazley added the comment:
Just consider me to be an impartial outside reviewer. Hypothetically,
let's say I'm a Python programmer who knows a thing or two about
standard library modules (like pickle), but I'm new to JSON so I come
looking at the json module docum
David M. Beazley added the comment:
Thanks! Hopefully I'm not giving you too much work to do :-).
Cheers,
Dave
___
Python tracker
<http://bugs.python.org/i
New submission from David M. Beazley :
Not a bug, but a question to developers:
Is xml.etree.ElementTree going to be the only standard library module in
Python 3.0 that doesn't follow the standard Python 3.0 module naming
conventions? (e.g., socketserver, configparser, etc.). Are ther
New submission from David M. Beazley :
In the "ctypes reference / Finding shared libraries" section of the ctypes
documentation, the find_library() function is described as being located
in ctypes.util. However, it's formal description right below that lists
it as ctyp
David M. Beazley added the comment:
One further followup just to make sure I'm clear.
Is it always safe to pass the result of locals() into exec and extract
the result as shown in my example?
Since I'm writing about this in a book, I just want to make absolutely
certain I k
New submission from David M. Beazley :
Please forgive me, but I'm really trying to wrap my brain around the
behavior of exec() in Python 3. Here's a quote from the documentation:
"In all cases, if the optional parts are omitted, the code is
executed in the current s
New submission from David M. Beazley :
The result of binascii.crc32() is different on the same input in Python
2.6/3.0. For example:
Python 2.6:
>>> binascii.crc32('Hello')
-137262718
Python 3.0:
>>> binascii.crc32(b'Hello')
4157704578
--
com
David M. Beazley added the comment:
Can someone PLEASE make sure this gets documented someplace.
___
Python tracker
<http://bugs.python.org/issue4903>
___
___
Python-bug
David M. Beazley added the comment:
Placing a note in the standard library documentation would be a start.
Just say in Python 3.0 it always returns the result as an unsigned
integer whereas in Python 2.6 a 32-bit signed integer is returned.
Although the numerical value may differ between
Lorenzo M. Catucci added the comment:
I just found out that the gmail servers don't support connections on
the standard pop3/imapv4 ports, but only on the SSL wrapped ones.
I'm unsure if cmu.edu anonymous imap server admin's would be happy with
their server becoming python'
Lorenzo M. Catucci added the comment:
Thanks for following-up, Bill.
While I fully understand the need for unit-testing, I don't have the
guts to start writing a dummy imap server from scratch.
I tested my changes on a couple of servers I manage, one running
uw-imapd and the other ru
Lorenzo M. Catucci added the comment:
As the tests are new, I hope sending the real file is the right way to
proceed.
Added file: http://bugs.python.org/file12963/test_imapnet.py
___
Python tracker
<http://bugs.python.org/issue4
Changes by Lorenzo M. Catucci :
Added file: http://bugs.python.org/file12964/test_smtpnet.py
___
Python tracker
<http://bugs.python.org/issue4470>
___
___
Python-bug
Changes by Lorenzo M. Catucci :
Added file: http://bugs.python.org/file12965/test_popnet.py
___
Python tracker
<http://bugs.python.org/issue4473>
___
___
Python-bug
Changes by Lorenzo M. Catucci :
--
components: +Library (Lib)
___
Python tracker
<http://bugs.python.org/issue4473>
___
___
Python-bugs-list mailing list
Unsub
Lorenzo M. Catucci added the comment:
There is a problem I forgot to state with test_anonlogin:
since I try and test both SSL and starttls, the DoS checker at cmu kicks
in and refuse the login attempt in PopSSLTest. Since I'd rather avoid
cheating, I'm leaning to try logging in as Som
Lorenzo M. Catucci added the comment:
I'm enclosing the expected-failure version of test_popnet. It's much
simpler to talk and comment about something you can see!
Added file: http://bugs.python.org/file12966/test_popnet.py
___
Python trac
New submission from Sangeeta M Chauhan :
precendence betweeen relational and logical operators not working properly if
expression contains single values instead of sub expressions. . Please see
attached file
--
components: Interpreter Core
files: pythonBug.py
messages: 351344
nosy
Sangeeta M Chauhan added the comment:
i am not satisfied ..with your answer . as in the following expression 9
or 7 > "str" precedence must be given to relational operator . why is is
executing logical operator first??
if we write 4>9 or 7> "str&quo
Sangeeta M Chauhan added the comment:
Sir, I was expecting that the precedence should be given to relational
operator ( 7>"str") and according to that instead of printing 9 it
should give error.
On Mon, Sep 9, 2019 at 8:38 PM Tim Peters wrote:
>
> Tim Peters
Change by M. Eric Irrgang :
--
pull_requests: +16231
pull_request: https://github.com/python/cpython/pull/16648
___
Python tracker
<https://bugs.python.org/issue32
On 19.03.2021 10:17, STINNER Victor wrote:
>
> New submission from STINNER Victor :
>
> I propose to add two new functions:
>
> * locale.get_locale_encoding(): it's exactly the same than
> locale.getpreferredencoding(False).
>
> * locale.get_current_locale_encoding(): always get the current lo
On 19.03.2021 11:36, STINNER Victor wrote:
>
> STINNER Victor added the comment:
>
>> locale.getencoding()
>>
>> which interfaces to nl_langinfo(CODESET) or the Windows code
>> page and does not try to do any magic, ie. does *not* call
>> setlocale(). It needs to return what the lib C currently
On 19.03.2021 12:05, STINNER Victor wrote:
> I'm not sure what to do with locale.getdefaultlocale(). Should we deprecate
> it? I never used this function. How is it used? For which purpose?
>
> I undertand that in 2000, locale.getdefaultlocale() was interesting to avoid
> calling setlocale(LC_CTY
On 19.03.2021 12:26, STINNER Victor wrote:
>
> STINNER Victor added the comment:
>
> Recently, I spent some days to document properly encodings used by Python.
Thanks for documenting this.
I would prefer to leave the locale module to really just an interface
to the lib C locale logic and not a
On 19.03.2021 12:35, Eryk Sun wrote:
>
> Eryk Sun added the comment:
>
>> Read the ANSI code page on Windows,
>
> I don't see why the Windows implementation is inconsistent with POSIX here.
> If it were changed to be consistent, the default encoding at startup would
> remain the same, since s
On 19.03.2021 14:47, STINNER Victor wrote:
>
> STINNER Victor added the comment:
>
>> - If you add "current", people will rightly ask: then what do all the
>> other APIs in the locale module return ? Of course, they all return
>> the current state of settings :-) So this is unnecessary as well.
On 19.03.2021 14:57, Inada Naoki wrote:
>
> Background: PEP 597 adds new `encoding="locale"`option to open() and
> TextIOWrapper(). It is same to `encoding=None` for now, but it means using
> "locale encoding" explicitly.
>
> But this is wrong in UTF-8 mode.
Please address UTF-8 mode explicitl
On 31.03.2021 11:30, STINNER Victor wrote:
>
> To me, it sounds really weird to accept an encoding when a file is opened in
> binary mode. open(filename, "rb", encoding="locale") looks like a bug.
Same here.
If encoding is used as an argument and then not used, this is a bug,
not a feature :-)
On 04.05.2021 22:07, Steve Dower wrote:
>
> Perhaps what I'm suggesting here is that I don't see any reason for "sudo pip
> install ..." into a distro-installed Python to ever need to work, and would
> be quite happy for it to just fail miserably every time (which is already the
> case for the
New submission from John M. Boger :
In the documentation for sqlite3.executescript() in python 3.9+, the pseudoword
"transation" appears. I am reasonably sure "transaction" is meant, although it
could be "translation".
--
assignee: docs@python
comp
Bernhard M. Wiedemann added the comment:
ping.
Another 19th of January passed.
I'd still like to see progress on this, because this hinders my other y2038 bug
discovery work.
--
versions: +Python 3.5, Python 3.8, Python 3.9
___
Python tr
New submission from Santiago M. Mola :
PyUnicode_FromKindAndData copies input data and transforms it to the most
compact representation. This behavior is not documented.
Proposed wording:
> The input buffer is copied and transformed into the canonical representation,
> if necessar
Change by M. Eric Irrgang :
--
nosy: +eirrgang
___
Python tracker
<https://bugs.python.org/issue35083>
___
___
Python-bugs-list mailing list
Unsubscribe:
M. Eric Irrgang added the comment:
The optimization appears to have been made without this level of discussion.
The change to PEP 3119 was likely overlooked. The intended PEP 3119 behavior
seems clear and reasonable.
r61575 was a small part of the SVN merge that became git commit
M. Eric Irrgang added the comment:
Actually, it looks like performance concerns were raised as issues
[2303](https://bugs.python.org/issue2303) and
[2534](https://bugs.python.org/issue2534). For #2534, the issue was different.
For issue #2303, behavior-changing optimization was proposed
On 20.01.2021 12:07, STINNER Victor wrote:
> Maybe we should even go further in Python 3.10 and only split at "&" by
> default, but let the caller to opt-in for ";" separator as well.
+1.
Personally, I've never seen URLs encoded with ";" as query parameter
separator in practice on the server sid
On 17.02.2021 10:55, Anders Munch wrote:
import locale
locale.setlocale(locale.LC_ALL, 'en_DE')
> 'en_DE'
locale.getlocale()
> Traceback (most recent call last):
> File "", line 1, in
> File "C:\flonidan\env\Python38-64\lib\locale.py", line 591, in getlocale
> return _parse_
On 17.02.2021 15:02, Anders Munch wrote:
>> BTW: What is wxWidgets doing with the returned values ?
>
> wxWidgets doesn't call getlocale, it's a C++ library (wrapped by wxPython)
> that uses C setlocale.
>
> What does use getlocale is time.strptime and datetime.datetime.strptime, so
> when getl
New submission from M-o-T :
Hi, I found a problem with this address
https://docs.python.org/3/tutorial/introduction.html#strings
In here
>>> word[0:2] # characters from position 0 (included) to 2 (excluded)
'Py'
>>> word[2:5] # characters from position 2 (include
Change by M-o-T :
--
nosy: -mohammadtavakoli1378
___
Python tracker
<https://bugs.python.org/issue41666>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by M-o-T :
--
title: Problem in tutorial/introduction.html#strings -> fix
___
Python tracker
<https://bugs.python.org/issue41666>
___
___
Python-
New submission from Phillip M. Feldman :
I'm not sure whether this is a bug or a feature request, but it seems as though
the following should produce the same result:
In [1]: 'a' + 'b' + 'c'
Out[1]: 'abc'
In [2]: sum(('a', 'b',
Phillip M. Feldman added the comment:
I'd forgotten about ''.join; this is a good solution. I withdraw my
comment.
On Mon, Sep 7, 2020 at 3:25 PM Steven D'Aprano
wrote:
>
> Steven D'Aprano added the comment:
>
> Marco, sum should be as fast as pos
On 23.09.2020 14:56, STINNER Victor wrote:
> Marc-Andre Lemburg explained:
>
> "There is no API to unregister a codec search function, since deregistration
> would break the codec cache used by the registry to speedup codec
> lookup."
>
> One simple solution would be to clear the cache
> (PyInte
Just found an internal API which already takes care of
unregistering a search function: _PyCodec_Forget().
All that needs to be done is to expose this as codecs.unregister()
and add the clearing of the lookup cache.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the
New submission from Ian M. Hoffman :
A description of the problem, complete example code for reproducing it, and a
work-around are available on SO at the link:
https://stackoverflow.com/questions/64083376/python-memory-corruption-after-successful-return-from-a-ctypes-foreign-function
In
Ian M. Hoffman added the comment:
You are correct.
After further review, I found an older ctypes issue #12836 which was then
enshrined in a workaround in the numpy.ndarray.ctypes interface to vanilla
ctypes.
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.ctypes.html
Numpy
Ian M. Hoffman added the comment:
I agree with you. When I wrote "desired behavior" I intended it to mean "my
selfishly desired outcome of not loading my struct with a dangling pointer."
This issue seems to have descended into workarounds that treat the symptoms;
I
New submission from Thomas M. Alldread :
Several attempts to install numpy/scipy packages failed. Pip reported pages of
error information. Reverting back to version 3.8.5 resolved the issue using the
exact same procedure.
--
components: Extension Modules, Installation, Windows
Joshua M. Clulow added the comment:
Hi! I'm a member of the illumos core team, and I'm also pretty keen for us to
keep Python support! Some of our core OS build and packaging tooling is
written in Python, and certainly applications like Synapse (Matrix) and Review
Board are im
On 25.11.2020 11:13, STINNER Victor wrote:
> Platform was always a thin wrapper to OS functions. For example, there is no
> unified API to retrieve OS name and version on Windows, macOS or Linux. You
> need to pick the proper function. For me, freedesktop_os_release() just
> follows this trend.
M. Anil Tuncel added the comment:
Are they still missing? inspect.ismodule() seems to be there at least.
https://docs.python.org/3/library/inspect.html
--
nosy: +anilbey
___
Python tracker
<https://bugs.python.org/issue19
M. Anil Tuncel added the comment:
I guess the use of negative indices serve the same purpose here as in lists or
strings.
Though as Ezio pointed out, the current behaviour is already accepting negative
indices but providing inconsistent results in comparison to various other
Python modules
New submission from Bernhard M. Wiedemann:
Filesystems do not give any guarantees about ordering of files returned in
directory listings, thus tarfile.add adds files in random order, when using
os.listdir in recursion.
See also https://reproducible-builds.org/docs/stable-inputs/ on that topic
Changes by Bernhard M. Wiedemann :
--
pull_requests: +2313
___
Python tracker
<http://bugs.python.org/issue30693>
___
___
Python-bugs-list mailing list
Unsub
Bernhard M. Wiedemann added the comment:
note: recent GNU tar versions (1.28?) added an option --sort=name
and the overhead of sorting (e.g. I measured 4ms for 1 files) is negligible
compared to the other processing done on the files here
Why not simply document the fact that read ahead in Python 2.7
is not thread-safe and leave it at that ?
.next() and .readline() already don't work well together, so this
would just add one more case.
--
Marc-Andre Lemburg
eGenix.com
___
Python-bugs-l
New submission from Bernhard M. Wiedemann:
See https://reproducible-builds.org/ and
https://reproducible-builds.org/docs/buy-in/ for why this is a good thing to
have in general.
Fedora, openSUSE and possibly other Linux distributions package .pyc files as
part of their binary rpm packages
Bernhard M. Wiedemann added the comment:
backports are optional.
It can help reduce duplicated work for the various distributions.
Currently, I think master and 2.7 are the most relevant targets.
--
versions: +Python 3.7
___
Python tracker
<h
New submission from Bernhard M. Wiedemann:
Steps to Reproduce:
echo import hashlib > test.py
time python -m cProfile -s tottime test.py 2>&1 | head
Actual Results:
shows 27ms spent in hashlib.py
The problem goes away when dropping everything after line 133
in hashlib.py
see also i
Bernhard M. Wiedemann added the comment:
traced it down a bit further.
nearly all that time is spent in
import _hashlib
which probably means, it is spent in functions like PyInit__hashlib in
Modules/_hashopenssl.c
I can see in strace that after loading libssl, libcrypto and libz,
it calls
Bernhard M. Wiedemann added the comment:
I'm running openSUSE Tumbleweed with python-2.7.13 and python3-3.6.1
on an Intel Pentium N3530 with linux-4.10.12
There the total time of the "import _hashlib" oneliner varies between 100 and
250 ms (python3 is a bit slower and the machine
Bernhard M. Wiedemann added the comment:
This might work in some places, but if you look at real-world users like
urllib3/util/ssl_.py
> from hashlib import md5, sha1, sha256
or
twisted/words/protocols/jabber/xmlstream.py
> from hashlib import sha1
It would probably not need any openssl
Bernhard M. Wiedemann added the comment:
getting to a similar size on Debian, so I'll move this into the openSUSE
bugtracker to find out why it is so slow there.
--
resolution: -> third party
stage: -> resolved
status: open -> closed
Bernhard M. Wiedemann added the comment:
Tracking this in https://bugzilla.opensuse.org/show_bug.cgi?id=1038906
now.
It turned out to be a problem with (our?) openssl-1.0.2
which Debian stable does not have yet
and Debian/9 (stretch) has openssl-1.1.0 without this problem
The nicest python
New submission from Bernhard M. Wiedemann:
because POSIX readdir does not guarantee any order
glob often gives unexpectedly random results.
Some background:
for openSUSE Linux we build packages in the Open Build Service (OBS)
which tracks dependencies, so when e.g. a new glibc is submitted,
all
Changes by Bernhard M. Wiedemann :
--
pull_requests: +1877
___
Python tracker
<http://bugs.python.org/issue30461>
___
___
Python-bugs-list mailing list
Unsub
Bernhard M. Wiedemann added the comment:
>From my performance measurements, the overhead was negligible (not even
>counting the processing done on files returned by glob).
And also glob in C, bash, perl all do sort by default and these are generally
pretty fast languages, yet they still
New submission from Phillip M. Feldman :
I have a module that contains an import statement that imports a large number
of items. This import was failing with the following error message:
ImportError: DLL load failed: The specified module could not be found.
The message would be so much more
Phillip M. Feldman added the comment:
Hello Steve,
I'm buying only 50 percent of this. The Python interpreter must know what
module it was trying to import, and can at least be able to report that.
Phillip
On Tue, Mar 12, 2019 at 8:42 AM Steve Dower wrote:
>
> Steve Dower
Phillip M. Feldman added the comment:
'Should include "_ssl" somewhere in the message?' Exactly so. If a given
import statement imports 30 items, it would be helpful to know which one
caused the hickup. Thanks!
On Wed, Mar 13, 2019 at 12:28 PM Steve Dower wrote:
&g
Bernhard M. Wiedemann added the comment:
unreproducible .pyc files are still one of the major headaches for my work on
openSUSE reproducible builds.
There is also one aspect where i586 builds end up with different .pyc files
than x86_64 builds. And then we randomly chose one of them for our
New submission from Bernhard M. Wiedemann :
While working on reproducible builds for openSUSE, I found countless python
modules that come with binary .so files that did not build reproducibly from
non-deterministic filesystem readdir order.
One contributing factor is bpo-30461 that will not
Change by Bernhard M. Wiedemann :
--
keywords: +patch
pull_requests: +12308
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Bernhard M. Wiedemann added the comment:
I think, there is no single nice and clean solution with time-based .pyc files,
but to get a whole distribution to build reproducibly, there are two other ways:
1) if the SOURCE_DATE_EPOCH environment variable is set,
make hash-based .pyc files the
Change by Bernhard M. Wiedemann :
--
keywords: +patch
pull_requests: +5054
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue29708>
___
_
Bernhard M. Wiedemann added the comment:
Any chance we can get the (somewhat related) patch for
https://bugs.python.org/issue30693 also merged?
--
___
Python tracker
<https://bugs.python.org/issue29
Bernhard M. Wiedemann added the comment:
@Serhiy IMHO, just because we fix one problem, we do not have to fix all other
problems at the same time. You can still open a pull-request for the others,
but I know too little about those to test them.
And having commits pending for 7 months is not
Change by Bernhard M. Wiedemann :
--
keywords: +patch
pull_requests: +5379
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Bernhard M. Wiedemann added the comment:
Serhiy, can you test https://github.com/python/cpython/pull/5557
--
___
Python tracker
<https://bugs.python.org/issue30
New submission from Mariano M. Chouza :
When trying to import a module from a ZIP archive containing more than 65535
files, the import process fails:
$ python3 -VV
Python 3.6.4 (default, Jan 6 2018, 11:49:38)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
$ cat create_zips.py
New submission from M J Harvey :
Hi,
multiprocessing's default assumption about Pool size is os.cpu_count() ie all
the cores visible to the OS.
This is tremendously unhelpful when running multiprocessing code inside an HPC
batch system (PBS Pro in my case), as there's no way to h
I'm not sure whether this is related, but your quoting for --rpath
doesn't appear to work:
On 10.10.2017 14:17, Brian Sidebotham wrote:
> LDFLAGS='-Wl,-rpath=$\\$$ORIGIN/../lib' \
> ...
> gcc -pthread -Wl,-rpath=RIGIN/../lib -fprofile-generate -Xlinker
> -export-dynamic -o python \
>
Stephen M. Gava added the comment:
Using a set of paths with special properties and formats in a project, thought
"the cleanest oop way to do this is try out python's oop paths in pathlib".
Subclassed Path to implement my extra (non platfor specific) properties and
fell at t
201 - 300 of 456 matches
Mail list logo