Changes by Emanuel Barry :
--
components: +IDLE, Macintosh
nosy: +kbk, ned.deily, roger.serwy, ronaldoussoren, terry.reedy
stage: -> test needed
type: resource usage -> behavior
versions: +Python 3.5
___
Python tracker
<http://bugs.p
New submission from Emanuel Barry:
Attached patch adds a pure Python version of `collections.defaultdict`. This is
yet another step in providing better support for alternate implementations,
which may or may not have `_collections`.
I also went ahead and fixed __all__ so that `from
Changes by Emanuel Barry :
--
title: `string` exposes ChainMap from `collections` -> Add __all__ list to the
string module
___
Python tracker
<http://bugs.python.org/issu
Emanuel Barry added the comment:
Git diffs work, but this one doesn't apply cleanly. I manually fixed it and
re-generated the patch. Rietveld should pick it up now.
Otherwise, what Jelle said. I'm not sure if the macro has the best name though
- I'd probably name it `PyPartial_
Emanuel Barry added the comment:
New patch with Jelle's suggestions. I completely removed the macros since we
need to (potentially) call Python code with PyObject_IsInstance, and need to
check for return code.
I also reverted some of the unrelated changes.
--
Added file:
Emanuel Barry added the comment:
New patch, now almost all the tests that are used for the C version are also
used for the Python version (the only exception is the one checking that trying
to change/delete attributes would raise an error). Some tests needed a bit of
tweaking to work with the
Emanuel Barry added the comment:
Shakur - Feel free to take over and work on it.
Serhiy - I don't think that partial(func) == func should be, in the same sense
that (0, 1, 2), [0, 1, 2] and range(3) aren't equal even though they
fundamentally represent the
New submission from Emanuel Barry:
The NotImplemented docs aren't explicit enough when it comes to where it
can/should be used. Patch attached.
--
assignee: docs@python
components: Documentation
files: NotImplemented_wording_1.patch
keywords: patch
messages: 267543
nosy: docs@p
Emanuel Barry added the comment:
Added further notes to `NotImplemented` and `NotImplementedError` to clearly
state the differences between the two. I also added some more details to
`TypeError` - I'm amazed at how little was described for such a common
exception!
Maybe I explained a bi
Emanuel Barry added the comment:
Your report was already addressed in #27192, and the solution to your problem
was given by Ned Deily. If you are still experiencing crashes with the official
python.org version, please specify so. In the meantime, I'm closing this off as
dupl
Emanuel Barry added the comment:
New patch with small tweaks. Thanks Jelle for the comments!
--
Added file:
http://bugs.python.org/file43273/NotImplemented_exceptions_wording_3.patch
___
Python tracker
<http://bugs.python.org/issue27
Emanuel Barry added the comment:
More tweaks after Ethan's comments. This is starting to get way outside of the
realm of NotImplemented, but it still makes for a good reference to point
confused users at.
--
Added file:
http://bugs.python.org/file
Emanuel Barry added the comment:
Martin: yes, I plan to install Sphinx soon enough, so that I can build the docs.
As for the notes part, I indented it exactly like it was indented for other
existing notes boxes in the same file. I'll change that if needed t
Emanuel Barry added the comment:
(Berker beat me to it, but posting anyway since it is more detailed)
Backslashes are escape characters, and "\b" is treated as "\x08". Invalid
combinations (e.g. "\A", "\D"...) automatically escape the backslash, but yo
Emanuel Barry added the comment:
`dict` subclasses can be hashable - it's a very bad idea, but not guarded
against. If you were to do this, I'd suggest going the exception way, à la
StopIteration.
I wonder how feasible it would be for e.g. dict.__setitem__ to check if a key
alre
Emanuel Barry added the comment:
I'm not too familiar with the json package, but what should __json__ return
when called?
--
nosy: +ebarry
stage: -> test needed
versions: +Python 3.6
___
Python tracker
<http://bugs.python.org
Emanuel Barry added the comment:
So __json__ returns a string meant to be serializable. I'm not too keen on
using a dunder name (although my word doesn't weigh anything ;) and I'd
personally prefer something like as_json_string(). I think the idea in general
is good, though. Mi
New submission from Emanuel Barry:
Attached patch deprecates invalid escape sequences in unicode strings. The
point of this is to prevent issues such as #27356 (and possibly other similar
ones) in the future.
Without the patch:
>>> "hello \world"
'hello \\world'
Emanuel Barry added the comment:
Now I have! I found nothing on Python-Dev, but apparently it's been discussed
on Python-ideas before:
https://mail.python.org/pipermail/python-ideas/2015-August/035031.html Guido
hasn't participated in that discussion, and most of it was "
Emanuel Barry added the comment:
Yes, it's in use in an awful lot of places (see my patch). The proper fix is to
use raw strings, or, if you need actual escapes in the same string, manually
escape them. However, as you'll see by looking at the patch, the vast majority
of cases ar
Emanuel Barry added the comment:
Thanks, didn't find that one. Apparently Guido's stance is "Make this a silent
warning, then we can discuss about preventing it later", which happens to be
what I'm doing here.
--
Emanuel Barry added the comment:
I found the cause of the failed assertion, an invalid escape sequence slipped
through in a file. Patch attached (also with Serhiy's comments).
It worries me a little though that pure Python code can cause a hard crash. Ok,
it worries me a lot. Please
Emanuel Barry added the comment:
You're overriding the 'calendar' variable, holding the module, by the result of
your 'calender.month' call, which happens to be a str. Use a different variable
name (e.g. 'result') and the error will disappear.
Unrelated
Emanuel Barry added the comment:
I originally considered making two different patches, so there you go.
deprecate_invalid_escapes_only_1.patch has the deprecation plus a test, and
invalid_stdlib_escapes_1.patch fixes all invalid escapes in the stdlib.
My code was the cause, although no
Changes by Emanuel Barry :
Added file: http://bugs.python.org/file43550/invalid_stdlib_escapes_1.patch
___
Python tracker
<http://bugs.python.org/issue27364>
___
___
Pytho
New submission from Emanuel Barry:
My trivial patch exposed a bug in the ast/compiler, where compile() would
return a value and set an exception. See
http://bugs.python.org/issue27364#msg269323 for more information and steps to
reproduce. I looked a bit into it, but I don't know enough
Emanuel Barry added the comment:
Ah right, assert() is only enabled in debug mode, I forgot that. My (very
uneducated) guess is that compile() got the error (which was a warning) but
then decided to return a value anyway, and the next thing that tries to call
anything crashes Python. I opened
Emanuel Barry added the comment:
Nevermind, my mistake.
--
resolution: -> not a bug
stage: needs patch -> resolved
status: open -> closed
type: crash ->
___
Python tracker
<http://bugs.python
Emanuel Barry added the comment:
Aaand I feel pretty stupid; I didn't check the return value of
PyErr_WarnFormat, so it was my mistake. Attached new patch, actually done right
this time.
--
Added file:
http://bugs.python.org/file43552/deprecate_invalid_escapes_only_2.
Emanuel Barry added the comment:
Indeed, we did, thanks for letting me know my mistake :) I didn't get very far
into making bytes literal disallow invalid sequences, as I ran into issues with
_codecs.escape_decode throwing the warning even when the literal was fine, and
I think I st
Emanuel Barry added the comment:
I think ultimately a SyntaxError should be fine. I don't know *when* it becomes
appropriate to change a warning into an error; I was thinking 3.7 but, as
Serhiy said, there's no rush. I think waiting five release cycles is overkill
though, that means
Emanuel Barry added the comment:
Easing transition is always a good idea. I'll contact the PyCQA people later
today when I'm back home.
On afterthought, it makes sense to wait more than two release cycles before
making this an error. I don't really have a strong opinion wh
Emanuel Barry added the comment:
Just brought this to the attention of the code-quality mailing list, so linter
maintainers should (hopefully!) catch up soon.
Also new patch, I forgot to add '\c' in the tests.
--
Added file:
http://bugs.python.org
Emanuel Barry added the comment:
Some of the tests that used to fail are now passing, however some are still
failing (and new ones are also failing now).
Tests that are still failing:
test_code_module (TestInteractiveConsole; test_ps1 and test_ps2 failed)
test_codecencodings_iso2022 (blame
Emanuel Barry added the comment:
About the strptime failure - it seems time.strftime returns "Est (heure d?été)"
while _strptime.LocaleTime().timezone has "est (heure d\x92été)". I don't know
why it's like that, but neither are correct - the character that
Emanuel Barry added the comment:
That is good to know, thanks Eryk for the explanation! I also think making
Python set LC_CTYPE on startup on Windows would be good.
Martin's comment got me wondering, so I'm going to try to see if all modules
properly got re-compiled, and re-run t
New submission from Emanuel Barry:
Running test_os yields a ton (something like 20) failed assertion warnings. The
attached screenshot is one of them (comes up a few times), but there are
others. Choosing to Ignore the error makes Python think that the test was
merely skipped without any
New submission from Emanuel Barry:
Ran the test as 'python -W error -m test.test_logging' on latest 3.6 version.
No idea what causes this; full traceback attached. Not sure if it's relevant,
but I'm running Windows 7.
--
components: Library (Lib), Tests
New submission from Emanuel Barry:
Specifically, test_random and test_sax both fail because of git's newline
preferences. Mine is set to convert \r\n to \n on push and the other way around
on pull. Relevant output:
test_random:
EException ignored in: <_io.FileIO
name=
New submission from Emanuel Barry:
Specifically, test_strptime fails:
ss.F.E...
==
ERROR: test_timezone (__main__.StrptimeTests
Emanuel Barry added the comment:
So I checked to make sure everything re-compiled properly and re-ran tests.
Now, only a very few fail, and I've opened separate issues for each of them.
test_os: #27423
test_logging: #27424
test_random: #27425
test_sax: #27425
test_strptime: #27426
I'
Emanuel Barry added the comment:
I agree, but I wouldn't expect my line ending preferences to make tests fail. I
think that with the move to GitHub already underway, it's not unreasonable to
(at least consider to) add a .gitattributes file. Added Brett to nosy since
he's resp
Emanuel Barry added the comment:
I'm not sure about the patch - sure, the messages might go away, but I find it
concerning that the assertions are failing to begin with. Of course, it only
happens when in debug (and this might be a non-issue in practice, I haven't
checked), but sh
Emanuel Barry added the comment:
What is the use case, and why is a regular for loop not enough? The bar for
adding new builtin functions is high, and I don't think this meets it.
--
nosy: +ebarry
___
Python tracker
<http://bugs.py
Emanuel Barry added the comment:
With the existence of multiple sum() functions (and potentially multiple
product() functions), would it be worth it to group these all into one module?
It also doesn't help that there is an itertools.product function that has yet
another purpose.
I mai
Emanuel Barry added the comment:
Worth of note: #26823 will actually change printing to stderr for recursion
errors (if/when it gets merged that is; I don't know what's holding it up). It
might be interesting to see if you can still witness this issue with the patch
applied.
-
Emanuel Barry added the comment:
Is there anything still preventing this from being merged? I think the ability
to consistently get the same behaviour, with or without _functools available,
outweighs the performance and simplicity loss (and as far as performance loss
goes, it appears that
Emanuel Barry added the comment:
Raymond, do you have any interest/time to review this? I can ask someone else,
if you prefer.
--
___
Python tracker
<http://bugs.python.org/issue27
Emanuel Barry added the comment:
Sorry for the delay, but here's a patch with updated tests after Nick's
suggestions. It should be ready to merge now.
(I'm having some failures in test_traceback, but they fail even without my
patch)
--
Added file: http://bugs.pytho
Emanuel Barry added the comment:
New patch with proper indenting, should be good as far as formatting is
concerned :)
--
Added file:
http://bugs.python.org/file43648/NotImplemented_exceptions_wording_5.patch
___
Python tracker
<h
Emanuel Barry added the comment:
I agree that CPython itself gains nothing from having this, as this is so that
alternate implementations have it as well. I get what you mean about the minor
differences, however I think it's a good thing, as it helps to make sure the
tests are precise e
Emanuel Barry added the comment:
(Also, if this is going to be rejected still, I think that fixing __all__ to
only conditionally add 'deque' and 'defaultdict' should be considered)
--
___
Python tracker
<http://bug
Changes by Emanuel Barry :
--
nosy: +ebarry
___
Python tracker
<http://bugs.python.org/issue27469>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Emanuel Barry :
--
resolution: -> not a bug
stage: -> resolved
___
Python tracker
<http://bugs.python.org/issue27468>
___
___
Python-bugs-list
Changes by Emanuel Barry :
--
nosy: +ebarry
___
Python tracker
<http://bugs.python.org/issue27498>
___
___
Python-bugs-list mailing list
Unsubscribe:
Emanuel Barry added the comment:
Please submit a patch file (see https://docs.python.org/devguide/patch.html ).
--
nosy: +ebarry
stage: -> needs patch
___
Python tracker
<http://bugs.python.org/issu
Emanuel Barry added the comment:
"The #python-dev channel" being me in this context ;) Patch attached.
--
keywords: +patch
nosy: +ebarry
stage: -> patch review
Added file: http://bugs.python.org/file43768/dict_view_doc_1.patch
___
P
Changes by Emanuel Barry :
--
title: documentiona of dict view types -> Document the ABCs for
instance/subclass checks of dict view types
___
Python tracker
<http://bugs.python.org/issu
Changes by Emanuel Barry :
--
nosy: +davin, ebarry, pitrou
stage: -> needs patch
title: SystemError inside multiprocessing.dummy Pool.map -> SystemError with
bare `raise` in threading or multiprocessing
versions: +Python 3.6 -Python 3.2, Pyth
Emanuel Barry added the comment:
Here's a new patch which also deprecates invalid escape sequences in bytes.
Tests included with test_codecs.
Patch includes and supersedes deprecate_invalid_escapes_only_3.patch, and I
have not found a single instance of an invalid escape sequence other
Changes by Emanuel Barry :
--
assignee: -> eric.snow
components: +Library (Lib)
keywords: +3.5regression -3.4regression
nosy: +ebarry, eric.snow
stage: -> needs patch
___
Python tracker
<http://bugs.python.org/i
Emanuel Barry added the comment:
For future reference, if your input can have arbitrary escapes, it might be a
good idea to pass it through re.escape; it does proper escaping so that stuff
like e.g. \g in your input will get treated as a literal backslash, followed by
a literal 'g'
Emanuel Barry added the comment:
After discussing with someone, I realized that the tests actually test the
Python implementation twice, and never the C implementation (since I use
traceback.print_exc() to "test" the C implementation).
I don't think it's possible to both c
Emanuel Barry added the comment:
Turns out there's already some functions in _testcapi that do this, great!
Here's an updated patch actually testing the C implementation (and the tests
pass, obviously :)
--
Added file: http://bugs.python.org/file43843/short_tracebac
Changes by Emanuel Barry :
--
components: -Build, XML, email
nosy: -barry, r.david.murray, xaxadmin
resolution: -> not a bug
stage: -> resolved
status: open -> closed
title: None -> Spam
versions: -Python 2.7
___
Python tr
Emanuel Barry added the comment:
Indeed, nicely spotted! Patch attached (hash_complex_type_1.patch)
P.S.: I don't like the 'hash_' name as a variable for this example; it looks
like grit on Tim's monitor to me, so I went ahead and renamed it to
'hash_value'
Changes by Emanuel Barry :
Added file: http://bugs.python.org/file43846/hash_doc_renamed_1.patch
___
Python tracker
<http://bugs.python.org/issue27601>
___
___
Python-bug
Emanuel Barry added the comment:
Do note that nothing has been changed in the docs yet. I submitted the patch,
and now other developers need to review it, decide whether it's correct or need
modifications, and then someone needs to commit it. Let the bikeshedding
Emanuel Barry added the comment:
Thank you Nick for the comments! Updated patch attached.
The new patch uses inspect.stack() to calculate the total stack size, but I'm
unable to get the exact number needed, and I found that I'm either 19 or 20
above (depending on whether I run it
Emanuel Barry added the comment:
Alright, I think this works now. No more magic number, just some regex as well
as checking that the number is in range(sys.getrecursionlimit()-50,
sys.getrecursionlimit()) :)
--
Added file: http://bugs.python.org/file43866/short_tracebacks_7.patch
Changes by Emanuel Barry :
--
resolution: -> not a bug
stage: -> resolved
___
Python tracker
<http://bugs.python.org/issue27608>
___
___
Python-bugs-list
Emanuel Barry added the comment:
I'm fairly sure enums aren't related to this issue, so I'm unassigning Ethan
(but feel free to self-assign back if you so desire :). As I said on IRC (I'm
Vgr), I think that importing a module twice is the problem here, and that PEP
499 is
Emanuel Barry added the comment:
@Cameron - I don't think this issue can be solved without the PEP, so possibly
that the best move would be to work on the PEP and submit it for another round
on Python-Dev, to get it reviewed. Thanks!
--
___
P
New submission from Emanuel Barry:
LGTM.
--
nosy: +ebarry
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org/issue27626>
___
___
Py
Emanuel Barry added the comment:
Since non-ASCII characters are not really supported in hostnames, I changed
mine to a saner alternative. This issue can be closed then, since any test
failure I encounter can no longer be because of this.
One last thing: is it safe to say "Don't use
Emanuel Barry added the comment:
Thank you for the report and the patch! :) This will need a test in
Lib/test/test_ssl.py to check for this particular case.
I've removed 3.3 and 3.4 from the Versions field, since these versions no
longer get regular bugfixes (only security bugfixes may
Changes by Emanuel Barry :
--
stage: test needed -> resolved
___
Python tracker
<http://bugs.python.org/issue11048>
___
___
Python-bugs-list mailing list
Un
Emanuel Barry added the comment:
Here's a patch that fixes this.
--
components: +Interpreter Core -Library (Lib)
keywords: +patch
nosy: +ebarry
stage: -> patch review
Added file: http://bugs.python.org/file43913/int_to_bytes_overflow
Emanuel Barry added the comment:
I don't use this feature enough to have a clear opinion, however it's
specifically accounted for in the code and has a test for it. It might be a
good idea to bring this up on Python-ideas. It's very likely to break some
code, but I wonder if s
Emanuel Barry added the comment:
Since this is a new feature addition, this should first go through
Python-ideas. However, I don't think that network-related features should go
into builtin types, -1 from me.
--
nosy: +ebarry
___
Python tr
Emanuel Barry added the comment:
`import` merely adds the imported module to the current namespace which, in
your code, is some local (non-global) namespace. It is successfully imported
but never used, and quickly falls out of scope.
You also check for `testplugin in sys.modules`, but you
Emanuel Barry added the comment:
Yeah, just add 'global testplugin' at the top of your function, before your
import it (you'll also need a global statement if you want to delete/re-import
it). You might want to take a look at importlib if you wish to dynamically load
modu
Emanuel Barry added the comment:
That's really nice, thank you for doing this! To get your code reviewed,
though, you should upload a patch here. With git, you can do 'git diff >
my_patch_file_name.patch' in your local repo, then you can upload the resulting
file here. If y
Emanuel Barry added the comment:
Hello Martin, and thank you for your patch! However, this patch removed the
ability to pass keyword arguments to `type`, and it's not documented anywhere.
I believe it should be documented at least in e.g. the "Changes in the Python
API" of th
Emanuel Barry added the comment:
TL;DR - Use case is dynamic decorators. Not all of the syntax would make sense,
see below.
The main benefit of this feature would be for dynamic decorators (as was
evidenced from others in this issue). In a project I contribute to, we use
dynamic decorators
Emanuel Barry added the comment:
Sure, here goes; this is an IRC game bot which I contribute to. Apologies for
the long links, it's the only way to make sure this consistently points to the
same place regardless of future commits.
The 'cmd' decorator we use is defined at
htt
Emanuel Barry added the comment:
We want to be able to access the instance attributes (as is done e.g. here:
https://github.com/lykoss/lykos/blob/1852bf2c442d707ba0cbc16e8c9e012bcbc4fcc5/src/wolfgame.py#L9761
). I realize we can set the attributes directly on the functions, but we've
de
Emanuel Barry added the comment:
To add to what SilentGhost just said; the '*' operator for lists doesn't create
new lists, but simply creates new references to the same list (i.e. it doesn't
re-evaluate the expression).
To create separate lists, you can do a list comprehe
Emanuel Barry added the comment:
Obligatory monthly ping.
--
___
Python tracker
<http://bugs.python.org/issue27242>
___
___
Python-bugs-list mailing list
Unsub
Emanuel Barry added the comment:
Thanks Ethan for the improved patch! Pointed out a typo and some nits, but
other than that it's mostly good. I'm not that good at brevity, and I think
your patch is much better on that regard :)
--
Emanuel Barry added the comment:
This is due to how closures work in Python: they only look up the value of the
variable when the function is executed, not when it is created.
See the FAQ for more information and how to work around this:
https://docs.python.org/3/faq/programming.html#why-do
Emanuel Barry added the comment:
Left some comments on Rietveld; mostly documentation-related (and pointed out
some typos).
I'm also +1 on having to specify a True value rather than just defining the
variable at all (i.e. setting __ltrace__ to False is the same as not defining
it). I
Emanuel Barry added the comment:
Maybe someone who knows this feature better can weigh in, but otherwise LGTM.
--
___
Python tracker
<http://bugs.python.org/issue25
Emanuel Barry added the comment:
Here's a patch that fixes this bug, test included. I made this against the 3.5
branch, but should apply cleanly on default.
--
keywords: +patch
nosy: +ebarry
Added file: http://bugs.python.org/file44008/ipaddress_iter_fix.
Changes by Emanuel Barry :
--
stage: -> patch review
___
Python tracker
<http://bugs.python.org/issue27683>
___
___
Python-bugs-list mailing list
Unsubscrib
Emanuel Barry added the comment:
Ack, special cases! I can look into making a patch, but I'm not really
acquainted with ipaddress or the relevant protocols, so it might not be
optimal. I'll give it a shot next week if nobody else does.
--
stage: patch review ->
Emanuel Barry added the comment:
I'm not home to check, but judging by the error message and previous
discussions with other developers, it seems indeed like an issue with a
non-ASCII character in my hostname. I've changed my hostname since then, so I'm
going to close this as w
Emanuel Barry added the comment:
Hmm, that's odd, I recall some of the failures from testing, and thought I
fixed them. Some of these are brand new, though, so thanks! I'll run and fix
the tests (and modules as well); should likely have a patch by t
Emanuel Barry added the comment:
This is due to the fact that Python evaluates the variable 'n' when the
function is called, not when it is created. As such, the variable holds the
latest value for all functions, and they exhibit identical behaviour.
Workaround:
...
f = lambda x,
Emanuel Barry added the comment:
I think that whether or not something is trivial doesn't really correlate to
whether or not it has its place in the language. After all, `math.pi` is
3.1416, and most people using pi will not worry about more than 4 decimal
digits. Those who do are presu
101 - 200 of 2699 matches
Mail list logo