Alexander Whatley added the comment:
I should probably add that this was after using conda update on a Python 3.5.0
installation.
--
___
Python tracker
<http://bugs.python.org/issue25
New submission from Alexander Riccio:
I found this while writing up a separate bug (CPython doesn't use static
analysis!).
In PC/launcher.c, get_env has a bug:
/* Large environment variable. Accept some leakage */
wchar_t *buf2 = (wchar_t*)malloc(sizeof(wchar_t) * (res
Changes by Alexander Riccio :
--
type: -> crash
___
Python tracker
<http://bugs.python.org/issue25844>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Alexander Riccio:
I found this while writing up a separate bug (CPython doesn't use static
analysis!).
In _ctypes/cfield.c, Z_set has a bug of some sort:
if (PyLong_Check(value) || PyLong_Check(value)) {
See: https://hg.python.org/cpython/file/tip/Modules/_c
New submission from Alexander Riccio:
I found this while writing up a separate bug (CPython doesn't use static
analysis!).
In modules/posixmodule.c, win32_wchdir uses Py_ARRAY_LENGTH on a wchar_t*:
wchar_t _new_path[MAX_PATH], *new_path = _new_path;
int result;
wchar_t env[4
New submission from Alexander Riccio:
Visual Studio comes with static analysis, enabled by /analyze (command line) or
"Code analysis" in the project configuration dialog. Currently, none of the
CPython projects in PCbuild have Code Analysis turned on, in any configuration.
I wa
Alexander Riccio added the comment:
> Is analyze something that can be used from the command line only, or does it
> require the GUI?
You can do it from the command line - Chrome/chromium makes use of it as such.
See: https://code.google.com/p/chromium/issues/detail?id=427616
The /a
Alexander Riccio added the comment:
> Are you aware of the Coverity program? Last time I heard about Coverity,
> CPython had 0 bug found by Coverity ;-)
Yup, see Issue25847.
> The sad part is that Py_ARRAY_LENGTH() is written for static analysis
Sadly, yeah. MSVC, when compi
Alexander Riccio added the comment:
> OK, let's move this to patch needed, then, and see if anyone is ambitious
> enough to do the work needed to make it useful to us :)
I can try and hack it in, just as proof of concept. I think I should just be
able to add something like:
/p:En
Alexander Riccio added the comment:
Yup, the very naive version works.
--
keywords: +patch
Added file: http://bugs.python.org/file41311/EnableCodeAnalysis.patch
___
Python tracker
<http://bugs.python.org/issue25
Alexander Riccio added the comment:
> That is, (as I undersatnd it) we've done a lot of work to not have compiler
> warnings generated during compilation, and we don't want to backtrack on that.
Well, as-is, simply building as x64 generates a bunch of warnings, so it's
Alexander Riccio added the comment:
Actually, hmm... the very naive version *DOES NOT* work. Grr.
--
___
Python tracker
<http://bugs.python.org/issue25
Alexander Riccio added the comment:
Hold on... CPython builds at /W3???!? What is this madness??!?
--
Added file: http://bugs.python.org/file41312/CPythonW3.PNG
___
Python tracker
<http://bugs.python.org/issue25
Alexander Riccio added the comment:
> In which direction do you find us to be mad?
That's really quite a low warning level! For a large project, I can't imagine
anything less than /W4!
--
___
Python tracker
<http://bugs.pytho
Alexander Belopolsky added the comment:
It looks like issue19475_v3.patch uses some fancy Unicode quotes in the
docstrings and .rst docs. Please change them to ASCII.
--
___
Python tracker
<http://bugs.python.org/issue19
Alexander Belopolsky added the comment:
GvR> I suppose there isn't a real use case for 'hours' but it seems silly to
leave it out.
Shouldn't we also have 'none' to leave out the time component entirely?
--
Alexander Belopolsky added the comment:
> The problem here is that millisecond and nanosecond seems not to be
> attributes of the datetime object.
millisecond = dt.microsecond // 1000
nanosecond = 0 # until we add it to datetime.
--
___
Alexander Belopolsky added the comment:
> Actually, nanosecond = dt.microsecond*1000.
I was thinking in terms breaking the fractional part of say
00:00:00.123456789
into
mili = 123
micro = 456
nano = 789
but you are right, a correct analogy for dt.microsecond in this case will
Alexander Belopolsky added the comment:
I think timespec= option should also be added to the time.isoformat method.
--
___
Python tracker
<http://bugs.python.org/issue19
Alexander Riccio added the comment:
I'll open up a new issue for /W4, and deal with that first.
--
___
Python tracker
<http://bugs.python.org/issue25847>
___
___
New submission from Alexander Riccio:
This issue is related to Issue25847.
Compiling at /W4 is generally a good idea. It's an industry best practice, and
even though I don't expect disagreement, I'll throw in a few coding standard
links:
https://www.securecoding.cert.org/confl
Alexander Riccio added the comment:
The warnings that I've disabled are:
C4054, "'conversion' : from function pointer 'type1' to data pointer 'type2'":
https://msdn.microsoft.com/en-us/library/07d15ax5(v=vs.90).aspx
I disabled 4054be
Alexander Riccio added the comment:
I've added the text build output.
--
Added file: http://bugs.python.org/file41322/W4_v2_build_output
___
Python tracker
<http://bugs.python.org/is
Alexander Riccio added the comment:
See Issue25878.
--
___
Python tracker
<http://bugs.python.org/issue25847>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Alexander Riccio :
--
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
___
Python tracker
<http://bugs.python.org/issue25878>
___
___
Python-bug
Changes by Alexander Riccio :
--
components: +Windows
___
Python tracker
<http://bugs.python.org/issue25878>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Alexander Riccio:
This is safe, but warns on /W4. In maybe_handle_shebang, an unsigned char* is
passed to find_BOM, which accepts a char*
(https://hg.python.org/cpython/file/tip/PC/launcher.c#l1139).
Without an explicit cast, this generates a warning:
10>..\PC\launche
Alexander Riccio added the comment:
> The problem with this bug report is that there is little chance that it gets
> resolved in the near term, and it's quite possible that it will stay open for
> years. Somebody would have to sit down and start producing patches to fix
&g
New submission from Alexander Riccio:
See: https://hg.python.org/cpython/file/tip/Modules/posixmodule.c#l3466
The variable PyObject *po in _listdir_windows_no_opendir is initialized but not
used. Given that there's a variable named po_wchars, and two PyObject
variables, I'm goin
Alexander Riccio added the comment:
(in the same function, char *bufptr is ALSO unused)
--
___
Python tracker
<http://bugs.python.org/issue25890>
___
___
Pytho
New submission from Alexander Riccio:
See: https://hg.python.org/cpython/file/tip/Modules/posixmodule.c#l12383
The variable int meth_idx is initialized but not used. I have no idea how it
got there.
--
components: Windows
messages: 256553
nosy: Alexander Riccio, paul.moore
New submission from Alexander Riccio:
See: https://hg.python.org/cpython/file/tip/Objects/unicodeobject.c#l7335
The variable PyObject *exc in encode_code_page_strict is initialized but not
used.
--
components: Windows
messages: 256554
nosy: Alexander Riccio, paul.moore, steve.dower
New submission from Alexander Riccio:
See: https://hg.python.org/cpython/file/tip/PC/getpathp.c#l324
The second variable named `reqdSize` in getpythonregpath is initialized but not
used.
--
components: Windows
messages: 256555
nosy: Alexander Riccio, paul.moore, steve.dower
Alexander Belopolsky added the comment:
> ~/Documenti/cpython$ ./python -m test -v datetimetester
You shouldn't use "datetimetester" on the command line. Use "test_datetime"
instead.
--
___
Python tracker
<ht
Alexander Riccio added the comment:
Cut out more noisy warnings.
--
Added file: http://bugs.python.org/file41333/W4_v3.patch
___
Python tracker
<http://bugs.python.org/issue25
Alexander Riccio added the comment:
> This should be about a 2 line change, but the current patch is several
> hundred lines of spam.
I agree, but wasn't immediately sure how to do so.
Unfortunately, I've been working on other things, and I'm not sure when I'
Alexander Riccio added the comment:
If there are few enough instances, then using a #pragma warning(suppress:4232)
is probably the best idea.
--
___
Python tracker
<http://bugs.python.org/issue25
New submission from Alexander Riccio:
I'm really not sure what it'd look like, or how it'd work, but CPython should
take advantage of Microsoft's Antimalware Scan Interface, which is new to
Windows 10. It's designed for applications like interpreters, which can execute
Alexander Riccio added the comment:
See "Windows 10 to offer application developers new malware defenses"
https://blogs.technet.microsoft.com/mmpc/2015/06/09/windows-10-to-offer-application-developers-new-malware-defenses/
for an example of how AMSI works with PowerShell.
I
Alexander Riccio added the comment:
See also: "Security Focus: Defending PowerShell with the Anti-Malware Scan
Interface (AMSI)"
http://blogs.technet.com/b/poshchap/archive/2015/10/16/security-focus-defending-powershell-with-windows-def
Alexander Riccio added the comment:
When I say "I'm really not sure what it'd look like, or how it'd work" I mean
at the C level. At a higher level, there are many places that I imagine are
good places to use AMSI: Perhaps expressions passed in from the command lin
Changes by Alexander Belopolsky :
--
assignee: -> belopolsky
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org/issue19475>
___
__
Alexander Belopolsky added the comment:
Is issue19475_v12.patch the final patch? I don't see it addressing Guido's
suggestion in msg256470 to add milli- and nanoseconds options.
--
___
Python tracker
<http://bugs.python.o
Alexander Belopolsky added the comment:
I left some comments on Rietveld.
--
stage: commit review -> needs patch
___
Python tracker
<http://bugs.python.org/issu
Alexander Belopolsky added the comment:
> I don't really think nanoseconds belong here.
What about milliseconds? I'll leave it for Guido to make a call on
nanoseconds. My vote is +0.5.
> If they don't
> exist anywhere else in the module, why should they be suddenly
Alexander Riccio added the comment:
#pragma warning(disable : 4232) is almost always NOT what you want.
See: http://www.viva64.com/en/k/0048/
--
nosy: +Alexander Riccio
___
Python tracker
<http://bugs.python.org/issue26
Alexander Riccio added the comment:
> Please stop educating us.
Sorry, not what was intended! Tone transmits poorly.
--
___
Python tracker
<http://bugs.python.org/issu
Alexander Mohr added the comment:
I'm not sure if you guys are still listening on this closed bug but I think
I've found another issue ;) I'm using python 3.5.1 + asyncio 3.4.3 with the
latest aiobotocore (which uses aiohttp 0.21.0) and had two sessions (two
TCPConnector
Alexander Mohr added the comment:
update: its unrelated to the number of sessions or SSL, but instead to the
number of concurrent aiohttp requests. When set to 500, I get the error, when
set to 100 I do not.
--
___
Python tracker
<h
Alexander Mohr added the comment:
sorry for disruption! ends up our router seems to be doing some kind of QoS
limits on # of connections :(
--
___
Python tracker
<http://bugs.python.org/issue25
Alexander Belopolsky added the comment:
We discussed truncation vs. rounding some time ago. See msg202270 and the
posts around it. The consensus was the same as Guido's current advise: do the
truncation.
--
___
Python tracker
Alexander Belopolsky added the comment:
-1 "foolish consistency" and all that ...
In the context of partial, it is fairly clear that "keywords" means "keyword
arguments" while it may not be as clear in other more specialized contexts. In
the age of autocomplet
Alexander Belopolsky added the comment:
This is not no more bug than
>>> from datetime import *
>>> datetime.strptime('0228', '%m%d')
datetime.datetime(1900, 2, 28, 0, 0)
Naturally, as long as datetime.strptime('0228', '%m%d
Alexander Belopolsky added the comment:
> Python's time.strptime() behavior is consistent with that of glibc 2.19
Gregory,
I believe OP is complaining about the way datetime.datetime.strptime() behaves,
not time.strptime() which is mentioned as (preferred?) alternative.
See msg26
Changes by Alexander Belopolsky :
--
stage: needs patch -> patch review
___
Python tracker
<http://bugs.python.org/issue19475>
___
___
Python-bugs-list mai
Alexander Belopolsky added the comment:
Guido,
Did you consider MAL's msg202274? I am still in favor of truncation, but would
like to make sure we are not missing something that MAL knows from experience.
--
___
Python tracker
Alexander Belopolsky added the comment:
Another argument for truncation is that this is what GNU date does:
$ date --iso-8601=seconds --date="2016-03-01 15:00:00.999"
2016-03-01T15:00:00-0500
--
___
Python tracker
<http://bugs.python.o
Alexander Belopolsky added the comment:
I hope my prediction "I am afraid that the rounding issues may kill this
proposal" (see msg202276) will not come true.
I think the correct way to view "timespec" is a way to suppress/enforce
printing of trailing digits.
Users that
Alexander Belopolsky added the comment:
Personally, I don't rounding is that useful. My working assumption is that
users will select say timespec='millisecond' only when they know that their
time source produces datetime instances with millisecond precision and they
don'
Alexander Belopolsky added the comment:
I feel odd trying to advocate a POV that I disagree with, so let me just quote
MAL:
"""
In practice you often don't know the resolution of
the timing source. Nowadays, the reverse of what you said
is usually true: the source resol
Alexander Belopolsky added the comment:
Alessandro, thank you very much for your work and perseverance. I will do my
best to commit this next weekend.
--
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org/issu
Alexander Belopolsky added the comment:
In the contexts that you mentioned, "integral" is a synonym of "integer."
--
nosy: +belopolsky
___
Python tracker
<http://bug
Alexander Belopolsky added the comment:
> Can you provide a source ?
How about a dictionary? For example, Oxford English Dictionary has
"""
integral, adj. and n.
4. Math.
a. That is, or is denoted by, an integer, or involves only integers;
consisting of a whole n
Alexander Belopolsky added the comment:
Wouldn't '\N{SNAKE}' look more pythonic? 😀
>>> hex(ord('🐍'))
'0x1f40d'
--
nosy: +belopolsky
___
Python
Alexander Belopolsky added the comment:
The SO example works for me with Python 3.5.1:
Python 3.5.1 (default, Mar 8 2016, 12:33:47)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" f
Changes by Alexander Belopolsky :
--
stage: -> resolved
___
Python tracker
<http://bugs.python.org/issue26561>
___
___
Python-bugs-list mailing list
Unsubscrib
Alexander Mohr added the comment:
any chance if this getting into 3.5.2? I have some gross code to get around it
(setting global properties)
--
nosy: +thehesiod
___
Python tracker
<http://bugs.python.org/issue21
Changes by Alexander Belopolsky :
--
hgrepos: +335
___
Python tracker
<http://bugs.python.org/issue24773>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Alexander Belopolsky :
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue26200>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexander Belopolsky added the comment:
I am late to this discussion, but FWIW, I would like to back Raymond up. For
me, Py_XDECREF is usually a sign of lazy programming and an optimization
opportunity. In many cases I've seen, Py_XDECREF is used under a "done:" label
and c
New submission from Alexander Belopolsky:
With TZ=America/New_York,
>>> from datetime import *
>>> u = datetime(2015, 11, 1, 5, tzinfo=timezone.utc)
>>> t = u.astimezone()
>>> print(t)
2015-11-01 01:00:00-04:00
>>> print(t.astimezone())
2015-11-0
Alexander Belopolsky added the comment:
See also #9527.
--
___
Python tracker
<http://bugs.python.org/issue26616>
___
___
Python-bugs-list mailing list
Unsub
Changes by Alexander Belopolsky :
--
assignee: -> belopolsky
keywords: +patch
nosy: +haypo, tim.peters
stage: needs patch -> patch review
Added file: http://bugs.python.org/file42262/issue26616.diff
___
Python tracker
<http://bugs.p
Alexander Belopolsky added the comment:
This bug affects versions starting at 3.3. Can someone advise to what versions
the patch should be applied?
--
versions: +Python 3.3, Python 3.4
___
Python tracker
<http://bugs.python.org/issue26
Changes by Alexander Belopolsky :
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue26591>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Alexander Belopolsky :
--
assignee: -> belopolsky
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org/issue25729>
___
__
Alexander Belopolsky added the comment:
You may want to take a look a PyCharm's preferences dialog for inspiration. I
am attaching a screenshot. I like the way they show installed and the latest
available versions.
--
nosy: +belopolsky
Added file: http://bugs.python.org/file
Alexander Belopolsky added the comment:
Python 3.6.0a0 (default:245a16f33c4b, Mar 25 2016, 14:11:43)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>
Alexander Belopolsky added the comment:
> When you made your first astimezone() call, (t = u.astimezone()),
> it was made without a tzinfo parameter, and should result in t's
> timezeone being EST by the documentation.
No, u in my test case was selected to be right before the &q
Changes by Alexander Belopolsky :
--
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org/issue26616>
___
___
Python-bugs-list mai
Changes by Alexander Belopolsky :
--
versions: -Python 3.3, Python 3.4
___
Python tracker
<http://bugs.python.org/issue26616>
___
___
Python-bugs-list mailin
Changes by Alexander Belopolsky :
--
resolution: -> fixed
stage: commit review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Alexander Belopolsky added the comment:
The fix was applied to default in c9bc6614a652 but I got the commit message
wrong. I will not attempt to fix it (not sure it is even possible in hg.)
--
___
Python tracker
<http://bugs.python.org/issue26
Bob Alexander added the comment:
Since there seems to be ongoing work on the "which"
function, here are a few more thoughts on this function's
future:
- The existing version does not prepend the current
directory to the path if it is already in the path.
If the current
Bob Alexander added the comment:
Oops, clarification...
I just reread my kind of long previous post, and realized it wasn't very
explicit that anything concerning file extensions or prepending the current
directory to the PATH apply to Windows only; not Unix (of course).
The "
New submission from Alexander Marshalov:
Missed peephole optimization:
1 > 2 -> False
3 < 4 -> True
5 == 6 -> False
6 != 7 -> True
7 >= 8 -> False
8 <= 9 -> True
10 is 11 -> False
12 is not 13 -> True
14 in (15, 16, 17)
Alexander Marshalov added the comment:
Hi all, this is my first patch to Python.
I'm interested in the performance of python code, I even worked on the
development of the static optimizer based on modifications of the AST.
I had a few ideas for improving peepholer (for example, the expre
Alexander Mohr added the comment:
any updates on this? I think this would be perfect for
https://github.com/aio-libs/aiobotocore/issues/31
--
nosy: +thehesiod
___
Python tracker
<http://bugs.python.org/issue23
Alexander Belopolsky added the comment:
Let me dig up the history, but this does not look like correct rounding to me:
>>> datetime.utcfromtimestamp(1424817268.274)
datetime.datetime(2015, 2, 24, 22, 34, 28, 273999)
>>> decimal.Decimal(1424817268.274)
Decimal('1424817268
Alexander Belopolsky added the comment:
It looks like it was an intentional change. See #14180 (changeset
75590:1e9cc1a03365).
I am not sure what the motivation was. Note that this change made
utcfromtimestamp(t) different from datetime(1970,1,1) + timedelta(seconds=t).
--
keywords
Alexander Belopolsky added the comment:
Victor's motivation for the change was (msg154811):
"""
I chose this rounding method because it is the method used by int(float) and
int(time.time()) is a common in programs (more than round(time.time()).
Rounding towards zero a
Changes by Alexander Belopolsky :
--
nosy: +haypo
___
Python tracker
<http://bugs.python.org/issue23517>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexander Belopolsky added the comment:
> I noticed that the rounding mode of datetime is currently wrong.
What do you mean by "currently"? What versions of python have it wrong?
--
___
Python tracker
<http://bugs.pytho
Alexander Belopolsky added the comment:
Victor,
Would you consider going back to round to nearest? Mark and I put in a lot of
effort to get the rounding in the datetime module right. (See for example,
#8860.)
Sub-microsecond timesources are still rare and users who work with such should
New submission from Alexander Belopolsky:
>>> import sys
>>> sys.modules['_datetime'] = None
>>> from datetime import timedelta
>>> timedelta(seconds=1)*0.6112295
Traceback (most recent call last):
File "", line 1, in
File "
Changes by Alexander Belopolsky :
--
nosy: +bdkearns, benjamin.peterson
___
Python tracker
<http://bugs.python.org/issue23521>
___
___
Python-bugs-list mailin
Alexander Belopolsky added the comment:
Attached patch fixes the issue, but produces a slightly different result:
>>> timedelta(seconds=1)*0.6112295
datetime.timedelta(0, 0, 611230)
Note that C implementation is probably buggy:
>>> from datetime import *
>>> tim
Changes by Alexander Belopolsky :
--
keywords: +3.3regression -3.2regression
___
Python tracker
<http://bugs.python.org/issue23517>
___
___
Python-bugs-list mailin
Alexander Belopolsky added the comment:
> I don't understand "nearest".
Sorry for using loose terms. I was hoping the in the context of "going back",
it would be clear.
I believe the correct mode is "ROUND_HALF_EVEN". This is the mode used by the
bui
Alexander Belopolsky added the comment:
> For example, in my local patch, I'm using ROUND_FLOOR for:
> - datetime.date.fromtimestamp()
> - datetime.datetime.fromtimestamp()
These should use ROUND_HALF_EVEN
> - datetime.datetime.now()
> - datetime.datetime.utcnow()
Thes
3801 - 3900 of 4097 matches
Mail list logo