[issue45326] Unexpected TypeError with type alias+issubclass+ABC

2021-09-29 Thread Dmitry Marakasov
New submission from Dmitry Marakasov : Here's a curious problem. issubclass() check of a type against an ABC-derived class raises TypeError claiming that type is not a class, however inspect.isclass() says it's a class, and issubclass() check against a simple class works fine: ``

[issue45633] Py_GT listed twice in Doc/extending/newtypes.rst

2021-10-29 Thread Dmitry Smirnov
Change by Dmitry Smirnov : -- keywords: +patch nosy: +dmitrysmirnov931 nosy_count: 2.0 -> 3.0 pull_requests: +27588 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29318 ___ Python tracker <https://bugs.p

[issue45767] Fix types for dev_t processing in posix module

2021-11-09 Thread Dmitry Marakasov
New submission from Dmitry Marakasov : So, I was investigating a test failure of python 3.11 and 3.10 on FreeBSD (but it likely applies to all python versions): == FAIL: test_makedev (test.test_posix.PosixTester

[issue45767] Fix types for dev_t processing in posix module

2021-11-09 Thread Dmitry Marakasov
Change by Dmitry Marakasov : -- pull_requests: +27743 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29494 ___ Python tracker <https://bugs.python.org/issu

[issue45767] Fix types for dev_t processing in posix module

2021-11-09 Thread Dmitry Marakasov
Dmitry Marakasov added the comment: In case you're curious, here are some st_dev values which are encountered on my FreeBSD: - 0xac2308de99d1f699 - ZFS - 0x7100ff00 - devfs - 0x8700ff01 - tmpfs - 0x2900ff4e - nullfs I suspect Linux uses smaller numbers which do not cause overflo

[issue38744] python 3.8 hang in multiprocessing.Pool() locking on FreeBSD

2019-11-13 Thread Dmitry Marakasov
Dmitry Marakasov added the comment: > What happens if you instead write: It survived more than 4000 runs, it looks like it doesn't experience the problem. -- ___ Python tracker <https://bugs.python.org

[issue30483] urllib.parse.parse_qsl does not handle unicode data properly

2020-04-16 Thread Dmitry Tsirkov
Dmitry Tsirkov added the comment: I have recently stumbled upon this bug, and I can present the example and a solution I've used. The issue happens when we try to parse x-www-form-urlencoded of type bytes: ``` >>> from urllib.parse import urlencode, parse_qs >>> urlenco

[issue42859] smtplib: recipe for certifying message delivery

2021-01-07 Thread Dmitry Goldenberg
New submission from Dmitry Goldenberg : Is there a reliable way to certify (ensure, track) the delivery of an email message when using smtplib? For example: Disposition-Notification-To message header which enables the e-mail reader of the recipient to send confirmation e-mail when the

[issue42859] smtplib: recipe for certifying message delivery

2021-01-07 Thread Dmitry Goldenberg
Dmitry Goldenberg added the comment: Yes, it's a question which could lend itself well to a documentation issue. I've looked at things like: https://stackoverflow.com/questions/54047021/python-smtplib-how-to-use-disposition-notification-to https://stackoverflow.com/questions/40369

[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2012-03-18 Thread Dmitry Shachnev
New submission from Dmitry Shachnev : Currently my /usr/lib/python3.2/email/encoders.py has this code: def _qencode(s): enc = _encodestring(s, quotetabs=True) # Must encode spaces, which quopri.encodestring() doesn't do return enc.replace(' ', '=20&#x

[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2012-03-18 Thread Dmitry Shachnev
Changes by Dmitry Shachnev : -- type: crash -> behavior ___ Python tracker <http://bugs.python.org/issue14360> ___ ___ Python-bugs-list mailing list Unsubscri

[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2012-03-21 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: (Sorry for not replying earlier). I think the main priority here is getting things working, not the tests (so I have little interest in that). First of all, should quopri.encodestring() really return bytes? Everything it returns is ascii text, obviously

[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2012-03-21 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: > In fact, there's really no reason to call an encode_ method at all, since if > you pass a string to MIMEText when giving it a non-ascii unicode string, it > will default to utf-8 and do the appropriate CTE encoding. No, it doesn'

[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2012-03-21 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: > You can get it to work by explicitly passing the charset Thanks, I didn't know about that. > Given the above, do you need it anymore? No. -- ___ Python tracker <http://bugs.python.

[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2012-03-21 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: > Then, which types of argument should encode_* functions take (I think str > should be supported, and it's not a case here as encode_quopri will only > accept bytes)? I meant which types of *payload* should they accept. Here's an illu

[issue37007] Implement socket.if_{nametoindex, indextoname} for Windows

2019-05-22 Thread Dmitry Tantsur
New submission from Dmitry Tantsur : These two calls are currently Unix-only in the socket module. However, Windows supports them starting with Vista: https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-if_indextoname https://docs.microsoft.com/en-us/windows/desktop/api

[issue37007] Implement socket.if_{nametoindex, indextoname} for Windows

2019-05-24 Thread Dmitry Tantsur
Dmitry Tantsur added the comment: That would be fantastic, but I did not dare asking for it :) This is how the output of if_nameindex looks on my Fedora 29: [(1, 'lo'), (2, 'enp0s31f6'), (3, 'wlp4s0'), (4, 'virbr0'), (5, 'virbr0-nic'),

[issue37504] 3.8 b2 now requires sphinx2, but only has documented 1.8

2019-07-05 Thread Dmitry Shachnev
Change by Dmitry Shachnev : -- nosy: +mitya57 ___ Python tracker <https://bugs.python.org/issue37504> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37504] 3.8 b2 now requires sphinx2, but only has documented 1.8

2019-07-05 Thread Dmitry Shachnev
Change by Dmitry Shachnev : -- keywords: +patch pull_requests: +14421 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14606 ___ Python tracker <https://bugs.python.org/issu

[issue37504] Documentation fails to build when using Sphinx' texinfo builder

2019-07-05 Thread Dmitry Shachnev
Change by Dmitry Shachnev : -- title: 3.8 b2 now requires sphinx2, but only has documented 1.8 -> Documentation fails to build when using Sphinx' texinfo builder ___ Python tracker <https://bugs.python.org

[issue29304] dict: simplify lookup function

2017-06-14 Thread Dmitry Rubanovich
Dmitry Rubanovich added the comment: lookdict_index() (and the rest of the files in dictobject.c) are using unnecessarily complicated perturb mechanism. And, in fact, it's slower than the simpler case. Instead of this: for (size_t perturb = hash;;) { perturb >>= PERTURB_S

[issue30671] dict: simplify and improve lookup function

2017-06-15 Thread Dmitry Rubanovich
New submission from Dmitry Rubanovich: lookdict_index() (and the rest of the files in dictobject.c) are using unnecessarily complicated perturb mechanism. And, in fact, it's slower than the simpler case. Instead of this: for (size_t perturb = hash;;) { perturb >>= PERTURB_S

[issue30671] dict: simplify and improve lookup function

2017-06-15 Thread Dmitry Rubanovich
Dmitry Rubanovich added the comment: I am looking at the 3.6.1 code. I am not trying to simulate the index lookup as the lookup function would do it. There is no point in that. The point of the script is to detect collisions among perturbed secondary indexes rather than between primary

[issue30671] dict: simplify and improve lookup function

2017-06-15 Thread Dmitry Rubanovich
Dmitry Rubanovich added the comment: Yes, I do understand it. But the statement in lines 166, 167: "For any initial j in range(2**i), repeating that 2**i times generates each int in range(2**i) exactly once" does not hold when the perturb is added. 2**i times will not be enough t

[issue30671] dict: simplify and improve lookup function

2017-06-15 Thread Dmitry Rubanovich
Dmitry Rubanovich added the comment: Tim, I am not testing randomly. The scripts calculate secondary hash for **each** value in a ring to see how often this results in duplicate (or triplicate, etc.) values. And they do it for each (mod 2**i) ring for i between 8 and 20. Then (mostly as an

[issue30671] dict: improve lookup function

2017-06-16 Thread Dmitry Rubanovich
Dmitry Rubanovich added the comment: Changing the title, to remove "simplify", since the discussion revealed that the potential improvement would have to be treated as a special case and, therefore, would not simplify the code. -- title: dict: simplify and improve looku

[issue30671] dict: improve lookup function

2017-06-18 Thread Dmitry Rubanovich
Dmitry Rubanovich added the comment: A few notes on my motivation and other comments I made(not necessarily in the order of significance): 1. I started looking at this because of the fix in Issue28201. It effectively improves on the difference between print_collision_counts

[issue30876] SystemError on importing module from unloaded package

2017-07-26 Thread Dmitry K
Dmitry K added the comment: test_concurrency (test.test_import.ImportTests) seems to fail, too, with a similar error: ModuleNotFoundError: No module named 'package' Apparently, this happens because the LIBSUBDIRS variable in Makefile doesn't include all the subdire

[issue30876] SystemError on importing module from unloaded package

2017-07-26 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: Please ignore my last message, I didn't notice the existing pull request... Sorry. -- ___ Python tracker <http://bugs.python.org/is

[issue31094] asyncio: get list of connected clients

2017-07-31 Thread Dmitry Vinokurov
New submission from Dmitry Vinokurov: Hi! I'm using python-opcua and wonder if it is possible to get list of clients connected to running server? I've asked such question in python-opcua repo https://github.com/FreeOpcUa/python-opcua/issues/480 and developers redirected me here.

[issue31096] asyncio.stream.FlowControlMixin._drain_helper may lead to a blocking behavior

2017-08-01 Thread Dmitry Malinovsky
New submission from Dmitry Malinovsky: When there is a huge amount of `writer.write` calls followed by `await writer.drain()` on a non-paused channel, and there are no other coroutine switches, `await writer.drain()` immediately returns without a switch. This is because

[issue16217] Tracebacks are unnecessarily verbose when using 'python -m'

2017-08-22 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: In order to load and compile the module code, runpy calls the loader's get_code method. Because that happens outside of the normal import process, and PyImport_ImportModuleLevelObject is currently the only place where remove_importlib_frames is being in

[issue16217] Tracebacks are unnecessarily verbose when using 'python -m'

2017-08-28 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: Since runpy also handles the execution of directories and zip files, I think it would be reasonable to clean up tracebacks in these cases, too. The ignore_modules argument would be a great addition to the traceback module. Should I create a separate issue

[issue31299] Add "ignore_modules" option to TracebackException.format()

2017-08-29 Thread Dmitry Kazakov
Changes by Dmitry Kazakov : -- pull_requests: +3274 ___ Python tracker <http://bugs.python.org/issue31299> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31560] hashlib.blake2: error in example for signed cookies

2017-09-23 Thread Dmitry Chestnykh
New submission from Dmitry Chestnykh: The example for creating and verifying signed cookies with hashlib.blake2 doesn't work. Corrected in GitHub PR #3694. -- assignee: docs@python components: Documentation messages: 302787 nosy: dchest, docs@python priority: normal pull_requests:

[issue31299] Add "ignore_modules" option to TracebackException.format()

2019-01-26 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: It would seem no one is actually interested in this proposed enhancement. I'm closing my PR, since I'm not interested in resolving the file conflict. I'll probably submit a traceback-mutating patch to the issue 16217. This issue

[issue31299] Add "ignore_modules" option to TracebackException.format()

2019-01-26 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- pull_requests: -5065 ___ Python tracker <https://bugs.python.org/issue31299> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31299] Add "ignore_modules" option to TracebackException.format()

2019-01-26 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- pull_requests: +11522 ___ Python tracker <https://bugs.python.org/issue31299> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31299] Add "ignore_modules" option to TracebackException.format()

2019-01-26 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- pull_requests: -11522 ___ Python tracker <https://bugs.python.org/issue31299> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31299] Add "ignore_modules" option to TracebackException.format()

2019-01-26 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- nosy: -vaultah ___ Python tracker <https://bugs.python.org/issue31299> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35916] 3.6.5 try/except/else/finally block executes code with typos, no errors

2019-02-06 Thread DMITRY KOSHELEV
New submission from DMITRY KOSHELEV : Hello dear developer! I was playing with try/else/finally block and have found a bug: Inside of "else" or/and "except" I can do this 1 + print('Why do you print me?') + 1 this would print "Why do you print me?",

[issue36527] unused parameter warnings in Include/object.h (affecting building third party code)

2019-04-04 Thread Dmitry Marakasov
New submission from Dmitry Marakasov : Python 3.8 and nightly introduces unused (in some cases) parameters in object.h header. This makes compilation of third party code which includes the header fail if it's built with -Werror. Build log excerpt: --- g++ -Wno-unused-result -Wsign-co

[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2019-05-06 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- pull_requests: -4438 ___ Python tracker <https://bugs.python.org/issue31841> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27639] UserList.__getitem__ doesn't account for slices

2019-05-06 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- pull_requests: -4870 ___ Python tracker <https://bugs.python.org/issue27639> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2019-05-07 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- pull_requests: +13067 ___ Python tracker <https://bugs.python.org/issue31841> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2019-05-07 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- pull_requests: -13067 ___ Python tracker <https://bugs.python.org/issue31841> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27639] UserList.__getitem__ doesn't account for slices

2019-05-07 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- pull_requests: +13069 ___ Python tracker <https://bugs.python.org/issue27639> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31299] Add "ignore_modules" option to TracebackException.format()

2018-01-16 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- pull_requests: +5065 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issue31299> ___ ___ Python-

[issue32743] Typo in hamt.c comments

2018-02-01 Thread Dmitry Alimov
New submission from Dmitry Alimov : In the comments to `hamt_node_collision_without` function in hamt.c module, I think should be `so convert` instead of `co convert`: ``` if (new_count == 1) { /* The node has two keys, and after deletion the

[issue32743] Typo in hamt.c comments

2018-02-01 Thread Dmitry Alimov
Change by Dmitry Alimov : -- keywords: +patch pull_requests: +5307 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32743> ___ ___ Py

[issue32744] PEP 342 double colons typos in code

2018-02-01 Thread Dmitry Alimov
New submission from Dmitry Alimov : I've found "double colons" typos in examples: @consumer def jpeg_writer(dirname):: # 1) here fileno = 1 and try: while self.running and self.queue:: # 2) here func = self.queue.popleft() --

[issue32744] PEP 342 double colons typos in code

2018-02-01 Thread Dmitry Alimov
Dmitry Alimov added the comment: https://github.com/python/peps/pull/567 -- ___ Python tracker <https://bugs.python.org/issue32744> ___ ___ Python-bugs-list m

[issue32744] PEP 342 double colons typos in code

2018-02-01 Thread Dmitry Alimov
Dmitry Alimov added the comment: Merged. It's fixed now: https://www.python.org/dev/peps/pep-0342/ -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue32743] Typo in hamt.c comments

2018-02-02 Thread Dmitry Alimov
Dmitry Alimov added the comment: Fixed -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue18777] Cannot compile _ssl.c using openssl > 1.0

2018-02-21 Thread Dmitry Zotikov
Dmitry Zotikov added the comment: James, double check you specify the right path to the local system libraries. If the system is multilib, libssl resides in /usr/local/lib/hpux32 (64) and not in /usr/local/lib directly. -- nosy: +dmitry.zotikov

[issue21611] int() docstring - unclear what number is

2018-03-16 Thread Dmitry Andreychuk
Dmitry Andreychuk added the comment: I created this issue almost 4 years ago. Looking at it now, I think that I was asking too much of that docstring. I believe it's current version quite sufficient. I would close the issue, but I'm not sure if it's up

[issue32625] Update the dis module documentation to reflect switch to wordcode

2018-05-03 Thread Dmitry Alimov
Dmitry Alimov added the comment: The documentation for EXTENDED_ARG opcode should also be updated for Python versions 3.6, 3.7, 3.8. -- nosy: +delimitry versions: +Python 3.6, Python 3.8 ___ Python tracker <https://bugs.python.org/issue32

[issue31299] Add "ignore_modules" option to TracebackException.format()

2017-09-24 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: Yes, a public built-in facility to modify a traceback would certainly be useful, although there should be a standard way to "hide" unwanted frames without mutating the traceback, too, and the traceback module seems a perfect place to add it.

[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2017-10-22 Thread Dmitry Kazakov
New submission from Dmitry Kazakov : A few of the methods of collections.UserString return objects of type str when one would expect instances of UserString or a subclass. Here's an example for UserString.join: >>> s = UserString(', ').join(['a', 'b&

[issue31299] Add "ignore_modules" option to TracebackException.format()

2017-10-24 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: Ping. (this issue needs a decision on ignore_modules vs filter callback, and/or patch review) -- ___ Python tracker <https://bugs.python.org/issue31

[issue31906] String literals next to each other does not cause error

2017-10-30 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: This is a documented feature: https://docs.python.org/3/reference/lexical_analysis.html#string-literal-concatenation And yes, it was discussed before: https://mail.python.org/pipermail/python-ideas/2013-May/020527.html -- nosy: +vaultah

[issue31299] Add "ignore_modules" option to TracebackException.format()

2017-11-09 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: I only recently realized that trace.Trace accepts two similar arguments, namely ignoremods and ignoredirs. Should we try to make the API and implementation of the functionality proposed here conform to that of trace.Trace's ignoremods? Would Python-Ide

[issue31299] Add "ignore_modules" option to TracebackException.format()

2017-11-21 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- pull_requests: -3274 ___ Python tracker <https://bugs.python.org/issue31299> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2017-11-22 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- keywords: +patch pull_requests: +4438 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31841> ___ ___ Py

[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2017-11-22 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: I added a PR. FWIW, I still think it would make sense to change the return type of UserString.join, and maybe *split* and *partition methods (to return list/tuple of UserString objects) for the sake of consistency

[issue32194] When creating list of dictionaries and updating datetime objects one by one, all values are set to last one of the list.

2017-12-01 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: This is not a bug in Python. Refer to this page for the explanation: https://stackoverflow.com/questions/240178/list-of-lists-changes-reflected-across-sublists-unexpectedly Basically, [{}]*3 creates a list with three references to the same dictionary

[issue32376] Unusable syntax error reported when Python keyword in a f-string

2017-12-19 Thread Dmitry sky
New submission from Dmitry sky : def get_search_url(from_, to): return f"http://thesite.com/Search?SO0={from_}&SD0={to}&SD1={from}&NA=false"; # pls note `from_` vs `from` ^^ $ python fstring.py File "", line 1

[issue27639] UserList.__getitem__ doesn't account for slices

2017-12-22 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- pull_requests: +4870 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issue27639> ___ ___ Python-

[issue27639] UserList.__getitem__ doesn't account for slices

2017-12-22 Thread Dmitry Kazakov
Change by Dmitry Kazakov : -- nosy: +vaultah ___ Python tracker <https://bugs.python.org/issue27639> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31096] asyncio.stream.FlowControlMixin._drain_helper may lead to a blocking behavior

2018-05-25 Thread Dmitry Malinovsky
Dmitry Malinovsky added the comment: I've changed the implementation significantly since August 2017, futures are not involved anymore so please ignore that part. However, such drain behavior is still present - but I don't think anymore that yielding to the event loop is an easy

[issue1222585] C++ compilation support for distutils

2018-07-03 Thread Dmitry Kalinkin
Change by Dmitry Kalinkin : Added file: https://bugs.python.org/file47669/python-3.8-distutils-C++.patch ___ Python tracker <https://bugs.python.org/issue1222

[issue31299] Add "ignore_modules" option to TracebackException.format()

2018-10-20 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: I asked for some input on this issue in January (https://mail.python.org/pipermail/python-dev/2018-January/151590.html). Since then an important PR was merged (https://github.com/python/cpython/pull/4793), however it mutates the traceback object. Should

[issue22543] -W option cannot use non-standard categories

2018-11-12 Thread Dmitry Shachnev
Change by Dmitry Shachnev : -- nosy: +mitya57 ___ Python tracker <https://bugs.python.org/issue22543> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2013-07-06 Thread Dmitry Jemerov
New submission from Dmitry Jemerov: On Mac OS X 10.8 with the default language set to English (System Preferences | Language and Text), the default terminal application sets the LC_CTYPE environment variable to "UTF-8". If you run Python from the terminal and t

[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2013-07-06 Thread Dmitry Jemerov
Dmitry Jemerov added the comment: Judging from the results of Googling for the error message, I'm far from the only one seeing this problem. What exactly would be the benefit of adding the code to check for the platform? -- ___ Python tr

[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2013-07-06 Thread Dmitry Jemerov
Dmitry Jemerov added the comment: Why exactly does this matter? UTF-8 not being a valid LC_CTYPE value simply means that no one running Linux will ever have LC_CTYPE set to UTF-8, and the branch will never be hit. OTOH, adding the check will make the code harder to test and simply larger (no

[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2013-07-06 Thread Dmitry Jemerov
Dmitry Jemerov added the comment: A related issue (with a patch that touches the same locale parsing code) is http://bugs.python.org/issue5815 -- ___ Python tracker <http://bugs.python.org/issue18

[issue5815] locale.getdefaultlocale() missing corner case

2013-07-06 Thread Dmitry Jemerov
Dmitry Jemerov added the comment: A related issue (a case which isn't taken into account by Serhiy's patch) is http://bugs.python.org/issue18378 -- nosy: +Dmitry.Jemerov ___ Python tracker <http://bugs.python.

[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2013-07-10 Thread Dmitry Jemerov
Dmitry Jemerov added the comment: I personally don't, but the function is used by Sphinx, which is what I was trying to get to work when I ran into this problem. -- ___ Python tracker <http://bugs.python.org/is

[issue14648] Attempt to format ascii and non-ascii strings together fails with "... UCS2 ..."

2012-04-23 Thread Dmitry Dvoinikov
New submission from Dmitry Dvoinikov : Using Python 3.3.0a2 (default, Apr 1 2012, 19:34:58) [MSC v.1500 64 bit (AMD64)] on win32. This line of code "{0:s}{1:s}".format("ABC", "\u0410\u0411\u0412") results in SystemError: Cannot copy UCS2 characters int

[issue14983] [patch] email.generator should always add newlines after closing boundaries

2012-06-01 Thread Dmitry Shachnev
New submission from Dmitry Shachnev : Trying to write a email-sending script with PGP-signing functionality, I stumbled upon a problem (see [1]): it was impossible to sign mutlipart emails (actually the signing was performed, but the verifying programs thought that the signature is bad

[issue14380] MIMEText should default to utf8 charset if input text contains non-ASCII

2012-06-02 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: Maybe it'll be better to use 'latin-1' charset for latin-1 texts? Something like this: if _charset == 'us-ascii': try: _text.encode(_charset) except UnicodeEncodeError: try: _text.encode(

[issue14983] email.generator should always add newlines after closing boundaries

2012-06-02 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: > Looking at your stackoverflow post, you might be able to fix this by doing an > rstrip on the string body before signing it. My body doesn't end with \n, so that doesn't help. If you suggest me any (easy) way to fix this on the level of m

[issue14983] email.generator should always add newlines after closing boundaries

2012-06-02 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: > By 'body' I actually meant the multipart part you are signing. Yes, I've understood you, and I mean the same :) The signature is created against the not-ending-with-newline string, in any case. --

[issue14983] email.generator should always add newlines after closing boundaries

2012-06-03 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: > Hmm. So that means the verifiers are not paying attention to the MIME > RFC? > That's unfortunate. It seems that's true... -- ___ Python tracker <http://bugs

[issue7304] email.message.Message.set_payload and as_string given charset 'us-ascii' plus 8bit data produces invalid message

2012-06-06 Thread Dmitry Shachnev
Changes by Dmitry Shachnev : -- nosy: +mitya57 ___ Python tracker <http://bugs.python.org/issue7304> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15016] [patch] add special case for latin messages in email.mime.text

2012-06-06 Thread Dmitry Shachnev
New submission from Dmitry Shachnev : (Follow-up to issue 14380) The attached patch makes the email.mime.text.MIMEText constructor use the iso-8859-1 (aka latin-1) encoding for messages where all characters are in range(256). This also makes them use quoted-printable transfer encoding instead

[issue15016] [patch] add special case for latin messages in email.mime.text

2012-06-06 Thread Dmitry Shachnev
Changes by Dmitry Shachnev : -- keywords: +patch Added file: http://bugs.python.org/file25845/issue_15016.patch ___ Python tracker <http://bugs.python.org/issue15

[issue15016] [patch] add special case for latin messages in email.mime.text

2012-06-06 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: Updated the patch: - Avoid using letter Ш in test, it's better to use chr(256) as the test case; - Updated the comment in MIMEText constructor to reflect the new behaviour. -- hgrepos: +135 Added file: http://bugs.python.org/file25846/issue_150

[issue15016] [patch] add special case for latin messages in email.mime.text

2012-06-06 Thread Dmitry Shachnev
Changes by Dmitry Shachnev : -- hgrepos: -135 ___ Python tracker <http://bugs.python.org/issue15016> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15016] [patch] add special case for latin messages in email.mime.text

2012-06-06 Thread Dmitry Shachnev
Changes by Dmitry Shachnev : Removed file: http://bugs.python.org/file25845/issue_15016.patch ___ Python tracker <http://bugs.python.org/issue15016> ___ ___ Python-bug

[issue15016] Add special case for latin messages in email.mime.text

2012-06-06 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: Done, sent an e-mail to contribut...@python.org. -- ___ Python tracker <http://bugs.python.org/issue15016> ___ ___ Python-bug

[issue15016] Add special case for latin messages in email.mime.text

2012-06-23 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: > This seems to be an enhancement sort of request rather than a bug... so I > wonder why Python 3.2 is listed? Fixed. > ... although I see nothing in the PEP about how to access that information > from Python. You are right, it seems there

[issue15524] Dict items() ordering varies across interpreter invocations

2012-08-01 Thread Dmitry Dvoinikov
New submission from Dmitry Dvoinikov: The following line prints different things each time you run it: python3 -c "print(', '.join({ '1': '2', '3': '4' }.keys()))" The output is either "1, 3" or "3, 1". Is such ind

[issue15534] xmlrpc escaping breaks on unicode \u043c

2012-08-02 Thread Dmitry Dvoinikov
New submission from Dmitry Dvoinikov: For the following script import xmlrpc.client; from xmlrpc.client import escape text = "...\u043c..<" print(escape(text)) Python 3.3.0b1 produces ...ь..<...<

[issue15570] email.header.decode_header parses differently

2012-08-06 Thread Dmitry Dvoinikov
New submission from Dmitry Dvoinikov: The following script --- import email.header print(email.header.decode_header("foo =?windows-1251?Q?bar?=")) --- produces [(b'foo', None), (b'bar', 'windows-1251')] in Python 3.2 but [(b'foo ', N

[issue21478] mock calls don't propagate to parent (autospec)

2014-05-12 Thread Dmitry Andreychuk
New submission from Dmitry Andreychuk: Calls to autospecced mock functions are not recorded to mock_calls list of parent mock. This only happens if autospec is used and the original object is a function. Example: import unittest.mock as mock def foo(): pass parent = mock.Mock

[issue21611] int() docstring - unclear what number is

2014-05-30 Thread Dmitry Andreychuk
New submission from Dmitry Andreychuk: https://docs.python.org/3.4/library/functions.html?highlight=int#int The docstring for int() function has these sentences: "If x is a number, return x.__int__()." "If x is not a number or if base is given..." Unfortunately the docstr

[issue21611] int() docstring - unclear what number is

2014-06-01 Thread Dmitry Andreychuk
Dmitry Andreychuk added the comment: Now I see that my message may look like a suggestion to add an encyclopedic definition of number there. Sorry. Actually I was talking about requirements for user-defined types to make them work with int(). Something like: "If x has __int__() method r

[issue21706] Add base for enumerations (Functional API)

2014-06-10 Thread Dmitry Korchemny
New submission from Dmitry Korchemny: In enum module the functional API for enum creation has the following signature: Enum(value='NewEnumName', names=<...>, *, module='...', qualname='...', type=) so that the numeration always starts with 1. In some cases

<    1   2   3   4   >