GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [BUG] invalid non-printable character U+FEFF · Issue #384 · pythonprofilers/memory_profiler

[BUG] invalid non-printable character U+FEFF #384

New issue
Copy link
New issue
Copy link
Open
Open
[BUG] invalid non-printable character U+FEFF#384
Copy link

Description

@shenjackyuanjie
shenjackyuanjie
opened on Feb 6, 2023
Issue body actions

I try to use memory profiler in my project, but it gives me this issue

shenjack  DR  ➜ (main  1)  ♥ 13:13  mprof.exe run DR.py
mprof: Sampling memory every 0.1s
running new process
running as a Python program...
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\APPS\CPython\Python311\Lib\site-packages\memory_profiler.py", line 1351, in <module>
    exec_with_profiler(script_filename, prof, args.backend, script_args)
  File "D:\APPS\CPython\Python311\Lib\site-packages\memory_profiler.py", line 1252, in exec_with_profiler
    exec(compile(f.read(), filename, 'exec'), ns, ns)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "DR.py", line 1
    """
    ^
SyntaxError: invalid non-printable character U+FEFF

you can see the file in my project

Python info

  • Version: 3.11.0
  • Branch: ``
  • Implementation: CPython
  • Compiler: MSC v.1933 64 bit (AMD64)

System info

  • System: Windows-10-10.0.19045-SP0
  • Computer name: shenjack-5600X
  • machine: AMD64
  • processor: AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD
  • release: 10
  • version: 10.0.19045

Python info and System info gen by DR_crash_report

Activity

  1. altendky commented on Feb 6, 2023

    @altendky
    altendky
    on Feb 6, 2023
    Collaborator
    More actions

    Looks like a byte order mark. I think notepad has a tendency to add these? For a workaround, you might try copy/pasting to a new file in another editor and saving that. For a potential change in this library, we could use encodings.utf_8_sig to open the file. That would be useful in this case. More generally, it would be nice if there is a way to open the file "like Python opens the file". That would cover coding: comments, but I don't know how that is done or if it is available to us at all.

  2. shenjackyuanjie commented on Feb 7, 2023

    @shenjackyuanjie
    shenjackyuanjie
    on Feb 7, 2023
    Author
    More actions

    hmmmmm
    thanks for anser!

  3. shenjackyuanjie commented on Feb 19, 2023

    @shenjackyuanjie
    shenjackyuanjie
    on Feb 19, 2023
    Author
    More actions

    well
    is actully my? fault
    image

  4. shenjackyuanjie commented on Feb 19, 2023

    @shenjackyuanjie
    shenjackyuanjie
    on Feb 19, 2023
    Author
    More actions

    maybe close this issue later

  5. altendky commented on Feb 19, 2023

    @altendky
    altendky
    on Feb 19, 2023
    Collaborator
    More actions

    I think that it is triggered by your situation. I don't think that makes it "your fault". I also don't think that means there isn't anything to fix in this project. I think we should make a change to allow for BOMs, and anything else Python allows such as the coding comments. I just haven't made the time to do that.

    Reacted by Dobatymo and shenjackyuanjie
  6. shenjackyuanjie commented on Feb 20, 2023

    @shenjackyuanjie
    shenjackyuanjie
    on Feb 20, 2023
    Author
    More actions

    oh, got it
    thanks for answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.