pygame is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

pygame / pygame http://pygame.org/

Clone this repository (size: 15.4 MB): HTTPS / SSH
hg clone https://bitbucket.org/pygame/pygame
hg clone ssh://hg@bitbucket.org/pygame/pygame

Issues

#105 ImportError: No module named scrap on Windows 7 x64

Reported by Mahmoud Hossam

I have installed Python 3.2 (32-bit) and pygame 1.9.2 on windows 7 using the installers on the website, but I get an ImportError when trying to access pygame's help inside the interpreter

Python 3.2.2 (default, Sep  4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import pygame
>>> pygame.init()
(6, 0)
>>> help(pygame)

Warning (from warnings module):
  File "C:\Python32\lib\inspect.py", line 103
    return (hasattr(object, "__get__")
RuntimeWarning: use scrap: No module named scrap
(ImportError: No module named scrap)
Traceback (most recent call last):
  File "<pyshell<<issue 2>>>", line 1, in <module>
    help(pygame)
  File "C:\Python32\lib\site.py", line 457, in __call__
    return pydoc.help(*args, **kwds)
  File "C:\Python32\lib\pydoc.py", line 1754, in __call__
    self.help(request)
  File "C:\Python32\lib\pydoc.py", line 1804, in help
    else: doc(request, 'Help on %s:', output=self._output)
  File "C:\Python32\lib\pydoc.py", line 1540, in doc
    pager(render_doc(thing, title, forceload))
  File "C:\Python32\lib\pydoc.py", line 1533, in render_doc
    return title % desc + '\n\n' + renderer.document(object, name)
  File "C:\Python32\lib\pydoc.py", line 338, in document
    if inspect.ismodule(object): return self.docmodule(*args)
  File "C:\Python32\lib\pydoc.py", line 1064, in docmodule
    for key, value in inspect.getmembers(object, inspect.isroutine):
  File "C:\Python32\lib\inspect.py", line 263, in getmembers
    if not predicate or predicate(value):
  File "C:\Python32\lib\inspect.py", line 248, in isroutine
    or ismethoddescriptor(object))
  File "C:\Python32\lib\inspect.py", line 103, in ismethoddescriptor
    return (hasattr(object, "__get__")
  File "C:\Python32\lib\site-packages\pygame\__init__.py", line 70, in __getattr__
    raise NotImplementedError(MissingPygameModule)
NotImplementedError: scrap module not available
(ImportError: No module named scrap)
Status: open Responsible: nobody Type: bug Priority: minor
Milestone: none Component: none Version: none

Attachments

Comments and changes

  1. #1 Anonymous

    written

    +1, I also have this error and was wondering if it was a bug in the distribution or my installation

  2. #2 cgohlke

    written

    The scrap extension is not yet ported to Python 3 for Windows, and is excluded in setup.py. See https://bitbucket.org/pygame/pygame/src/0921cc0fbca7/setup.py#cl-159. The attached patch should fix this.

  3. #3 Lenard Lindstrom

    written

    • Changed status from new to open.

    I have enabled scrap builds for Python 3.x on Windows in changeset d811a6f742d8. It passes the unit tests. Warning, though, scrap is buggy with binary data.

  4. #4 Lenard Lindstrom

    written

    Fix bytes decoding problem in scrap_clipboard.py example (refs #105)

    On Windows, the '\ufffd' unicode replacement character is not recognized. So, for the 'replace' decoding errors option, a UnicodeEncodingError exception is raised for non-ascii bytes. The 'ignore' errors option, though less informative, raises no exceptions.

    5000f3ee7c23

  5. #5 Lenard Lindstrom

    written

    My concern regarding binary data in the clipboard was unfounded. It was a problem with pygame.examples.scrap_clipboard, not pygame.scrap. So please give scrap another try on Windows. If there are no more concerns I will close this issue.

  6. #6 Lenard Lindstrom

    written

    • Changed milestone from nothing to 1.9.2.
    • Changed priority from major to minor.
    • Changed component from nothing to scrap.
  7. #7 Anonymous

    written

    I have this problem too ('scrap not available'). Does anybody know help???????

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?