[issue16355] inspect.getcomments() does not work in the interactive shell

2013-12-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: So, I just found out that imp has been deprecated. Here is the patch that uses importlib.machinery instead of imp.load_source. -- Added file: http://bugs.python.org/file33127/issue16355_v5.diff ___ Python tracker

[issue19846] Python 3 raises Unicode errors with the C locale

2013-12-13 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks Victor - I now agree that trying to guess another encoding is a bad idea, and that enabling surrogateescape for the standard streams under the C locale is a better way to go. -- ___ Python tracker

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Nick Coghlan
Nick Coghlan added the comment: Getting rid of mojibake was the goal, surrogateescape was about dealing with cases where the "avoid mojibake" checks were spuriously breaking round-tripping between OS APIs due to other configuration errors (with LANG=C being set, or LANG not being set at all be

[issue14432] Bug in generator if the generator in created in a temporary C thread

2013-12-13 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, I always forget that frameobject.h isn't included from python.h because none of the names have underscore prefixes. In that case, together with the new note in the porting section, I agree this is fine. -- ___ Pytho

[issue19970] Typo of `immediatly` and `agin` words

2013-12-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: R. David Murray, there is a reason I create separate patches for 3.3 and 3.4. You couldn't just merge them. Python 3.4 has additional file with typo, which is immediatly in Doc/library/asyncio-protocol.rst. :) -- ___

[issue19099] struct.pack fails first time with unicode fmt

2013-12-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, I think the error message can be improved because in Python 2.7 we differentiate very clearly the string from the unicode. >>> import struct >>> struct.Struct(1) Traceback (most recent call last): File "", line 1, in TypeError: Struct() argument 1 must b

[issue19962] Create a 'python.bat' script to invoke interpreter from source root

2013-12-13 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2013-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: I do not think you have exactly identified a bug, certainly not one we would fix in an existing release. The behavior in more of an unintended consequence of separate decisions resulting from an unanticipated usage. I am not sure what, if anything, should be d

[issue19936] Executable permissions of Python source files

2013-12-13 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue19954] test_tk floating point exception on my gentoo box with tk 8.6.1

2013-12-13 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- title: test_tk floating point exception on my gentoo box running tk 8.6.1 -> test_tk floating point exception on my gentoo box with tk 8.6.1 ___ Python tracker __

[issue19953] __iadd__() doc not strictly correct

