Samuel Marks added the comment:
Just fixed the issue by using this value:
```py
"```(None)```" if sys.version_info[:2] >= (3, 9) else "```None```"
```
--
stage: -> resolved
status: open -> closed
___
Python trac
New submission from Samuel Marks :
astor fails with:
```
File "python3.8/site-packages/astor/code_gen.py", line 63, in to_source
generator.visit(node)
File "python3.8/site-packages/astor/node_util.py", line 143, in visit
return visitor(node)
File "pyth
Change by Samuel Tatasurya :
--
keywords: +patch
nosy: +samtatasurya
nosy_count: 1.0 -> 2.0
pull_requests: +27381
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17096
___
Python tracker
<https://bugs.p
Samuel Colvin added the comment:
Perhaps worth adding that the tests don't fail on python 3.6, 3.7 or 3.8.
--
nosy: +samuelcolvin
___
Python tracker
<https://bugs.python.org/is
Samuel Marks added the comment:
Fixed with https://github.com/offscale/cdd-python/commit/079dc28
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/i
Samuel Marks added the comment:
Hmm, debugging my test and I was able to replicate it with this smaller one:
```
from ast import FunctionDef, arguments, Load, Name, AnnAssign, Store, BinOp,
Add, unparse
unparse(FunctionDef(args=arguments(args=[],
defaults
New submission from Samuel Marks :
I tried making `node.annotation` an `ast.Name("str", ast.Load())`, which worked
but when the AST was unparsed to a string it shows as `# type: `.
https://github.com/offscale/cdd-python/runs/3213864077
Replicate with:
```
unparse(Assign(annot
Samuel Henrique added the comment:
Hello Vinay Sajip,
I would like to kindly ask you to please reconsider and give your thoughts on
my description of the issue here.
Let me try to work based on your last reply:
> ...has been around since Jan 2008, and it seems that no one in that time
Samuel Marks added the comment:
Yep exactly like my screenshot but now the Polish has turned Korean… my family
was never Korean!
--
___
Python tracker
<https://bugs.python.org/issue44
New submission from Samuel Marks :
It's been too long since my family have been Polish!
(see screenshot of https://docs.python.org/3.11/library/parser.html )
My computer is only configured for English. Running Firefox 90.0b9 (64-bit) on
macOS 11.4 (20F71).
--
assignee: docs@p
New submission from Samuel Marks :
What works:
- python-3.7.9.exe python-3.8.9.exe
What fails:
- python-3.10.0b2.exe python-3.9.5.exe
(I'm debugging some regressions on my test suite… macOS and Linux [incl. in
Docker] work, Windows fails)
How to reproduce (macOS):
0. Install
Samuel Marks added the comment:
`EXIT_SUCCESS` is defined in `stdlib.h`, as per
https://docs.microsoft.com/en-us/cpp/c-runtime-library/exit-success-exit-failure
(following the standard
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdlib.h.html)
There are also
https
Change by Samuel Marks :
--
keywords: +patch
pull_requests: +25147
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/26559
___
Python tracker
<https://bugs.python.org/issu
New submission from Samuel Marks :
Since Python 2.3 alpha 2 [19-Feb-2003] `EX_OK` has existed… but only for Unix.
This adds support for Windows.
--
components: Windows
messages: 395203
nosy: paul.moore, samuelmarks, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
Samuel Thibault added the comment:
I don't see how to reopen this, we'd probably want to mark it as a duplicate of
the newly-opened https://bugs.python.org/issue43793 , see
https://mail.python.org/archives/list/capi-...@python.org/thread/7FI6V2KFBFZIXC6LZLKHY4
Change by Samuel Thibault :
--
nosy: +samuel-thibault
___
Python tracker
<https://bugs.python.org/issue43793>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Samuel Thibault :
--
nosy: +samuel-thibault
___
Python tracker
<https://bugs.python.org/issue43747>
___
___
Python-bugs-list mailing list
Unsubscribe:
Samuel Freilich added the comment:
A fully general solution for this might require a separate way to override the
behavior for serializing dict keys (since those have to be serialized as
strings).
--
___
Python tracker
<https://bugs.python.
Samuel Freilich added the comment:
> A modern solution for this is to define a singledispatch function (with
> implementations for your custom types) and pass it as the `default` parameter
> to the dump functions.
Does that work? I thought the default function only got called
Samuel Freilich added the comment:
I think the less-minor issue, of which this is a small subset, is that
JSONEncoder doesn't allow changing the behavior for default-serializable types
at all. That means you can't choose to lose less information in round-trip
serialization/deser
New submission from Samuel Kirwin :
Per the attached file, when testing an adapted version of pygame's alien script
as part of research. Python segfaulted.
This has occured twice about 5 minutes in.
I had console running all messages at the time if more logs needed.
MacOS Big Sur 11.2
New submission from R. Samuel Klatchko :
Right now, this code:
class FooError(Exception): pass
class BarError(Exception): pass
def test_me(self):
with self.assertRaises(FooError):
raise BarError("something")
will have the error "BarError: som
Samuel Marks added the comment:
Nevermind it actually was that missing `PKG_CONFIG_PATH` line…
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Samuel Marks :
I was on 3.10a4 on macOS 11.1 for ages, finally decided to upgrade to a5,
building from source. With latest `brew install openssl zlib`.
```
$ export LDFLAGS='-L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/zlib/lib'
$ export CPPFLAGS='-
New submission from Samuel Marks :
Had a couple of commits to try and fix it on GitHub Actions (as I was unable to
replicate locally), ended up with this very easy fix for Windows:
https://github.com/SamuelMarks/doctrans/commit/98203e9fee3e0a888ab1f4128011dde5fad98f63
To completely remove the
Samuel Marks added the comment:
There were only 12k occurrences, I'm sure I could manually go through that
in an afternoon. Would you accept it then?
On Tue, 22 Dec 2020, 12:22 am Eric V. Smith, wrote:
>
> Eric V. Smith added the comment:
>
> See https://github.com/ikame
Samuel Marks added the comment:
EDIT: Just found https://github.com/ikamensh/flynt
--
___
Python tracker
<https://bugs.python.org/issue42699>
___
___
Python-bug
Samuel Marks added the comment:
I suppose that's a good justification to never improve/upgrade the syntax and
quality of the codebase.
In terms of automatic upgrades of the codebase, one could always replicate the
approach I use in doctrans—i.e., use of `ast` and/or `inspec
Samuel Marks added the comment:
Wait I don't understand why you wouldn't accept a wholesale replacement of all
`%` and `format` with f-strings through the entire CPython codebase [master
branch]?
BTW: Kinda unrelated, but would be great to have perspective on this little
proje
Samuel Marks added the comment:
Yeah I hear ya, was just trying for the most concise issue title. I tend to
[over]use `map`, `filter`, `filterfalse` and other `itertools` and `operator`
methods in my own codebase.
Surprised with that result, that using an explicit list is actually faster
Samuel Marks added the comment:
@eric.smith No benchmarks offhand, but I'd expect it to be a very minor
improvement (if detectable).
If this gets accepted I'll probably do a bunch of little changes like this, to
improve things, e.g., replace '%' with '.format
New submission from Samuel Marks :
This is an extremely minor improvement. Rather than create a `list`—using a
comprehension—then have it consumed by `.join`, one can skip the list
construction entirely.
(I remember this working from at least Python 2.7… probably earlier also
Samuel Marks added the comment:
Since we're bringing these back, would you accept a backport of these types?
[I'm writing a bunch of parsers/emitters—and starting to maintain an old
runtime type-checker—for 3.6+]
--
nosy: +samuelmarks
Samuel Marks added the comment:
Done, thanks for the how-to:
- https://github.com/python/cpython/pull/23103 [3.8]
- https://github.com/python/cpython/pull/23102 [3.9]
--
___
Python tracker
<https://bugs.python.org/issue42
Change by Samuel Marks :
--
pull_requests: +22020
pull_request: https://github.com/python/cpython/pull/23103
___
Python tracker
<https://bugs.python.org/issue40
Change by Samuel Marks :
--
nosy: +samuelmarks
nosy_count: 4.0 -> 5.0
pull_requests: +22019
pull_request: https://github.com/python/cpython/pull/23102
___
Python tracker
<https://bugs.python.org/issu
Samuel Marks added the comment:
Opened two issues and two PRs for 3.8 and 3.8:
- https://bugs.python.org/issue42241
- https://bugs.python.org/issue42242
--
___
Python tracker
<https://bugs.python.org/issue42
New submission from Samuel Marks :
Backports https://github.com/python/cpython/pull/19581
https://bugs.python.org/issue40318 as per https://bugs.python.org/issue42229
See also 3.9 backporting: https://bugs.python.org/issue42241
[not sure if this is how you do backporting, a new issue and GH
New submission from Samuel Marks :
Backports https://github.com/python/cpython/pull/19581
https://bugs.python.org/issue40318 as per https://bugs.python.org/issue42229
--
components: Build
messages: 380185
nosy: samuelmarks
priority: normal
pull_requests: 22011
severity: normal
status
Change by Samuel Marks :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue42229>
___
___
Python-bugs-list
Samuel Marks added the comment:
👌
--
___
Python tracker
<https://bugs.python.org/issue42229>
___
___
Python-bugs-list mailing list
Unsubscribe:
Samuel Marks added the comment:
@erlendaasland Hmm… just double-checked, and this issue is present on Python
3.8.6 and 3.9.0 but not master [d3b4e068077dd26927ae7485bd0303e09d962c02] as
you referenced.
Should I close this issue—and PR—then? - Backport from master to these
Samuel Marks added the comment:
Yes, this commit extends his changes to include macOS support (for some reason
that SQLite version check doesn’t work properly on macOS; so this checks the
macOS version, knowing AOT when SQLite trace v1 APIs were deprecated.
Curious that
New submission from Samuel Marks :
Planned to fix all the compiler warnings on macOS. Ended up just fixing this
SQLite one:
```
Python-3.9.0/Modules/_sqlite/connection.c:1066:9: warning: 'sqlite3_trace' is
deprecated: first deprecated in macOS 10.12
[-Wdeprecated-de
Samuel Freilich added the comment:
python-ideas thread:
https://mail.python.org/archives/list/python-id...@python.org/thread/B6OMGYIM47OVGOCZLEY3MEUJDFURJRDV/
The most minimal ideas from that seem to be:
1. Maybe link to the glossary from the error message (if links to documentation
in
Samuel Freilich added the comment:
> I think it's reasonable to discuss the problem on python-ideas rather than on
> a bugs issue, when it's not obvious what the right solution is.
I did start a thread there. Don't object to that, if that's a better for
Samuel Freilich added the comment:
> No minor tweak to the exception message will make this go away. For
> understanding to occur, the only way to forward is to learn a bit about
> hashability. That is a step that every beginner must take.
This is a derisive and beginner-hostile
Samuel Freilich added the comment:
> The user already knows
The example I link to in the initial description appears to be one case where
the user does not in fact know.
I do think context that this restriction applies to dict key in particular is
very relevant. The line could use the s
Change by Samuel Marks :
--
keywords: +patch
pull_requests: +21376
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/22332
___
Python tracker
<https://bugs.python.org/issu
Samuel Marks added the comment:
Okay I'll redo it on master, here is my config, on macOS 10.15.6:
```
$ export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
$ export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
$ export LDFLAGS="-L/usr/local
New submission from Samuel Marks :
https://github.com/SamuelMarks/cpython/tree/3.9-compiler-fixes
--
components: Build
messages: 377205
nosy: samuelmarks
priority: normal
pull_requests: 21373
severity: normal
status: open
title: Fix some compiler warnings
type: compile error
versions
New submission from Samuel Freilich :
Currently, if you (for example) put a dict as a value in a set or key in a
dict, you get:
TypeError: unhashable type: 'dict'
I'm pretty sure this wording goes back a long time, but I've noticed that
Python beginners tend to find t
Vikash Raja Samuel Selvin added the comment:
Thanks for your comments. Just to make sure I understood correctly, even though
something like bisect.bisect_right(l, 5.1, 0, -2) [This returns 0 which is
wrong] is allowed, since it is not common / intended it is ok to not check for
negative
New submission from Vikash Raja Samuel Selvin :
>>> bisect.bisect_right(l, 5.1, -1)
Traceback (most recent call last):
File "", line 1, in
ValueError: lo must be non-negative
>>> l
[0, 1, 2, 3, 4, 5, 5, 5, 6, 7, 8, 9]
>>> bisect.bisect_right(l, 5.1, 0,
New submission from Samuel Mathias :
On the "logging cookbook" page:
https://docs.python.org/3/howto/logging-cookbook.html#logging-cookbook
The recipe "A Qt GUI for logging" produces the following error:
`TypeError: update_status() missing 1 required position
New submission from Samuel Tatasurya :
Transformation performed by certain fixers (e.g. future, itertools_imports)
that causes a statement to be replaced by a blank line will generate a Python
file that contains syntax error.
For example, assuming a Python file (foo.py) containing line below
New submission from Samuel Grayson :
See [this SO post for more
details](https://stackoverflow.com/q/51680479/1078199)
--
components: Library (Lib)
files: test.py
messages: 355204
nosy: Samuel Grayson
priority: normal
severity: normal
status: open
title: multiprocessing.Queue fails
Change by Samuel Colvin :
--
pull_requests: +16288
pull_request: https://github.com/python/cpython/pull/16702
___
Python tracker
<https://bugs.python.org/issue38
Change by Samuel Colvin :
--
keywords: +patch
pull_requests: +16286
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16700
___
Python tracker
<https://bugs.python.org/issu
Samuel Colvin added the comment:
This is a bug with the `__repr__` method on `InitVar`.
I'm working on a PR now.
--
___
Python tracker
<https://bugs.python.org/is
New submission from Samuel Colvin :
The following code works fine with python 3.7 but breaks with 3.8:
```
import dataclasses
from typing import Optional
@dataclasses.dataclass
class TestingDataclass:
base_path: dataclasses.InitVar[Optional[str]] = None
```
Exception traceback
Samuel Marks added the comment:
See https://bugs.python.org/msg353987 for manual test
--
Added file: https://bugs.python.org/file48643/prog-module-name-handler.patch
___
Python tracker
<https://bugs.python.org/issue22
Samuel Marks added the comment:
Until this is accepted, I've modified my codebase:
```
from argparse import ArgumentParser
ArgumentParser(
prog=None if globals().get('__spec__') is None else 'python -m
{}'.format(__spec__.name.partition('.')[0])
)
Change by Samuel Freilich :
--
keywords: +patch
pull_requests: +15942
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/16361
___
Python tracker
<https://bugs.python.org/issu
Srinivasan Samuel added the comment:
Thanks Ammar for your time, service and reply. It was really helpful. I learned
some thing more.God Bless you.Srinivasan Samuel
On Saturday, September 21, 2019, 10:50:32 PM GMT+5:30, Ammar Askar
wrote:
Ammar Askar added the comment:
Check out
New submission from Srinivasan Samuel :
Here is the my direct cut & paste from my Python 3.7.3 Shell
>>> C = 2*[[]]
>>> C
[[], []]
>>>
>>> M = [[],[]]
>>> M
[[], []]
>>>
>>> C == M
True
>>>
>>> M[0].app
Samuel Freilich added the comment:
Check out my PR, which solves a much smaller issue: It fixes a bug in the
exception raising logic in assert_has_calls (and _awaits) which makes
complicated problems like the one you mention much harder to debug.
Also it has tests
Samuel Freilich added the comment:
Sure, but the bug in error-handling should still be fixed. Currently, if
_call_matcher returns an exception, that's ignored by assert_has_calls, and the
error message generated as a result is extremely misle
Change by Samuel Freilich :
--
pull_requests: +15630
pull_request: https://github.com/python/cpython/pull/16005
___
Python tracker
<https://bugs.python.org/issue36
Samuel Freilich added the comment:
This is still not totally fixed. This solves the underlying error with method
specs, but not the bug that was causing the error-swallowing in
assert_has_calls:
https://github.com/python/cpython/blob/ee536b2020b1f0baad1286dbd4345e13870324af/Lib/unittest
New submission from Samuel Thibault :
Hello,
Here is a patch to add thread native ID support for GNU/Hurd.
Samuel
--
components: Interpreter Core
files: hurd_thread_native_id.diff
keywords: patch
messages: 348879
nosy: samuel-thibault
priority: normal
severity: normal
status: open
New submission from Samuel Freilich :
Currently, it's an error to call the stop() method of a patcher object created
by mock.patch repeatedly:
>>> patch = mock.patch.object(Foo, 'BAR', 'x')
>>> patch.start()
'x'
>>> patch.stop()
&
Samuel GIFFARD added the comment:
I've created a similar ticket on mypy side:
https://github.com/python/mypy/issues/6383 as I'm not sure where this belongs
to.
--
___
Python tracker
<https://bugs.python.o
New submission from Samuel GIFFARD :
Some modules cannot be found with mypy. And cannot be silenced/skipped by mypy.
Have the following 3 files:
##
# example1.py
from asyncio import BaseEventLoop # Module 'asyncio' has no attribute
'BaseEventLoo
New submission from Samuel Grayson :
If all processes try to close the Queue immediately after someone has written
to it, this causes [an error][1] (see the link for more details). Uncommenting
any of the `time.sleep`s makes it work consistently again.
import multiprocessing
import
Samuel Colvin added the comment:
Hi, did you see https://bugs.python.org/issue35788#msg334155 later in the issue?
--
___
Python tracker
<https://bugs.python.org/issue35
Change by Samuel Colvin :
--
keywords: +patch, patch, patch
pull_requests: +11494, 11495, 11496
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Samuel Colvin :
--
keywords: +patch, patch
pull_requests: +11494, 11495
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Samuel Colvin :
--
keywords: +patch
pull_requests: +11494
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35800>
___
___
Py
Samuel Colvin added the comment:
Ok, if I create a PR, should it just remove MailmanProxy completely or mark it
as deprecated in the docs to be removed in 3.9?
Personally, I think it should be ok to remove it completely since it hasn't
been working at all for the last 4 minor ver
Samuel Colvin added the comment:
Great, https://bugs.python.org/issue35799 and
https://bugs.python.org/issue35800 created.
--
___
Python tracker
<https://bugs.python.org/issue35
New submission from Samuel Colvin :
smtpd.MailmanProxy is completely broken, it takes the wrong arguments but also
assumes the existence of a "Mailman" module which doesn't exist.
It should be removed in 3.8 or 3.9.
Created from https://bugs.python.org/issue35788
Happy to
New submission from Samuel Colvin :
smtpd.PureProxy.process_message is defined to not receive the extra kwargs
which it is called with.
It also expects "data" to be str when it's actually bytes.
PureProxy should either be removed for fixed.
Personally, I think it should be f
Samuel Colvin added the comment:
Ok. Thanks for your explanation. Makes sense.
--
___
Python tracker
<https://bugs.python.org/issue35788>
___
___
Python-bug
Samuel Colvin added the comment:
Thanks for the response.
I've created issues on aiosmtpd for both these things. There are much better
ways of running the controller than threading, but that's a discussion for
https://github.com/aio-libs/aiosmtpd/issues/160. I'll try and w
Samuel Colvin added the comment:
Thanks for the explanation David.
It would be really useful if this was prominently noted in smtpd, it would have
saved me spending my morning fixing these things. There's also (AFAIK) nothing
about this being deprecated in the docs.
More genera
Change by Samuel Colvin :
--
keywords: +patch, patch, patch
pull_requests: +11381, 11382, 11383
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Samuel Colvin :
--
keywords: +patch, patch
pull_requests: +11381, 11382
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Samuel Colvin :
--
keywords: +patch, patch, patch, patch
pull_requests: +11381, 11382, 11383, 11384
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Samuel Colvin :
--
keywords: +patch
pull_requests: +11381
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35788>
___
___
Py
New submission from Samuel Colvin :
smtpd.PureProxy.process_message and smtpd.MailmanProxy.process_message are
defined to not receive the extra kwargs which they're called with.
They both also expect "data" to be str when it's actually bytes.
Thus they're completed b
New submission from Samuel Bayer :
This bug is probably related to issue 24560.
This:
>>> import subprocess, fcntl, os
>>>> p = subprocess.Popen(["python", "-c", 'import time; time.sleep(5)'], stdin
>>>> = subp
New submission from Samuel Freilich :
_PyObject_FastCallDict and _PyObject_FastCallKeywords assert that there is no
pending exception before calling functions that might otherwise clobber the
exception state. However, that doesn't produce very clear output for debugging,
since the a
New submission from Samuel Warfield :
Bug with regex substitutions. When calling the re.sub() method directly
char(92), the double backslash charecter as the replacement, throws an
exception. Whereas compiling a regex object then calling its own .sub()
method works completely fine. I did a
Samuel Nwokenkwo added the comment:
To clarify
my expectation was something like this:
arr = multiprocessing.Array('c', 3) # type char
arr = "Fun"
which is similar to c implementation:
char arr[3] = "Fun"
AND
arr = multiprocessing.Array('b'
Samuel Nwokenkwo added the comment:
I completely wrote the wrong code:
So I'll copy and paste:
Scenario 1
import multiprocessing
br = multiprocessing.Array('c', 1)
br[0] = 's'
print(br[:])
Scenario 1 result = "TypeError: one charact
New submission from Samuel Nwokenkwo :
1st sequence:
arr = multiprocessing.Array("b", 1) # byte type
arr[0] = 's'.encode()
print(arr[:])
result is [115]
2nd sequence:
arr = multiprocessing.Array("c", 1) # character type
arr[0] = 's'
Changes by Samuel Naughton-Baldwin :
--
pull_requests: +3207
___
Python tracker
<http://bugs.python.org/issue21592>
___
___
Python-bugs-list mailing list
Unsub
New submission from Samuel Colvin:
With Python 3.5 and 3.6 list comprehensions, generators and tuples have the
col_offset for their ast nodes off by 1:
```
import ast
ast.parse('{a for a in range(3)}').body[0].value.col_offset
>> 0 # set comprehension correct
ast.parse('
New submission from Samuel Colvin:
This is best described the script at
https://gist.github.com/samuelcolvin/00f01793c118bf9aafae886ffbc81a58.
Basically, completing a set of tasks using
asyncio.wait(...return_when=asyncio.FIRST_COMPLETED) in a loop to wait for them
to finish is much much
1 - 100 of 176 matches
Mail list logo