[issue46376] PyMapping_Check returns 1 for list

2022-01-14 Thread Ashley Anderson
Change by Ashley Anderson : -- nosy: +aganders3 ___ Python tracker <https://bugs.python.org/issue46376> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45944] Avoid calling isatty() for most open() calls

2021-11-30 Thread Collin Anderson
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

[issue45944] Avoid calling isatty() for most open() calls

2021-11-30 Thread Collin Anderson
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

[issue45944] Avoid calling isatty() for most open() calls

2021-11-30 Thread Collin Anderson
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

[issue45894] exception lost when loop.stop() in finally

2021-11-24 Thread Amos Anderson
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

[issue45894] exception lost when loop.stop() in finally

2021-11-24 Thread Amos Anderson
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

[issue45894] exception lost when loop.stop() in finally

2021-11-24 Thread Amos Anderson
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

[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-23 Thread Carl Anderson
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("⁄",&

[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-22 Thread Carl Anderson
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

[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Carl Anderson
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

[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Carl Anderson
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

[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Carl Anderson
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

[issue42917] Block stack size for frame objects should be dynamically sizable

2021-03-14 Thread Thomas Anderson
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

[issue43495] Missing frame block push in compiler_async_comprehension_generator()

2021-03-14 Thread Thomas Anderson
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

[issue43396] Non-existent method sqlite3.Connection.fetchone() used in docs

2021-03-04 Thread Tore Anderson
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

[issue43396] Non-existent method sqlite3.Connection.fetchone() used in docs

2021-03-04 Thread Tore Anderson
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

[issue43396] Non-existent method sqlite3.Connection.fetchone() used in docs

2021-03-03 Thread Tore Anderson
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

[issue42917] Block stack size for frame objects should be dynamically sizable

2021-01-15 Thread Thomas Anderson
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. -- ___

[issue42917] Block stack size for frame objects should be dynamically sizable

2021-01-12 Thread Thomas Anderson
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

[issue38295] test_relative_path of test_py_compile fails on macOS 10.15 Catalina

2019-12-17 Thread Bo Anderson
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"

[issue38295] test_relative_path of test_py_compile fails on macOS 10.15 Catalina

2019-12-17 Thread Bo Anderson
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_

[issue38295] test_relative_path of test_py_compile fails on macOS 10.15 Catalina

2019-11-25 Thread Bo Anderson
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

[issue38833] Issue with multiprocessing.Pool & multiprocessing.Queue

2019-11-17 Thread Charles Anderson
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

[issue1154351] add get_current_dir_name() to os module

2018-10-28 Thread Marc Adam Anderson
Change by Marc Adam Anderson : -- nosy: -marcadam ___ Python tracker <https://bugs.python.org/issue1154351> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34510] Add add HTTPConnection.settimeout()

2018-08-26 Thread Collin Anderson
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

[issue32151] -mvenv vs minor python version updates

2017-12-01 Thread Ric Anderson
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

[issue32151] -mvenv vs minor python version updates

2017-11-30 Thread Ric Anderson
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

[issue32151] -mvenv vs minor python version updates

2017-11-27 Thread Ric Anderson
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

[issue30829] 'Cannot serialize socket object' after ssl.wrap_socket

2017-07-02 Thread Anderson
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

[issue30829] 'Cannot serialize socket object' after ssl_wrap

2017-07-02 Thread Anderson
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

[issue29574] python-3.6.0.tgz permissions borked

2017-02-15 Thread Dave Anderson
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

[issue29574] python-3.6.0.tgz permissions borked

2017-02-15 Thread Dave Anderson
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

[issue26688] unittest2 referenced in unittest.mock documentation

2016-04-01 Thread Ashley Anderson
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

[issue25228] Regression in cookie parsing with brackets and quotes

2016-03-08 Thread Collin Anderson
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

[issue25228] Regression in cookie parsing with brackets and quotes

2016-02-10 Thread Collin Anderson
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=

[issue12006] strptime should implement %G, %V and %u directives

2015-10-02 Thread Ashley Anderson
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

[issue12006] strptime should implement %G, %V and %u directives

2015-09-30 Thread Ashley Anderson
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

[issue12006] strptime should implement %G, %V and %u directives

2015-09-30 Thread Ashley Anderson
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

[issue12006] strptime should implement %G, %V and %u directives

2015-09-02 Thread Ashley Anderson
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

[issue12006] strptime should implement %G, %V and %u directives

2015-08-02 Thread Ashley Anderson
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

[issue12006] strptime should implement %G, %V and %u directives

2015-07-31 Thread Ashley Anderson
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

[issue12006] strptime should implement %G, %V and %u directives

2015-07-28 Thread Ashley Anderson
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

[issue23933] Struct module should acept arrays

2015-04-13 Thread Anderson
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

[issue23933] Struct module should acept arrays

2015-04-13 Thread Anderson
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

[issue23038] #python.web irc channel is dead

2014-12-12 Thread Collin Anderson
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

[issue20805] Error in 3.3 Tutorial

2014-02-28 Thread Gene Anderson
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

[issue20805] Error in 3.3 Tutorial

2014-02-28 Thread Gene Anderson
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

[issue1154351] add get_current_dir_name() to os module

2013-03-20 Thread Marc Adam Anderson
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

[issue5993] python produces zombie in webbrowser.open

2013-03-19 Thread Marc Adam Anderson
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

[issue8862] curses.wrapper does not restore terminal if curses.getkey() gets KeyboardInterrupt

2013-03-19 Thread Marc Adam Anderson
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

[issue12006] strptime should implement %V or %u directive from libc

2011-06-03 Thread Ashley Anderson
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

[issue12006] strptime should implement %V or %u directive from libc

2011-05-26 Thread Ashley Anderson
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

[issue12006] strptime should implement %V or %u directive from libc

2011-05-26 Thread Ashley Anderson
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

[issue12006] strptime should implement %V or %u directive from libc

2011-05-26 Thread Ashley Anderson
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

[issue12006] strptime should implement %V or %u directive from libc

2011-05-25 Thread Ashley Anderson
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

[issue12006] strptime should implement %V or %u directive from libc

2011-05-25 Thread Ashley Anderson
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

[issue12006] strptime should implement %V or %u directive from libc

2011-05-25 Thread Ashley Anderson
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

[issue12006] strptime should implement %V or %u directive from libc

2011-05-24 Thread Ashley Anderson
Changes by Ashley Anderson agande...@gmail.com: -- nosy: +Ashley.Anderson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12006 ___ ___ Python-bugs

[issue12006] strptime should implement %V or %u directive from libc

2011-05-24 Thread Ashley Anderson
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

[issue12006] strptime should implement %V or %u directive from libc

2011-05-24 Thread Ashley Anderson
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

[issue3646] MacOS X framework install to non-standard directory fails

2010-05-05 Thread Amos Anderson
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

[issue2661] Mapping tests cannot be passed by user implementations

2008-04-19 Thread David Anderson
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