2013-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: The current doc is correct. Unlike the old incorrect version of the operator doc (#7259), it does not say that the call is all of the execution. The suggested replacement "x = x.__iadd__(y) is called" is not correct as statements are not called. The said, it

[issue19933] Round default argument for "ndigits"

2013-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: The docstring is better than the current doc as it says that the default precision is 0, without calling that the default for ndigits. ''' round(number[, ndigits]) -> number Round a number to a given precision in decimal digits (default 0 digits).

[issue19970] Typo of `immediatly` and `agin` words

2013-12-13 Thread R. David Murray
R. David Murray added the comment: Thanks, Vajrasky. -- nosy: +r.david.murray resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue19970] Typo of `immediatly` and `agin` words

2013-12-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8e18a3b54bbe by R David Murray in branch '3.3': #19970: Fix some comment typos. http://hg.python.org/cpython/rev/8e18a3b54bbe New changeset 358a35471f9f by R David Murray in branch 'default': Merge: #19970: Fix some comment typos. http://hg.python.o

[issue19980] Improve help('non-topic') response

2013-12-13 Thread Mark Lawrence
Mark Lawrence added the comment: IMHO this must be changed. >>> help('') # nothing!!! >>> help('a') Help on module a: ... I happened to have a module called a.py in the default directory. -- nosy: +BreamoreBoy ___ Python tracker

[issue19914] help([object]) returns "Not enough memory." on standard Python types, object and object functions

2013-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: cp65001 fails in many ways quite independent of Python. Idle: >>> "ሴé€㑖Ѓ⌴*" 'ሴé€㑖Ѓ⌴*' Pasting the same string into Command Prompt (Win 7, USA, updated): C:\Users\Terry>echo "?‚*" "?‚*" C:\Users\Terry>chcp 65001 Active code page: 65001 C:\Users\Terry>ech

[issue18918] help('FILES') finds no documentation

2013-12-13 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue19980] Improve help('non-topic') response

2013-12-13 Thread Terry J. Reedy
New submission from Terry J. Reedy: >>> help(1) # help on int >>> help(b'a') # help on bytes >>> help('a') no Python documentation found for 'a' The reason for this unhelpful response is that strings are treated differently from all other non-class objects. (msg205861 thought this a bug.) The s

[issue17088] ElementTree incorrectly refuses to write attributes without namespaces when default_namespace is used

2013-12-13 Thread Wim
Wim added the comment: Here's an improved patch (and improved testcase). It's a little more intrusive than the last patch because when a default namespace is being used, two distinct qname caches must be made. -- Added file: http://bugs.python.org/file33125/bug17088_2.patch __

[issue19975] Remove unused imports from webbrowser

2013-12-13 Thread R. David Murray
R. David Murray added the comment: Thanks, Claudiu. -- nosy: +r.david.murray resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue19975] Remove unused imports from webbrowser

2013-12-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset f2c6b0485ce6 by R David Murray in branch 'default': #19975: remove unused imports from webbrowser module. http://hg.python.org/cpython/rev/f2c6b0485ce6 -- nosy: +python-dev ___ Python tracker

[issue19972] Leak in pickle (?)

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: I just see that it should be: static void pickle_free(PyObject *m) ... Even then, the cast is necessary, otherwise you get this warning: /home/stefan/hg/cpython/Modules/_pickle.c:7450:1: warning: initialization from incompatible pointer type [enabled by default

[issue4130] Intel icc 9.1 does not support __int128_t used by ctypes

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: Our included libffi is: 2013-03-17 Anthony Green * README: Update for 3.0.13. * configure.ac: Ditto. * configure: Rebuilt. * doc/*: Update version. According to https://sourceware.org/libffi/ that is the latest released version

[issue19385] dbm.dumb should be consistent when the database is closed

2013-12-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Now this seems odd, maybe catching + reraising an exception has a greater > overhead than a func call and checking if an attribute is None. Yes, of course, catching + reraising an exception is costly. But when an exception is not raised, this is cheap. Usu

[issue19704] Update test.test_threaded_import to PEP 451

2013-12-13 Thread Brett Cannon
Changes by Brett Cannon : -- dependencies: -Merge all (non-syntactic) import-related tests into test_importlib resolution: -> fixed status: open -> closed ___ Python tracker _

[issue19704] Update test.test_threaded_import to PEP 451

2013-12-13 Thread Roundup Robot
New submission from Roundup Robot: New changeset dbb9c23e1887 by Brett Cannon in branch 'default': Issue #19704: Port test.test_threaded_import to PEP 451 http://hg.python.org/cpython/rev/dbb9c23e1887 -- nosy: +python-dev ___ Python tracker

[issue19974] tarfile doesn't overwrite symlink by directory

2013-12-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka versions: +Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue19979] Missing nested scope vars in class scope (bis)

2013-12-13 Thread Armin Rigo
New submission from Armin Rigo: This is a repeat of the old issue 532860: "NameError assigning to class in a func". It is about class statements' variable lookups, which has different behavior at module level or in a nested scope: def f(n): class A: n = n # doesn't work, tries

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Mojibake in input can cause decoding error in other application which consumes output of Python script. In some cases this can be even worse thin UnicodeError in producer. But for C locale this makes sense. I think we should try this experiment in 3.5. Ther

[issue19562] Added description for assert statement

2013-12-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thank you for the explanation. If the style comment is not in the file already, you might add it whenever you next edit the file for substantive purposes (a real bug or feature change). Ditto for _DI4Y. -- ___ Pytho

[issue19972] Leak in pickle (?)

2013-12-13 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: The patch is good. I am not sure if you need the freefunc cast though. The example in the PEP 3121 should updated if freefunc is actually required. I didn't define freefunc because of this example. -- ___ Pyth

[issue19705] Update test.test_namespace_pkgs to PEP 451

2013-12-13 Thread Brett Cannon
New submission from Brett Cannon: There is nothing to update; the tests work through the import statement directly. -- dependencies: -Merge all (non-syntactic) import-related tests into test_importlib resolution: -> invalid status: open -> closed

[issue19701] Update multiprocessing for PEP 451

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: I think this is as fixed as it's going to be until Python 3.5 and the code is updated to use runpy (see http://bugs.python.org/issue19978). -- dependencies: -refactor pythonrun.c to make use of specs (__main__.__spec__) resolution: -> fixed status: open

[issue19978] Update multiprocessing.spawn to use runpy.run_path

2013-12-13 Thread Brett Cannon
Changes by Brett Cannon : -- dependencies: +refactor pythonrun.c to make use of specs (__main__.__spec__) ___ Python tracker ___ ___ P

[issue19968] Python does not play well with 'stow'.

2013-12-13 Thread Quanah Gibson-Mount
Quanah Gibson-Mount added the comment: Thank you very much for looking at it. :) Since I can work around it easily enough, I'm set for now, but it would be great to see Python play nicely with stow in a future release. -- ___ Python tracker

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Toshio Kuratomi
Toshio Kuratomi added the comment: My impression was that python3 was supposed to help get rid of UnicodeError tracebacks, not mojibake. If mojibake was the problem then we should never have gone down the surrogateescape path for input. -- ___ Pyth

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Olivier Grisel
Olivier Grisel added the comment: For Python 3.4: Maybe rather than raising ImportError, we could issue warning to notify the users that names from the __main__ namespace could not be loaded and make the init_module_attrs return early. This way a multiprocessing program that only calls functi

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Let's reopen, shall we? If not for 3.4, at least for 3.5. It's likely that multiprocessing needs a __main__ simply because it needs a way to replicate the parent process' state in the child (for example, the set of imported modules, the logging configuration,

[issue19968] Python does not play well with 'stow'.

2013-12-13 Thread R. David Murray
R. David Murray added the comment: Since it appears to be a perl based, it is not too surprising it works well with perl :) A little googling turns up someone suggesting that the logic for finding things be changed slightly, such that if the binary is itself a symbolic link, it will look in t

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Olivier Grisel
Olivier Grisel added the comment: I can wait (or monkey-patch the stuff I need as a temporary workaround in my code). My worry is that Python 3.4 will introduce a new feature that is very crash-prone. Take this simple program that uses the newly introduced `get_context` function (the same pro

[issue19963] Update docs for importlib.import_module()

2013-12-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset a44be62026fc by Brett Cannon in branch '3.3': Issue #19963: Document that importlib.import_module() will import http://hg.python.org/cpython/rev/a44be62026fc New changeset 33938321d46f by Brett Cannon in branch 'default': merge for issue #19963 http

[issue19963] Update docs for importlib.import_module()

2013-12-13 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue19968] Using DESTDIR breaks sys.path

2013-12-13 Thread Quanah Gibson-Mount
Quanah Gibson-Mount added the comment: Ok, so the general idea is to be able to install your software in a specific location and then symlink it back into another location (like /usr/local). This allows quick and easy software version swapping. I've used it to do things like test mariadb vs

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I'm sorry, Oliver, you are simply going to have to wait for Python 3.5 > at this point to get the new semantics you want. Side note: it's Olivier, not Oliver. -- ___ Python tracker

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: I'm sorry, Oliver, you are simply going to have to wait for Python 3.5 at this point to get the new semantics you want. -- ___ Python tracker ___

[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: Christian Heimes pointed out #ifdef __clang__ might be necessary to silence warnings on other platforms. -- ___ Python tracker ___ __

[issue19298] Use __attribute__(cleanup ...) to detect refleaks

2013-12-13 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: +skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread R. David Murray
R. David Murray added the comment: Reintroducing moji-bake intentionally doesn't sound like a particularly good idea, wasn't that what python3 was supposed to help prevent? It does seem like a utf-8 default is the Way of the Future. Or even the present, most places. -- _

[issue19968] Using DESTDIR breaks sys.path

2013-12-13 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue18036] "How do I create a .pyc file?" FAQ entry is out of date

2013-12-13 Thread R. David Murray
R. David Murray added the comment: Thanks, A Kaptur and Phil. I used Phil's patch, and added some additional tweaks and words. (For example, I don't think PYTHONDONTWRITEBYTECODE existed when the FAQ entry was last updated). I've chosen to maintain the existing flow, since it matches the tit

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Olivier Grisel
Olivier Grisel added the comment: > The semantics are not going to change in python 3.4 and will just stay as > they were in Python 3.3. Well the semantics do change: in Python 3.3 the spawn and forkserver modes did not exist at all. The "spawn" mode existed but only implicitly and only under

[issue19562] Added description for assert statement

2013-12-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: @terry - datetime.py was originally written as a prototype for the C code and many seemingly unpythonic constructs therein are motivated by the desire to ease the translation to C. I would not mind simplifying _DI4Y calculation as you suggest, but please

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: Multiple questions from Oliver to answer. > Why has this issue been closed? Because the decided issue of this bug -- raising AttributeError over ImportError -- was fixed. > Won't the spawn and forkserver mode work in Python 3.4 for Python program > started by

[issue18036] "How do I create a .pyc file?" FAQ entry is out of date

2013-12-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset a14f830196ec by R David Murray in branch '3.3': #18036: update .pyc FAQ entry in light of PEP 3147. http://hg.python.org/cpython/rev/a14f830196ec New changeset a757bdfce6b3 by R David Murray in branch 'default': Merge: #18036: update .pyc FAQ entry

[issue19562] Added description for assert statement

2013-12-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am going to reject this. Assert failures should never be seen by users and for a developer "assert 1 <= month <= 12" is as clear as "month must be in 1..12." -- nosy: +belopolsky resolution: -> wont fix stage: -> committed/rejected status: o

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > When LANG=C is used to get the english language (which is a mistake, > LC_CTYPE=C should be used instead) I think you mean LC_MESSAGES=C here. (but it's not only about the English language; it's also about other locale parameters such as number formatting) I

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: os.fsencode(text) always fail if text cannot be encoded to sys.getfilesystemencoding(). surrogateescape doesn't help here. Your example is "artificial", you should not get 'ä'. All OS data is decoded from the filesystem encoding using the surrogateescape error

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: test_ls.py: test script producing invalid filenames and then trying to display them into stdout. Output with UTF-8 locale, UTF-8 terminal and Python 3.3 (or unpatched 3.4, it's the same): ascii.txt utf8:é€.txt Output with C locale (ASCII), UTF-8 terminal a

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread Sworddragon
Sworddragon added the comment: What would happen if we call this example script with LANG=C on the patch?: --- import os for name in sorted(os.listdir('ä')): print(name) --- Would it throw an exception on os.listdir('ä')? -- ___ Python track

[issue12837] Patch for issue #12810 removed a valid check on socket ancillary data

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: Two things. First, I'm sorry David but my mind is not working fully enough at the moment to see how msg_controllen is compared to cmsg_len_end without relying on external value coming in through the parameters of the function. Second, I have re-uploaded my patch

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Olivier Grisel
Olivier Grisel added the comment: Why has this issue been closed? Won't the spawn and forkserver mode work in Python 3.4 for Python program started by a Python script (which is probably the majority of programs written in Python under unix)? Is there any reason not to use the `imp.load_source`

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset cea42629ddf5 by Brett Cannon in branch 'default': Issue #19946: Raise ImportError when the main module cannot be found http://hg.python.org/cpython/rev/cea42629ddf5 -- nosy: +python-dev ___ Python tracker

[issue19846] Python 3 raises Unicode errors with the C locale

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: I propose to modify the error handler, the encoding cannot be modified. See my following message explaining why it's not possible to change the encoding: http://bugs.python.org/issue19846#msg205675 -- ___ Python trac

[issue19978] Update multiprocessing.spawn to use runpy.run_path

2013-12-13 Thread Brett Cannon
New submission from Brett Cannon: Once the 'target' parameter for runpy.run_path lands then multiprocessing.spawn should be updated to use it. -- components: Library (Lib) messages: 206117 nosy: brett.cannon, jnoller, ncoghlan, sbt priority: normal severity: normal stage: test needed st

[issue19946] Have multiprocessing raise ImportError when spawning a process that can't find the "main" module

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: Created http://bugs.python.org/issue19978 to track using runpy.run_path in 3.5. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue19977] Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: Oh, in fact, sys.stdin is also modified by the patch (as I expected). -- title: Use "surrogateescape" error handler for sys.stdout on UNIX for the C locale -> Use "surrogateescape" error handler for sys.stdin and sys.stdout on UNIX for the C locale __

[issue19846] Python 3 raises Unicode errors with the C locale

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: I created the issue #19977 as a follow up of this one: "Use surrogateescape error handler for sys.stdout on UNIX for the C locale". -- ___ Python tracker _

[issue19847] Setting the default filesystem-encoding

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: I created the issue #19977 as a follow up of this one: "Use surrogateescape error handler for sys.stdout on UNIX for the C locale". -- ___ Python tracker _

[issue19977] Use "surrogateescape" error handler for sys.stdout on UNIX for the C locale

2013-12-13 Thread STINNER Victor
New submission from STINNER Victor: When LANG=C is used to get the english language (which is a mistake, LC_CTYPE=C should be used instead) or when Python is started with an empty environment (no environment variable), Python gets the POSIX locale (aka "C locale") for the LC_CTYPE (encoding) l

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: STINNER Victor wrote: > I would prefer Py_UNUSED name. This sounds like a nice addition to > Include/pymacros.h. Yes, Py_UNUSED is nicer. -- ___ Python tracker

[issue19846] Python 3 raises Unicode errors with the C locale

2013-12-13 Thread Toshio Kuratomi
Toshio Kuratomi added the comment: It's not a bug for upstart, systemd, sysvinit, cron, etc to use LANG=C. The POSIX locale is the only locale guaranteed to exist on a system. Therefore these low level services should be using LANG=C. Embedded systems, thin clients, and other low memory or

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: Larry Hastings wrote: > To do it properly with Clang requires a pragma: Hmm. I just tested and clang warns with -Wall -W, but does not warn if __attribute__((unused)) is present. The macro I posted really works on all obscure buildbot platforms. --

[issue19846] Python 3 raises Unicode errors with the C locale

2013-12-13 Thread Sworddragon
Sworddragon added the comment: > https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1235483 After opening many hundred tickets I would say: With luck this ticket will get a response within the next year. But in the worst case it will be simply refused. > I found examples using "LANG=$LAN

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: Stefan Krah wrote: > The macro I posted really works on all obscure buildbot platforms. N.B. clang also defines __GNUC__, as does the intel compiler. -- ___ Python tracker _

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: > We could call the macro PY_UNUSED or something. I would prefer Py_UNUSED name. This sounds like a nice addition to Include/pymacros.h. In C++, you can omit the parameter name, so the macro should take the parameter name: Py_UNUSED(name). Example: int fo

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Larry Hastings
Larry Hastings added the comment: To do it properly with Clang requires a pragma: http://stackoverflow.com/questions/3417837/what-is-the-best-way-to-supress-unused-variable-x-warning/18724213#18724213 What a mess. -- ___ Python tracker

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Larry Hastings
Larry Hastings added the comment: A quick google suggests: http://sourcefrog.net/weblog/software/languages/C/unused.html -- ___ Python tracker ___ __

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Stefan Krah
Stefan Krah added the comment: STINNER Victor wrote: > If you prefer to add the unused parameter, what do you propose to avoid > compiler warnings if unused parameters are checked? This works quite portably in _decimal (I don't get warnings from gcc, icc, suncc, Visual Studio, aCC, clang): #i

[issue19846] Python 3 raises Unicode errors with the C locale

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: By the way, Java behaves as Python: with LANG=C, Java uses ASCII: http://stackoverflow.com/questions/13415975/cant-read-utf-8-filenames-when-launched-as-an-upstart-service > udev and Upstart are not setting LANG So it's an issue in udev and Upstart. See for ex

[issue19973] Deprecate pyio

2013-12-13 Thread Larry Hastings
Larry Hastings added the comment: Yes, but it's a small utility. If it costs nothing to maintain _pyio then okay. But if we're spending measurable time on it but it's only a nice-to-have then we should drop it. (Full disclosure: I have no idea how much work goes into maintaining _pyio.) ---

[issue19973] Deprecate pyio

2013-12-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Then if Jython and IronPython are not using _pyio we can probably remove the > file. _pyio can be useful for prototyping. Whether or not other implementations use it is quite irrelevant IMO. -- ___ Python tracker

[issue19846] Python 3 raises Unicode errors with the C locale

2013-12-13 Thread Sworddragon
Sworddragon added the comment: By the way I have found a valid use case for LANG=C. udev and Upstart are not setting LANG which will result in the ascii encoding for invoked Python scripts. This could be a problem since these applications are commonly dealing with non-ascii filesystems. -

[issue19973] Deprecate pyio

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: Then if Jython and IronPython are not using _pyio we can probably remove the file. -- ___ Python tracker ___

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Larry Hastings
Larry Hastings added the comment: Stefan is right. I'll fix Clinic. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: I prefer to omit the unused parameter, even if NULL *is* passed to the function. If you prefer to add the unused parameter, what do you propose to avoid compiler warnings if unused parameters are checked? -- nosy: +haypo __

[issue19385] dbm.dumb should be consistent when the database is closed

2013-12-13 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: IMHO it is a bug fix, not a new feature, and could be applied in 3.3 and 3.4. -- ___ Python tracker ___ ___

[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2013-12-13 Thread Stefan Krah
New submission from Stefan Krah: I was just reading the _pickle sources and it appears that AC does not generate a second arg for METH_NOARGS functions: #define _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF\ {"clear", (PyCFunction)_pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerM

[issue19973] Deprecate pyio

2013-12-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: PyPy also has a "C-translated" version of the io module. It's a bit faster I think, but more importantly it has correct behavior with signals and other asynchronous errors. _pyio.py can be stopped in the middle of any function, and is not completely sign

[issue19975] Remove unused imports from webbrowser

2013-12-13 Thread Claudiu.Popa
New submission from Claudiu.Popa: The attached patch removes three unused imports in webbrowser module. -- components: Library (Lib) files: webbrowser_unused_imports.patch keywords: patch messages: 206091 nosy: Claudiu.Popa, georg.brandl priority: normal severity: normal status: open tit

[issue19973] Deprecate pyio

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: Key point is it didn't go so well **for us**; works fine for PyPy. -- ___ Python tracker ___ ___ Pytho

[issue19973] Deprecate pyio

2013-12-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Note: _pyio is not 100% *pure* Python, it relies on FileIO which is > implemented in C. I always found this surprising. One day I will maybe > rewrite it using os.read() and os.write() :-) Then you need to rewrite os.read() and os.write() in pure Python!

[issue19973] Deprecate pyio

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: > We tried a pure python implementation of io once. Didn't go so well. :p It is _pyio. Note: _pyio is not 100% *pure* Python, it relies on FileIO which is implemented in C. I always found this surprising. One day I will maybe rewrite it using os.read() and

[issue19973] Deprecate pyio

2013-12-13 Thread Larry Hastings
Larry Hastings added the comment: We tried a pure python implementation of io once. Didn't go so well. :p -- ___ Python tracker ___

[issue14432] Bug in generator if the generator in created in a temporary C thread

2013-12-13 Thread Stefan Behnel
Stefan Behnel added the comment: > frameobject.h is not included in Python.h, so the > classic #include "Python.h" doesn't give you access to PyFrameObject > structure. You have to add a second #include "frameobject.h". Ah, right. I keep misremembering that, because in order to do anything non-

[issue19969] PyBytes_FromFormatV("%c") and PyString_FromFormatV("%c") don't check for character min/max value

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: It was easy to fix the issue on Python 3.3 (there are already unit tests on PyBytes_FromFormatV). I prefer to leave Python 2.7 with it's current behaviour because applications running on Python 2.7 may be old and might be rely on the integer overflow. PyStrin

[issue19230] Reimplement the keyword module in C

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: You're right, the regeneration might be specific to CPython (although maybe it should work from Grammar/Grammar instead?), but that's just creating the Python file which we check into the stdlib, so any VM can use it, they just can't recreate it (which is fine s

[issue19973] Deprecate pyio

2013-12-13 Thread Brett Cannon
Brett Cannon added the comment: Only if we keep the C version around do we have to care about two versions. =) -- ___ Python tracker ___ _

[issue19230] Reimplement the keyword module in C

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: > Second, PEP 399 requires the pure Python version stick around, else you need > to request an exception to drop keyword.py from python-dev. I don't understand the purpose of providing a Python implementation of the keyword module. If you look at the current i

  1   2   >