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
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
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
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.
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
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 \
>
On 22.11.2017 08:40, Serhiy Storchaka wrote:
> Usually the read() method of a file-like object takes one optional argument
> which limits the amount of data (the number of bytes or characters) returned
> if specified.
>
> codecs.StreamReader.read() also has such parameter. But this is the second
On 27.12.2017 00:24, Antoine Pitrou wrote:
>
> Antoine Pitrou added the comment:
>
>> +1 - do you have any thoughts on that?
>
> I think the current scheme may have been useful at a time where DVCS didn't
> exist. You would maintain an unversioned copy of Modules/Setup.dist in your
> work-tr
On 24.05.2014 15:55, Brandon wrote:
>
> Observe the following code:
>
> import MySQLdb, MySQLdb.cursors, datetime
> """ ... mysqlCursor is a cursor object from a connection to database from the
> MySQLdb module ... """
> mysqlCursor.execute("SELECT NOW()")
> timeRow = mysqlCursor.fetchall()
> cu
On 15.06.2014 15:02, Mark Lawrence wrote:
>
> What's the status of this issue, as we've lived with this really slow
> implementation for well over three years?
I guess it just needs someone to write a patch.
Note that encoding lookups are cached, so the slowness only
becomes an issue if you loo
On 08.07.2014 11:40, Stefano Borini wrote:
>
> You can't use subprocess. platform is used during build. subprocess needs
> select, but select is a compiled module and at that specific time in the
> build process is not compiled yet.
Good point :-)
--
Marc-Andre Lemburg
eGenix.com
___
On 01.02.2017 10:14, Christian Heimes wrote:
>
> PEP 456 defines an API to add more hashing algorithms and make the selection
> of hash algorithm a compile time option. We can easily add SipHash-1-3 and
> make it the default algorithm. Vendors then can select between FNV2,
> SipHash-1-3 and Sip
On 17.02.2017 13:06, STINNER Victor wrote:
>> Alternatively, sysconfig data could be made available via a C lookup
>> function; with the complete dictionary only being created on demand.
>> get_config_var() already is such a lookup API which could be used as
>> front-end.
>
> I don't think that
On 07.06.2016 22:27, Theodore Tso wrote:
>
> Secondly, when I decided to add this behavior to getrandom(2), it was because
> people were really worried that people would be using /dev/urandom for
> security-critical things (e.g., initializing ssh host session keys, when
> they'd _really_ rather
On 16.12.2014 21:28, Steve Dower wrote:
>
> Steve Dower added the comment:
>
>> get_platform() will be difficult to reuse, for bootstrapping reasons
>
> ISTM that if you can't determine the value at compile time, then it doesn't
> matter to compilation enough to need to appear in the tag.
Anto
Adding a note to the documentation is fine.
The .reset() method doesn't have anything to do with the underlying
stream. It's only meant to work at the codec level and needed for
codecs that keep internal state.
--
Marc-Andre Lemburg
eGenix.com
___
Pyt
On 15.01.2015 05:43, Martin Panter wrote:
>
> New patch that also fixes StreamWriter.writelines() in general for the byte
> codecs
Could you explain this new undocumented class ?
+class _IncrementalBasedWriter(StreamWriter):
+"""Generic StreamWriter implementation.
+
+The _EncoderCl
On 01.07.2015 00:16, Min RK wrote:
>
>> Just because a feature can be misused doesn't make it a bad feature.
>
> That's fair. I'm just not aware of any uses of this feature that aren't
> misuses, hence the patch.
I don't remember the details of why this feature was added,
but can imagine that i
On 15.08.2015 22:41, Steve Dower wrote:
>
> Marc-Andre: there are a few concerns with including DLLs that aren't new with
> any of the 3.5 changes.
>
> * depending on another CRT version is fine *if* it is available (users may
> have to be told/helped to install the redistributable themselves)
On 29.09.2015 11:31, Akira Li wrote:
>
> Akira Li added the comment:
>
>> Would issue22798.diff patch address your issue?
>
> No. The issue is that C mktime() may update C tzname on some platforms
> but time.mktime() does not update time.tzname on these platforms while
> the time module docs su
On 03.02.2016 18:05, STINNER Victor wrote:
>
>> python -m timeit "sum([x * x * 1 for x in range(100)])"
>
> If you only want to benchmark x*y, x+y and list-comprehension, you
> should use a tuple for the iterator.
... and precalculate that in the setup:
python -m timeit -s "loops=tuple(range(1
On 05.02.2016 16:14, STINNER Victor wrote:
>
> Please don't. I would like to have time to benchmark all these patches (there
> are now 9 patches attached to the issue :-)) and I would like to hear
> Serhiy's feedback on your latest patches.
Regardless of the performance, the fastint5.patch look
FWIW: I just ran into a situation where the new approach resulted
in pip, setuptools and zc.buildout not working anymore.
This was on an AIX system which did come with CA root certificates
at all.
Now, I knew how to fix this, but the solution was not
an obvious one. I had to use truss to figure o
On 05.04.2015 22:49, Donald Stufft wrote:
>
> Donald Stufft added the comment:
>
>> I don't consider monkey patching a proper way to configure a Python
>> installation.
>
> The point is that that TLS validation on/off isn't conceptually a Python level
> configuration option, that's going to be a
On 15.09.2016 11:11, STINNER Victor wrote:
>
> STINNER Victor added the comment:
>
> Hum, since the discussion restarted, I reopen the issue ...
>
> "Well, pybench is not just one benchmark, it's a whole collection of
> benchmarks for various different aspects of the CPython VM and per concept
36 matches
Mail list logo