Martin Panter added the comment:
Does the “astimezone” method work for you?
<https://docs.python.org/3.5/library/datetime.html#datetime.datetime.astimezone>
>>> from datetime import *
>>> aedt = timezone(+timedelta(hours=11))
>>> local = datetime.now(aedt)
&g
Martin Panter added the comment:
Closing in favour of Issue 13501, since the report was apparently about using a
non-Apple Editline rather than Gnu Readline. However see also Issue 29854,
where the same symptom is seen with Gnu Readline, and it will probably get the
same fix
Changes by Martin Panter :
--
resolution: -> duplicate
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Changes by Martin Panter :
--
superseder: -> Make libedit support more generic; port readline / libedit to
FreeBSD
___
Python tracker
<http://bugs.python.org/issu
Martin Panter added the comment:
Gnu Readline comes includes its own documentation (e.g.
/usr/share/info/history.info.gz on my computer). It is also at
<https://cnswww.cns.cwru.edu/php/chet/readline/history.html>.
Perhaps the history_base value is relevant; see some of the comments st
Martin Panter added the comment:
If you enable BytesWarning (python -b) you do get an error:
>>> urlopen(req, data)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.5/urllib/request.py", line 162, in urlopen
return opener.op
Martin Panter added the comment:
This seems too obscure to be worth supporting in the built-in library IMO. The
use case loses one line of code but gains a more complicated structure format
string.
--
nosy: +martin.panter
___
Python tracker
<h
Martin Panter added the comment:
A backwards-compatible way forward would be to preserve (and document) the
“format” attribute as a byte string, and add a new attribute which is
definitely a text string. Not sure of a good name; perhaps “Struct.text_format”
or “format_str” is a start
Martin Panter added the comment:
For the native alignment case (prefix code @), perhaps you can already use the
“ctypes” module, which supports structures with more complicated embedded
fields.
For the the unaligned modes (prefixes =, <, > and !), I am a little
sympathetic. In the p
Martin Panter added the comment:
I presume you are trying to print to the normal Windows console. I understand
the console was not well supported until Python 3.6 (see Issue 1602). Have you
tried that version?
I’ll leave this open for someone more experienced to confirm, but I suspect
what
Martin Panter added the comment:
This seems to be discussing the same sort of stuff that ended up with the Issue
1602 implementation.
--
nosy: +martin.panter
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> windows console doesn'
Martin Panter added the comment:
The double equals "==" case for the “quopri” implementation in Python is now
consistent with the others thanks to the fix in Issue 23681 (see also Issue
21511).
According to Issue 20121, the quopri (Python) implementation only supports LF
(\n) cha
Martin Panter added the comment:
Hi Victor, I’m not sure about changing the data type. As Python 3 grows older,
there is potentially more code being written that you break by fixing a bug
like this. It is incompatible if you used to write
>>> print(struct.Struct('hi').for
Changes by Martin Panter :
--
title: Problem with tempfile.NamedTemporaryFile -> tempfile.NamedTemporaryFile:
automatic cleanup by OS
___
Python tracker
<http://bugs.python.org/iss
Martin Panter added the comment:
See also Issue 27425, about making the deletion step more flexible after the
file has been created, which might help here.
I’m not sure about security problems, but IMO failure to remove a temporary
file (because it is already gone, or some other reason) is
Martin Panter added the comment:
I don’t know if it is an implementation detail or not. Maybe it is the
documentation itself which defines that. Anyway, I think your wording would
have been fine for my original problem.
I wonder if we should clarify that only reading the mapping is supported
Martin Panter added the comment:
When I wrote the documentation
<https://docs.python.org/dev/reference/lexical_analysis.html#f-strings>, I
think I tried to avoid “f-string”, being jargon, and used more formal
terminology from PEP 498 instead. But I agree they more than regular li
Martin Panter added the comment:
In this test, “keyword arguments” is definitely wrong:
>>> f(**{1:2})
-TypeError: f() keywords must be strings
+TypeError: f() keyword arguments must be strings
To me, a keyword argument is a _value_ passed in using the f(name=. . .)
syntax, and th
Changes by Martin Panter :
--
nosy: -martin.panter
___
Python tracker
<http://bugs.python.org/issue27100>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: -martin.panter
___
Python tracker
<http://bugs.python.org/issue28556>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: -martin.panter
___
Python tracker
<http://bugs.python.org/issue27867>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
The pull request currently suggests “All of Python’s immutable built-in objects
are hashable; mutable containers (such as lists or dictionaries) are not.” This
seems better wording than the original.
FWIW, I would have tried “Python’s built-in immutable
Martin Panter added the comment:
Underscores are only applicable to 3.6+, but the original concern about leading
zeros applies to 3.5.
On Git Hub I suggested dropping the details and just referring to the Lexical
Analysis section
<https://docs.python.org/3.5/reference/lexical_analysis.h
Martin Panter added the comment:
By “factory instance”, I presume you just mean a function (or class or method)
that returns an appropriate object when called. (I think these are normally
called “factory functions”. Instances are objects, the things that class
constructors and factories
Martin Panter added the comment:
Are you sure? It works for me:
>>> strptime("+0200", "%z").tm_gmtoff
7200
>>> strptime("+", "%z").tm_gmtoff
0
The "struct_time" class is documented as a named tuple, but the time zone
o
Martin Panter added the comment:
As far as I can see, the documentation only claims that “mktime” converts local
time. If you saw a suggestion that it supports arbitrary time zones, please
point it out.
--
___
Python tracker
<h
Martin Panter added the comment:
We could change this to a documentation issue if you have any suggestions to
make the documentation clearer.
I understand the “time” module is mainly a wrapper or emulator of the OS’s own
strptime, mktime, etc functions, which explains some of these quirks
Martin Panter added the comment:
Hi Terry, this patch is what I imagined a fix would look like for Linux. I am
not familiar with Idle (internally nor externally), so there may be
improvements you can make.
It works as I expected for normal blocking functions and a tight “for” loop: it
Martin Panter added the comment:
BTW pthread_kill was only added to Python 3.3, so is not available for Python
2. I’m not sure what the best fix for 2.7 would be. Maybe it’s not worth it, or
maybe you can find another way to a signal to the user process or its main
thread without interfering
Martin Panter added the comment:
I think this is the same underlying problem as Issue 23404. Either we get “make
touch” working without Mercurial, or we use some other mechanism to either
disable regeneration by default (my preference), or disable regeneration by
explicit request (possible
Martin Panter added the comment:
I had mainly been using my boot-flag.patch with BSD Make (bmake) rather than
Gnu Make. It seems I was relying on a bug in BSD Make that merges escaped
newlines in command lines, despite Posix and Gnu Make. Anyway, Chi’s fix seems
appropriate.
I am posting the
Changes by Martin Panter :
Added file: http://bugs.python.org/file46773/boot-flag.py2.patch
___
Python tracker
<http://bugs.python.org/issue23404>
___
___
Python-bug
Martin Panter added the comment:
I think he means make something like the following legal, where dots (.)
indicate space characters:
a.=.\.
b
At the moment it is a SyntaxError:
>>> a = \
File "", line 1
a = \
^
SyntaxError: unexpected character afte
Martin Panter added the comment:
FWIW I don’t see any error in the first quote. “Should X happen, Y happens” is
valid English. Though I admit this kind of grammar is not used that often.
If it is too hard to understand, it should be okay to change it to “If it
becomes a danging pointer
Martin Panter added the comment:
Doesn't seem like a bug to me.
Even if there was special support for "partial" objects, that won't help with
other ways of producing the same sort of thing.
test2 = functools.partial(test, a=10)
@functools.wraps(test)
def test2():
ret
Martin Panter added the comment:
Looks like a duplicate of Issue 29353, which has a more complete patch
proposed. However, see my comment about a problem with using heartersonly=True.
My policy-flag.v2.patch for Issue 24363 may help (the details have faded from
my mind, but I suspect it will
Martin Panter added the comment:
Not in general. I think you would have to make special cases for partial
functions, __wrapped__, and whatever else there is, and combinations of these.
It would be very hard to determine the correct result for test2 in
test2 = lambda: test(a=10) # test2
Martin Panter added the comment:
I agree this is not a bug. It is just one of the unfortunate compatibility
breaks between Py 2 and 3. Mode="rt" is not one of the values that are
supported according to the documentation; adding support would be a new feature.
I understand the
Martin Panter added the comment:
Raphael: Can you point to the implementation code that handles file objects
without a file descriptor (or give a demonstration of it)? I suspect there is
no such support and you are mistaken.
Perhaps we can instead clarify in the “subprocess” documentation
Martin Panter added the comment:
It looks like the zip entry writer object may not expect its “close” method to
be called multiple times. Other file objects tend to allow this with no ill
effect. Adding Serhiy and Thomas who implemented the writer object in Issue
26039.
The first time it is
Martin Panter added the comment:
I don’t have a strong opinion on adding the missing parameters to the one-shot
“compress” function, though it does seem beneficial to have a consistent set of
parameters supported across the relevant APIs
Martin Panter added the comment:
In Issue 23674, I posted a patch that changes to consistent parameter names
(subclass, self). The exception message would avoid “type”, becoming
super(subclass, self): self must be an instance or subtype of subclass
--
nosy: +martin.panter
Martin Panter added the comment:
The magical no-argument call could also be clarified:
8. Define in the main text what happens when you omit the first argument (the
subclass) to “super”. At the moment, I think the reader could infer that it is
the method’s class, but this is only hinted by
Martin Panter added the comment:
Thanks to Issue 11807, the documentation now lists “metavar”. (However, it
looks like a positional argument, rather than keyword-only, and its use seems
to be discouraged, but those issues are not specific to “metavar”.)
Some points specific to “metavar” that
Martin Panter added the comment:
I think the documentation should be fixed to say choices overrides dest, and
the implementation should be left alone. Even if the documentation is not a
“formal module reference”, it should not be wrong or misleading.
Also, Issue 14039 is related, about
Martin Panter added the comment:
The current exception seems to give a reasonable hint:
>>> subprocess.Popen((executable,), stdout=BytesIO())
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.5/subprocess.py", line 914, in __init__
Martin Panter added the comment:
Looks like a there is already a patch discussed at Issue 26985.
--
nosy: +martin.panter
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Information about CodeType in inspect documentation
Martin Panter added the comment:
This is as documented, but perhaps see Issue 20344 about clarifying the
documentation.
--
nosy: +martin.panter
resolution: -> not a bug
stage: -> resolved
status: open -> closed
superseder: -> subprocess.check_output() docs misrepresen
Martin Panter added the comment:
Maybe this is related to Issue 29059. If so, there seems to be resistance to
enabling the feature by default, and preference to use existing APIs rather
than adding a new API that enables it.
--
components: +Windows
nosy: +martin.panter, paul.moore
Martin Panter added the comment:
This doesn’t seem like a bug to me. At least it is consistent with the rule for
making a tuple when there are commas versus returning the direct expression
when there are no commas:
>>> x = (1); type(x)
>>> x = (1,); type(x)
I don’t
Changes by Martin Panter :
--
Removed message: http://bugs.python.org/msg291956
___
Python tracker
<http://bugs.python.org/issue30112>
___
___
Python-bugs-list m
Martin Panter added the comment:
Last time I proposed removing the automatic rebuilding of checked-in generated
files, it seemed getting a consensus would not be trivial. Nick seemed strongly
against changing the status quo:
<https://mail-archive.com/search?l=mi
Martin Panter added the comment:
Do you mean a separate makefile rule to rebuild the generated files, rather
than rebuilding them in a normal “make all” build? I would support this; this
is what I meant with my “make regenerate” proposal in response to Nick linked
above
Martin Panter added the comment:
.
Issue 11681 is already open for the -b option, with a patch in progress.
If updating the doc string, also change “buffer” to “bytearray”. This is what
“bytearray” was originally called in Python 3, and “buffer” is something
different in Python 2
Martin Panter added the comment:
A while ago I wrote a patch targetting Issue 22359 that may be a starting point
for “make regen”: <https://bugs.python.org/file42169/separate-regen.patch>. It
pulled out three recipes into separate “phony” targets: “make graminit
importlib importlib_ex
Martin Panter added the comment:
I don’t know enough about process groups and sessions to properly review, but
some things that stand out:
* Patch is missing documentation and tests
* If the “killpg” just wraps os.killpg, perhaps adding the method is not
justified
* Are there any race
Martin Panter added the comment:
This is similar to the problem described in Issue 26534, which proposes
“kill_group” and “killpg” APIs as a solution.
(FYI you should put a shebang at the start of the shell script, or call it as
“sh -c test.sh”, to fix the “Exec format error
Martin Panter added the comment:
Issue 5115 is already open with patch that has an alternative API to the
low-level “killpg” method. It also has a Windows implementation and tests. I
suggest to focus this bug on the higher-level “kill_group” option.
--
dependencies: +Extend
Changes by Martin Panter :
--
nosy: -martin.panter
___
Python tracker
<http://bugs.python.org/issue28769>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
Isn’t Issue 30119 a duplicate of this? In that bug Dong-hee you posted a pull
request that changes the “ftplib” module, which makes more sense to me than
adding a special case to “urlsplit” that understands FTP. See how this was
addressed for HTTP in Issue
Martin Panter added the comment:
The “Proper adherence” sentence has always bothered me. Why does “wfile” have
to adhere, but not other other APIs (rfile, send_header, etc)? I wonder if the
sentence is useful at all. (Of course you have to use HTTP to operate with HTTP
clients.)
Perhaps it
Martin Panter added the comment:
FWIW I am using NXP LPC microcontrollers at the moment, whose bootloader uses
the grave/backtick instead of spaces. (NXP application note AN11229.) Although
in practice it does seem to accept Python's spaces instead of graves.
I wouldn't put too m
Martin Panter added the comment:
I understand this bug (as reported by ECBFTW) is about Python injecting
unexpected FTP commands when the “urllib” and “urllib2” modules are used. The
“httplib” module (“http.client” in Python 3) is unaffected. I only mentioned
HTTP as an example of a similar
Martin Panter added the comment:
I think the direction to take for this depends on the outcome of Issue 21071.
First we have to decide if the “format” attribute is blessed as a byte string
(and not deprecated), or whether it is deprecated or changed to a text string.
Serhiy pointed out that
Changes by Martin Panter :
--
dependencies: +struct.Struct.format is bytes, but should be str -Document
whether it's safe to use bytes for struct format string
___
Python tracker
<http://bugs.python.org/is
Martin Panter added the comment:
I don’t think the API should be expanded to accept arbitrary bytes-like objects
as format strings. Struct formats are strings of ASCII-compatible characters,
but not arbitrary chunks of memory.
I think the main question is whether it is okay to break
Martin Panter added the comment:
I think I would prefer b2a_uu(data, grave=True), but am also happy with Xiang’s
backtick=True if others prefer that. :) In my mind “grave accent” is the pure
ASCII character; it just got abused for other things. Other options:
b2a_uu(data, space=False)
b2a_uu
Martin Panter added the comment:
I think changing FTPHandler may be more appropriate than urlsplit. But I
thought your other pull request <https://github.com/python/cpython/pull/1214>
in “ftplib” might be enough. Or are you trying to make it more user-friendly?
Also, FTPHandler is not u
Martin Panter added the comment:
Is this a duplicate of Issue 21327? There is some discussion there and a patch
to add get_socket_type that excludes SOCK_NONBLOCK.
--
nosy: +martin.panter
superseder: -> socket.type value changes after using settime
Martin Panter added the comment:
I suggest to close this as a duplicate. The pull request itself looks like the
right direction to me, but let’s not split the discussion up more than
necessary.
--
nosy: +martin.panter
resolution: -> duplicate
superseder: -> urllib FTP pr
Changes by Martin Panter :
--
dependencies: +No Documentation on tkinter dnd module
___
Python tracker
<http://bugs.python.org/issue15346>
___
___
Python-bug
Martin Panter added the comment:
See Issue 27579, where Victor wanted to focus on
<https://github.com/asyncio-doc/asyncio-doc> outside of Python.
--
nosy: +haypo, martin.panter
___
Python tracker
<http://bugs.python.org/i
Martin Panter added the comment:
For plain-text (non-SSL) HTTP uploads, perhaps using “socket.sendfile” would
help: Issue 13559.
Another idea would be to expose and document the low-level socket (or SSL
wrapper) and let the user copy data with whatever chunk size they desire.
--
nosy
Changes by Martin Panter :
--
resolution: -> duplicate
stage: test needed -> resolved
status: open -> closed
superseder: -> _bsddb: else misleadingly indented
___
Python tracker
<http://bugs.python
Martin Panter added the comment:
Issue 10395 added “os.path.commonpath” in 3.5.
--
nosy: +martin.panter
resolution: -> duplicate
stage: patch review -> resolved
status: languishing -> closed
superseder: -> new os.path function to extract common prefix based on path
Martin Panter added the comment:
See Issue 23702 specifically about unbound methods in Python 3, and Issue 25435
about general problems with the how-to in Python 3.
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue12
Changes by Martin Panter :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> docs.python.org/3/howto/descriptor.html still refers to
"unbound methods"
___
Python tracker
<http://b
Martin Panter added the comment:
Raymond I suggest you unassign this and let others work on it.
--
stage: patch review -> needs patch
___
Python tracker
<http://bugs.python.org/issu
Martin Panter added the comment:
This proposal would be useful. My use case is for when an API suppresses an
external exception context:
>>> import os
>>> try:
... os.environ["NEW_VARIABLE"] = bug # Hidden exception
... finally:
... del os.environ
Martin Panter added the comment:
This was discussed fairly recently:
<https://marc.info/?i=captjjmrbxpvyquyxshbc1j13m_h5or67cnbkrkysw4ef6rq...@mail.gmail.com>.
There seems to be a bit of support for changing this. It is not a bug fix, so
has to go into the next release, now 3.7.
I di
New submission from Martin Panter:
In Mercurial revision 6e5b5d1b6714, the documentation for
“assertMultiLineEqual” was changed from
This method is used by default when comparing Unicode strings with
“assertEqual”.
to
This method is used by default when comparing strings with “assertEqual
New submission from Martin Teichmann:
The arguments of a function which was decorated to be a context manager are
stored inside the context manager, and are thus kept alive.
This is a memory leak.
Example:
@contextmanager
def f(a):
do_something_with(a)
a = None
Changes by Martin Teichmann :
--
pull_requests: +1602
___
Python tracker
<http://bugs.python.org/issue30306>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue29823>
___
___
Martin Panter added the comment:
I suggest to discuss the non-determinism problem in Issue 1043134 (about
determining a canonical extension for each content type). I understood this bug
(Issue 4963) is about the behaviour of repeated initialization of the same
instance of mimetypes.
BTW an
Martin Panter added the comment:
I understand hash randomization was added after this bug was opened. Here is a
demonstration with “video/mp4”, which only has the extension “.mp4” built in.
But my /etc/mime.types file lists “mp4 mp4v mpg4”, so after the second
initialization the behaviour
Martin Panter added the comment:
It is also pointless to shuffle a list object repeating the same item, but that
is no reason to add a special case. Is there a real problem with allowing
dictionaries and OrderedDict? It seems to behave sensibly if you give each item
a unique value:
>&
Martin Panter added the comment:
In Python 2, the "open" function doesn't have a "newline" parameter. Perhaps
you were looking at the wrong documentation version.
--
nosy: +martin.panter
resolution: -> not a bug
stage: ->
Martin Panter added the comment:
On Python 2, I'm guessing you are getting extra CRs on Windows? It looks like
you have to open in binary mode there to avoid newline translation. This is
documented for the "reader" and &qu
Martin Teichmann added the comment:
I personally prefer the current situation. The problem is the following: when
an @contextmanager is first called, we don't know yet whether the user wants to
use it directly, or as a decorator, so we have to have some kind of hybrid
class. Once it'
Martin Teichmann added the comment:
Hi, so where do we go from here? I could write the proposed allow_recreation
flag, but IMHO this adds only dead code, as it is of no need at all. I don't
think code gets more clear by adding dead code...
I opted for one line more of comment, I think
Martin Panter added the comment:
What is the advantage of compiling calls to both Long and LongLong converters?
Isn’t it simpler to blindly call PyLong_FromUnsignedLongLong or similar?
--
nosy: +martin.panter
___
Python tracker
<h
Martin Panter added the comment:
I suspect the test won’t be effective with Editline (either fail, or silently
pass without testing the bug). From memory Editline uses an ~/.editrc file, not
INPUTRC, with different syntax and configuration
Martin Panter added the comment:
Lower-case “a” is defined at the top of the list: “The starting point . . . is
‘a.x’.” The last entry may fit in better if it was written “If binding to an
instance of ‘super’ ”.
The problem with the m() call is also mentioned in Issue 25777, about the
Martin Panter added the comment:
Cheryl: see also Issue 25777 and Issue 20751, both about the “super binding”
under Invoking Descriptors.
Raymond: if you want to just pick parts of my patch, go for it. But I don’t
understand your concern about explaining the MRO. I think it is important to
Martin Panter added the comment:
I think the benefit of the repr being easier to understand outweighs the pain
of breaking the old format. If the change is a problem, that might be mitigated
by adding an entry to the “Porting to Python 3.7” documentation.
I don’t think my option of factoring
Martin Panter added the comment:
For the curious, Nick added the “frequently used arguments” in Issue 13237.
Before that the signatures were like
<https://docs.python.org/release/3.2.2/library/subprocess.html#convenience-functions>:
subprocess.call(*popenargs, **kwargs)
-
Martin Panter added the comment:
If you add “cwd” to Frequently Use Arguments, please try to keep the details in
one place. Otherwise you encourage a fix for Issue 15533 (cwd platform
specifics) to repeat the problem of Issue 20344 (args vs shell platform
specifics), where some details are
Martin Panter added the comment:
Also, “-bb” turns it into an exception, and the same applies to bytes vs int:
>>> b"a" == "a"
Traceback (most recent call last):
File "", line 1, in
BytesWarning: Comparison between bytes and string
>>> b"
Martin Panter added the comment:
I backported Issue 12067 documentation, so hopefully this is fixed.
--
resolution: -> out of date
stage: -> resolved
status: open -> closed
superseder: -> Doc: remove errors about mixed-type comparisons.
__
501 - 600 of 8156 matches
Mail list logo