Change by Ashley Anderson :
--
nosy: +aganders3
___
Python tracker
<https://bugs.python.org/issue46376>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Collin Anderson :
isatty() is a system call on linux. Most open()s are files, and we're already
getting the size of the file. If it has a size, then we know it's not a atty,
and can avoid calling it.
--
___
Python tracker
Change by Collin Anderson :
--
keywords: +patch
pull_requests: +28096
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29870
___
Python tracker
<https://bugs.python.org/issu
Change by Collin Anderson :
--
components: IO
nosy: collinanderson
priority: normal
severity: normal
status: open
title: Avoid calling isatty() for most open() calls
type: performance
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python
3.9
Amos Anderson added the comment:
Ah, thank you, Serhiy. I didn't know that, but I see that in the documentation:
https://docs.python.org/3/reference/compound_stmts.html#the-try-statement
But what about the 2nd case I presented where a `RuntimeError` was raised?
That's the actual case I'm
Amos Anderson added the comment:
If I do this instead:
```
try:
logger.info("raising exception")
raise ValueError("my exception1")
finally:
logger.info("stopped")
loop.stop()
await asyncio.sleep(0.5)
```
i.e., do a
New submission from Amos Anderson :
I found a case where an exception is lost if the loop is stopped in a `finally`.
```
import asyncio
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger()
async def method_that_raises():
loop = asyncio.get_event_loop
Carl Anderson added the comment:
>The proposal I like is for a unicode numeric normalization functions that
>return the ascii equivalent to exist.
@Gregory P. Smith
this makes sense to me. That does feel like the cleanest solution.
I'm currently doing s = s.replace("⁄",&
Carl Anderson added the comment:
>Carl: can you say more about the problem that motivated this issue?
@mark.dickinson
I was parsing a large corpus of ingredients strings from web-scraped recipes.
My code to interpret strings such as "1/2 cup sugar" would fall over every
Carl Anderson added the comment:
I guess if we are doing slashes, then the division sign ÷ (U+00F7) should be
included too.
There are at least 2 minus signs too (U+002D, U+02D7).
--
___
Python tracker
<https://bugs.python.org/issue43
Carl Anderson added the comment:
from https://en.wikipedia.org/wiki/Slash_(punctuation) there is
U+002F / SOLIDUS
U+2044 ⁄ FRACTION SLASH
U+2215 ∕ DIVISION SLASH
U+29F8 ⧸ BIG SOLIDUS
U+FF0F / FULLWIDTH SOLIDUS (fullwidth version of solidus)
U+1F67C VERY HEAVY SOLIDUS
In XML and HTML
New submission from Carl Anderson :
Fraction works with a regular slash:
>>> from fractions import Fraction
>>> Fraction("1/2")
Fraction(1, 2)
but there are other similar slashes such as (0x2044) in which it throws an
error:
>>> Fraction("0⁄2&q
Thomas Anderson added the comment:
IIRC, some transpilers for functional languages create deeply nested code. In
particular for things like haskell's do notation.
Anyway, when I wrote the PR, it was initially to reduce the frame size. Then
once I had dynamic block stack sizing working, I
New submission from Thomas Anderson :
The runtime pushes a frame block in SETUP_FINALLY, so the compiler needs to
account for that, otherwise the runtime block stack may overflow.
--
components: Interpreter Core
messages: 388696
nosy: tomkpz
priority: normal
severity: normal
status
Tore Anderson added the comment:
You're right. I got it confused with the conn object in the code I was working
on, because it turns out that it has an execute() method:
>>> import sqlite3
>>> c = sqlite3.connect('test.db')
>>> c.execute('SELECT * FROM
Tore Anderson added the comment:
You're looking in the wrong place, the buggy ones are at
https://github.com/python/cpython/blame/e161ec5dd7ba9355eb06757b9304019ac53cdf69/Doc/library/sqlite3.rst#L74-L76
Tore
--
___
Python tracker
<ht
New submission from Tore Anderson :
In https://docs.python.org/3/library/sqlite3.html, the following example code
is found:
> # Do this instead
> t = ('RHAT',)
> c.execute('SELECT * FROM stocks WHERE symbol=?', t)
> print(c.fetchone())
However this fails as follows:
> Traceba
Thomas Anderson added the comment:
> Reducing the size of the frame object seems like a worthwhile goal, but
> what's the point in increasing the maximum block stack?
No point for humans, but it may be useful for code generators.
--
___
New submission from Thomas Anderson :
Currently the block stack size is hardcoded to 20. Similar to how the value
stack is dynamically sizable, we should make the block stack dynamically
sizable. This will reduce space on average (since the typical number of blocks
for a function is well
Bo Anderson added the comment:
> You don't even need a C program to reproduce
Indeed, touch is built upon the POSIX file API (unless Apple modified it). The
idea for the Apple bug report was to show it happening at a low level and not
specific to a given tool.
> And the "cd"
Bo Anderson added the comment:
Indeed. The issue can be trivially reproduced with:
```
#include
#include
#include
#include
int main()
{
char buf[255];
printf("Current dir: %s\n", getcwd(buf, 255));
int fd = open("../../tmp/test.txt", O_WRONLY | O_
Bo Anderson added the comment:
For what it's worth, this is having an impact on some real code:
https://github.com/Homebrew/homebrew-core/pull/45110
Perhaps a simpler way to reproduce is:
% cd /tmp
% python3 -c 'import os; open(os.path.relpath("/tmp/test.txt"), "w")'
Tr
New submission from Charles Anderson :
When calling mp.Pool().apply_async(), and passing a mp.Queue() instance as an
argument the execution halts.
This is contrasted by using mp.Manager().Queue() which when passed to
apply_async() works as expected.
--
components: Library (Lib
Change by Marc Adam Anderson :
--
nosy: -marcadam
___
Python tracker
<https://bugs.python.org/issue1154351>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Collin Anderson :
--
components: Library (Lib)
nosy: collinanderson
priority: normal
pull_requests: 8422
severity: normal
status: open
title: Add add HTTPConnection.settimeout()
type: enhancement
___
Python tracker
<ht
Ric Anderson <azri...@gmail.com> added the comment:
well then, I guess y'all can close this ticket
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Ric Anderson <azri...@gmail.com> added the comment:
Okay, are virtual env's expected to not be compatible as well?
E.g., I built a venv under 3.5; venv copied in the 3.5 python executable, but
not the needed library; should not -mvenv also copy libpython3.5 into the
virutal
New submission from Ric Anderson <azri...@gmail.com>:
When a site updates python3 from 3.5 to 3.6 (based on
https://docs.python.org/3/faq/general.html#how-does-the-python-version-numbering-scheme-work,
this is would be a minor version update),pre-upgrade venv setups created with
&q
Changes by Anderson <anders...@gmail.com>:
--
title: 'Cannot serialize socket object' after ssl_wrap -> 'Cannot serialize
socket object' after ssl.wrap_socket
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
New submission from Anderson:
---
Traceback (most recent call last):
File "/usr/local/lib/python3.6/socketserver.py", line 317, in
_handle_request_noblock
self.process_request(request, client_address)
File "/opt/storage_server/server_tc
Dave Anderson added the comment:
Sorry, should have shown sudo ls -l output for 3.6:
[vagrant@developer tmp]$ sudo ls -l Python-3.6.0
total 1016
-rw-r--r-- 1 caturra games 10910 Dec 22 18:21 aclocal.m4
-rwxr-xr-x 1 caturra games 42856 Dec 22 18:21 config.guess
-rwxr-xr-x 1 caturra games
New submission from Dave Anderson:
Downloaded https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
Extracted on CentOS6 with sudo tar -xf Python-3.6.0.tgz
Result:
[vagrant@developer tmp]$ ls -l Python-3.6.0
ls: cannot access Python-3.6.0/Tools: Permission denied
ls: cannot access Python
New submission from Ashley Anderson:
I noticed a few references to `unittest2` in the documentation in the
`unittest.mock` "getting started" section:
https://docs.python.org/3.6/library/unittest.mock-examples.html#patch-decorators
I am attaching a patch that just changes these o
Collin Anderson added the comment:
It should be safe to hard split on semicolon. `name="some;value"` is not valid,
even though it's quoted. I think raw double quotes, commas, semicolons and
backslashes are _always_ invalid characters in cookie values.
>From https://tools.ietf.org
Collin Anderson added the comment:
The issue I'm currently running into, is that although browsers correctly
ignore invalid Set-Cookie values, they allow 'any CHAR except CTLs or ";"' in
cookie values set via document.cookie.
So, if you say document.cookie = 'key=va"lue; path=
Changes by Ashley Anderson <agande...@gmail.com>:
Added file: http://bugs.python.org/file40660/issue12006_10_complete.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Ashley Anderson added the comment:
Another *ping* for a patch review since it's been almost a month since the last
one.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Ashley Anderson added the comment:
Thanks Alexander, but I think the latest patch is still mine. It seems strange
to review my own patch. I'll do it if that's common, but since this will
(hopefully, eventually) be my first accepted patch I would appreciate the
feedback from another reviewer
Ashley Anderson added the comment:
Haha, thanks Erik. It seems you know my tastes enough to not offer a
chocolate-based reward. =)
I was actually set to "ping" to request a patch review today, as it's been one
month since my last submission. Please let me know if I need to update
Ashley Anderson added the comment:
Thanks for the review and the good suggestions. Hopefully this new patch is an
improvement.
I didn't know about the context manager for assertRaises - I was just following
the format for another ValueError test a few lines above.
The frozenset and re
Ashley Anderson added the comment:
Here is an updated patch with implementation as outlined in msg247525.
--
Added file: http://bugs.python.org/file40085/issue12006_7_complete.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Ashley Anderson added the comment:
Wow, I can't believe this issue is so old now! I'm motivated to finally come
back and address the remaining issues to get this merged. Sorry for seemingly
abandoning this; I'm embarrassed I didn't push to finish it earlier.
It sounds like the consensus
New submission from Anderson:
Correct me if I'm wrong, the struct module does not work with array of ints,
floats etc (just work with char in the form of strings). I think it should
since this are valid elements in C structs.
More specifically, consider I have this C struct
struct{
int
Anderson added the comment:
@wolma, That would work in this simple example. But in a more complicated case
this became inconvenient.
Actually I'm working with reading and writing in python an extremely C-oriented
file-type (MDV). For that I represent C-structs as python dics (e.q
{array:[v1
New submission from Collin Anderson:
Can we remove references to #python.web? I assume it was a flourishing channel
at some point.
https://docs.python.org/3/howto/webservers.html#other-notable-frameworks
--
assignee: docs@python
components: Documentation
messages: 232550
nosy
New submission from Gene Anderson:
In the tutorial for Python 3.3 the content for 9.3.4 Method Objects seems to
have an error. In the following lines:
xf = x.f
while True:
print(xf())
... it seems to me that based on the x object's method f(), the command should
be
print(x.f
Gene Anderson added the comment:
I failed to mention that the associated web address for the documentation is:
http://docs.python.org/3.3/tutorial/classes.html#method-objects
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Marc Adam Anderson added the comment:
This enhancement has been implemented. The code is based on hoffman's code.
Tests for this enhancement, as well as tests for os.getcwd() have also been
added. The docs have been updated and tested locally.
--
keywords: +patch
nosy: +marcadam
Added
Marc Adam Anderson added the comment:
Unable to reproduce this bug on Mac OS X 10.8.3 (12D78) using Python 3.4.0a0
and the following browsers:
- Google Chrome 25.0.1364.172
- Firefox 13.0.1
- Safari 6.0.3 (8536.28.10)
--
nosy: +marcadam
___
Python
Marc Adam Anderson added the comment:
Tested patch using Python 3.4.0a0 on Mac OS X 10.8.3 (12D78). Patch appears to
fix the bug.
--
nosy: +marcadam
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8862
Ashley Anderson agande...@gmail.com added the comment:
Attaching a patch for the documentation just in time for the weekend!
--
Added file: http://bugs.python.org/file22240/12006_doc.patch
___
Python tracker rep...@bugs.python.org
http
Ashley Anderson agande...@gmail.com added the comment:
When trying to add cases for %V and %u in the tests, I ran into an issue of
year ambiguity. The problem comes when the ISO year does not match the
Gregorian year for a given date. I think this should be fixed by implementing
the %G
Ashley Anderson agande...@gmail.com added the comment:
The example that triggered the issue in testing was January 1, 1905. The ISO
date for this day is 1904 52 7. This is reported correctly if you use
datetime.isocalendar() or datetime.strftime('%G'), but you get 1905 if you use
Ashley Anderson agande...@gmail.com added the comment:
I disagree, I think %G is necessary in strptime(). Take Monday, December 31,
2001 as an example. The ISO date is 2002 01 1.
Now, given only the Gregorian year (2001) for this date, and the ISO week and
weekday (01 1
Ashley Anderson agande...@gmail.com added the comment:
OK, here is my second attempt. I think it functions as desired, but a code
review may reveal flaws in my implementation. I'm sure there are associated
tests and documentation to write, but I have basically no experience with that
yet
Changes by Ashley Anderson agande...@gmail.com:
Removed file: http://bugs.python.org/file22101/12006.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12006
Ashley Anderson agande...@gmail.com added the comment:
Thanks everyone, please take your time if there are more pressing issues; I'll
get to work on tests and documentation in the mean time. I agree that
'_calc_julian_from_V' is a bit strange. I was mimicking a similar helper
function's name
Changes by Ashley Anderson agande...@gmail.com:
--
nosy: +Ashley.Anderson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12006
___
___
Python-bugs
Ashley Anderson agande...@gmail.com added the comment:
I've recently joined the python-mentors mailing list because I love Python and
want to get involved. I found this bug in the list of Easy issues and thought
I'd try my hand. Anyway, this is my first patch, so please forgive me if I am
Ashley Anderson agande...@gmail.com added the comment:
Thanks, I think I understand the original post now. Upon reading the docs and
code, however, it seems this is possible using the %W and %w directives. Is the
issue just to support the different letters (%V and %u) specifically
Amos Anderson nitroa...@gmail.com added the comment:
I believe I applied the patch correctly to my Python-2.6.5.tar.bz2, on my OSX
10.6.3 machine, configured with:
./configure --enable-framework=/Users/amos/triad/trunk/src/python
but make install now fails with this error at the end:
ln: /usr
New submission from David Anderson [EMAIL PROTECTED]:
Some test cases in Lib/test/mapping_tests.py are problematic for users
wishing to test their own implementations of the mapping protocol:
- TestHashMappingProtocol.test_repr() requires the user implementations
to look like a dict when repr
62 matches
Mail list logo